Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >springboot开发之显示员工信息

springboot开发之显示员工信息

作者头像
西西嘛呦
发布于 2020-08-26 07:15:21
发布于 2020-08-26 07:15:21
2.8K00
代码可运行
举报
运行总次数:0
代码可运行

接上一节:

暂时就只用Dao和Controller了,没有service层和连接数据库。

目前目录结构:

在entities包中:有Employee.java、Department.java

Employee.java

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.gong.springbootcurd.entities;

import java.util.Date;

public class Employee {

    private Integer id;
    private String lastName;

    private String email;
    //1 male, 0 female
    private Integer gender;
    private Department department;
    private Date birth;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }
    public Employee(Integer id, String lastName, String email, Integer gender,
                    Department department) {
        super();
        this.id = id;
        this.lastName = lastName;
        this.email = email;
        this.gender = gender;
        this.department = department;
        this.birth = new Date();
    }

    public Employee() {
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", lastName='" + lastName + '\'' +
                ", email='" + email + '\'' +
                ", gender=" + gender +
                ", department=" + department +
                ", birth=" + birth +
                '}';
    }
    
    
}

Department.java

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.gong.springbootcurd.entities;

public class Department {

    private Integer id;
    private String departmentName;

    public Department() {
    }
    
    public Department(int i, String string) {
        this.id = i;
        this.departmentName = string;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    @Override
    public String toString() {
        return "Department [id=" + id + ", departmentName=" + departmentName + "]";
    }
    
}

EmployeeController.java

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.gong.springbootcurd.controller;

import com.gong.springbootcurd.dao.DepartmentDao;
import com.gong.springbootcurd.dao.EmployeeDao;
import com.gong.springbootcurd.entities.Department;
import com.gong.springbootcurd.entities.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;

@Controller
public class EmployeeController {
    @Autowired
    EmployeeDao employeeDao;

    //查询所有员工返回列表页面
    @GetMapping("/emps")
    public String  list(Model model){
        Collection<Employee> employees = employeeDao.getAll();

        //放在请求域中
        model.addAttribute("emps",employees);
        // thymeleaf默认就会拼串
        // classpath:/templates/xxxx.html
        return "emp/list";
    }
}

EmployeeDao.java

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.gong.springbootcurd.dao;

import com.gong.springbootcurd.entities.Employee;
import com.gong.springbootcurd.entities.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

@Repository
public class EmployeeDao {

    private static Map<Integer, Employee> employees = null;
    
    @Autowired
    private DepartmentDao departmentDao;
    
    static{
        employees = new HashMap<Integer, Employee>();

        employees.put(1001, new Employee(1001, "E-AA", "aa@163.com", 1, new Department(101, "D-AA")));
        employees.put(1002, new Employee(1002, "E-BB", "bb@163.com", 1, new Department(102, "D-BB")));
        employees.put(1003, new Employee(1003, "E-CC", "cc@163.com", 0, new Department(103, "D-CC")));
        employees.put(1004, new Employee(1004, "E-DD", "dd@163.com", 0, new Department(104, "D-DD")));
        employees.put(1005, new Employee(1005, "E-EE", "ee@163.com", 1, new Department(105, "D-EE")));
    }
    
    private static Integer initId = 1006;
    
    //查询所有员工
    public Collection<Employee> getAll(){
        return employees.values();
    }
}

DepartmentController.java

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.gong.springbootcurd.controller;

import com.gong.springbootcurd.dao.DepartmentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class DepartmentController {

    @Autowired
    DepartmentDao departmentDao;

    @RequestMapping("/depts")
    public String getAll(){
        return "dept/list";
    }

}

DepartmentDao.java

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.gong.springbootcurd.dao;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.gong.springbootcurd.entities.Department;
import org.springframework.stereotype.Repository;


@Repository
public class DepartmentDao {

    private static Map<Integer, Department> departments = null;
    
    static{
        departments = new HashMap<Integer, Department>();
        
        departments.put(101, new Department(101, "D-AA"));
        departments.put(102, new Department(102, "D-BB"));
        departments.put(103, new Department(103, "D-CC"));
        departments.put(104, new Department(104, "D-DD"));
        departments.put(105, new Department(105, "D-EE"));
    }
    
    public Collection<Department> getDepartments(){
        return departments.values();
    }
    
    public Department getDepartment(Integer id){
        return departments.get(id);
    }
    
}

bar.html

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--topbar-->
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0" th:fragment="topbar">
    <a class="navbar-brand col-sm-3 col-md-2 mr-0" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">[[${session.loginUser}]]</a>
    <input class="form-control form-control-dark w-100" type="text" placeholder="Search" aria-label="Search">
    <ul class="navbar-nav px-3">
        <li class="nav-item text-nowrap">
            <a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">[[${session.loginUser}]]</a>
        </li>
    </ul>
    <ul class="navbar-nav px-3">
        <li class="nav-item text-nowrap">
            <a class="nav-link" href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">Sign out</a>
        </li>
    </ul>
</nav>

<!--sidebar-->
<nav class="col-md-2 d-none d-md-block bg-light sidebar" id="sidebar">
        <ul class="nav flex-column">
            <li class="nav-item">
                <a class="nav-link active" href="#" th:href="@{/emps}"
                   th:class="${activeUri=='emps'?'nav-link active':'nav-link'}">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users">
                        <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
                        <circle cx="9" cy="7" r="4"></circle>
                        <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
                        <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
                    </svg>
                    员工管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link active" href="#" th:href="@{/depts}"
                   th:class="${activeUri=='depts'?'nav-link active':'nav-link'}">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-users">
                        <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
                        <circle cx="9" cy="7" r="4"></circle>
                        <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
                        <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
                    </svg>
                    部门管理
                </a>
            </li>
        </ul>
    </div>
</nav>

</body>
</html>

dashboard.html

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>Dashboard Template for Bootstrap</title>
        <!-- Bootstrap core CSS -->
        <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.1.2/css/bootstrap.css}" rel="stylesheet">

        <!-- Custom styles for this template -->
        <link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
        <style type="text/css">
            /* Chart.js */
            
            @-webkit-keyframes chartjs-render-animation {
                from {
                    opacity: 0.99
                }
                to {
                    opacity: 1
                }
            }
            
            @keyframes chartjs-render-animation {
                from {
                    opacity: 0.99
                }
                to {
                    opacity: 1
                }
            }
            
            .chartjs-render-monitor {
                -webkit-animation: chartjs-render-animation 0.001s;
                animation: chartjs-render-animation 0.001s;
            }
        </style>
    </head>

    <body>
        <!--引入topbar-->
        <div th:replace="commons/bar::topbar"></div>
        <div class="container-fluid">
            <div class="row">
                <!--引入sidebar-->
                <div th:replace="commons/bar::#sidebar(activeUri='main.html')"></div>
                <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
                    <div class="chartjs-size-monitor" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;">
                        <div class="chartjs-size-monitor-expand" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                            <div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div>
                        </div>
                        <div class="chartjs-size-monitor-shrink" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
                            <div style="position:absolute;width:200%;height:200%;left:0; top:0"></div>
                        </div>
                    </div>
                    <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-2 mb-3 border-bottom">
                        <h1 class="h2">Dashboard</h1>
                        <div class="btn-toolbar mb-2 mb-md-0">
                            <div class="btn-group mr-2">
                                <button class="btn btn-sm btn-outline-secondary">Share</button>
                                <button class="btn btn-sm btn-outline-secondary">Export</button>
                            </div>
                            <button class="btn btn-sm btn-outline-secondary dropdown-toggle">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>
                This week
              </button>
                        </div>
                    </div>

                    <canvas class="my-4 chartjs-render-monitor" id="myChart" width="1076" height="454" style="display: block; width: 1076px; height: 454px;"></canvas>

                    
                </main>
            </div>
        </div>

        <!-- Bootstrap core JavaScript
    ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js" th:src="@{/webjars/jquery/3.3.1/jquery.js}"></script>
        <script type="text/javascript" src="asserts/js/popper.min.js" th:src="@{/webjars/popper.js/1.11.1/dist/popper.js}"></script>
        <script type="text/javascript" src="asserts/js/bootstrap.min.js" th:src="@{/webjars/bootstrap/4.0.0/js/bootstrap.js}"></script>

        <!-- Icons -->
        <script type="text/javascript" src="asserts/js/feather.min.js" th:src="@{/asserts/js/feather.min.js}"></script>
        <script>
            feather.replace()
        </script>

        <!-- Graphs -->
        <script type="text/javascript" src="asserts/js/Chart.min.js" th:src="@{/asserts/js/Chart.min.js}"></script>
        <script>
            var ctx = document.getElementById("myChart");
            var myChart = new Chart(ctx, {
                type: 'line',
                data: {
                    labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                    datasets: [{
                        data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
                        lineTension: 0,
                        backgroundColor: 'transparent',
                        borderColor: '#007bff',
                        borderWidth: 4,
                        pointBackgroundColor: '#007bff'
                    }]
                },
                options: {
                    scales: {
                        yAxes: [{
                            ticks: {
                                beginAtZero: false
                            }
                        }]
                    },
                    legend: {
                        display: false,
                    }
                }
            });
        </script>

    </body>

</html>

emp/list.html

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>Dashboard Template for Bootstrap</title>
        <!-- Bootstrap core CSS -->
        <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.1.2/css/bootstrap.css}" rel="stylesheet">

        <!-- Custom styles for this template -->
        <link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
        <style type="text/css">
            /* Chart.js */
            
            @-webkit-keyframes chartjs-render-animation {
                from {
                    opacity: 0.99
                }
                to {
                    opacity: 1
                }
            }
            
            @keyframes chartjs-render-animation {
                from {
                    opacity: 0.99
                }
                to {
                    opacity: 1
                }
            }
            
            .chartjs-render-monitor {
                -webkit-animation: chartjs-render-animation 0.001s;
                animation: chartjs-render-animation 0.001s;
            }
        </style>
    </head>

    <body>
        <!--引入抽取的topbar-->
        <!--模板名:会使用thymeleaf的前后缀配置规则进行解析-->
        <div th:replace="commons/bar::topbar"></div>

        <div class="container-fluid">
            <div class="row">
                <!--引入侧边栏-->
                <div th:replace="commons/bar::#sidebar(activeUri='emps')"></div>

                <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
                    <h2><a class="btn btn-sm btn-success" href="emp" th:href="@{/emp}">员工添加</a></h2>
                    <div class="table-responsive">
                        <table class="table table-striped table-sm">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>lastName</th>
                                    <th>email</th>
                                    <th>gender</th>
                                    <th>department</th>
                                    <th>birth</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr th:each="emp:${emps}">
                                    <td th:text="${emp.id}"></td>
                                    <td>[[${emp.lastName}]]</td>
                                    <td th:text="${emp.email}"></td>
                                    <td th:text="${emp.gender}==0?'女':'男'"></td>
                                    <td th:text="${emp.department.departmentName}"></td>
                                    <td th:text="${#dates.format(emp.birth, 'yyyy-MM-dd HH:mm')}"></td>
                                    <td>
                                        <a class="btn btn-sm btn-primary" th:href="@{/emp/}+${emp.id}">编辑</a>
                                        <button th:attr="del_uri=@{/emp/}+${emp.id}" class="btn btn-sm btn-danger deleteBtn">删除</button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </main>
                <form id="deleteEmpForm"  method="post">
                    <input type="hidden" name="_method" value="delete"/>
                </form>
            </div>
        </div>

        <!-- Bootstrap core JavaScript
    ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js" th:src="@{/webjars/jquery/3.3.1/jquery.js}"></script>
        <script type="text/javascript" src="asserts/js/popper.min.js" th:src="@{/webjars/popper.js/1.11.1/dist/popper.js}"></script>
        <script type="text/javascript" src="asserts/js/bootstrap.min.js" th:src="@{/webjars/bootstrap/4.0.0/js/bootstrap.js}"></script>

        <!-- Icons -->
        <script type="text/javascript" src="asserts/js/feather.min.js" th:src="@{/asserts/js/feather.min.js}"></script>
        <script>
            feather.replace()
        </script>
        <script>
            $(".deleteBtn").click(function(){
                //删除当前员工的
                $("#deleteEmpForm").attr("action",$(this).attr("del_uri")).submit();
                return false;
            });
        </script>
    </body>
</html>

dept/list.html

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.1.2/css/bootstrap.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<!--引入抽取的topbar-->
<!--模板名:会使用thymeleaf的前后缀配置规则进行解析-->
<div th:replace="commons/bar::topbar"></div>

<div class="container-fluid">
    <div class="row">
        <!--引入侧边栏-->
        <div th:replace="commons/bar::#sidebar(activeUri='depts')"></div>

        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h1>这是部门信息管理页面</h1>
        </main>
    </div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js" th:src="@{/webjars/jquery/3.3.1/jquery.js}"></script>
<script type="text/javascript" src="asserts/js/popper.min.js" th:src="@{/webjars/popper.js/1.11.1/dist/popper.js}"></script>
<script type="text/javascript" src="asserts/js/bootstrap.min.js" th:src="@{/webjars/bootstrap/4.0.0/js/bootstrap.js}"></script>

<!-- Icons -->
<script type="text/javascript" src="asserts/js/feather.min.js" th:src="@{/asserts/js/feather.min.js}"></script>
<script>
    feather.replace()
</script>
</body>
</html>

启动服务器:登录之后选择员工管理

选择部门管理:

说明:之前小节进行了许多配置 ,真正实现起来的员工的增删改查还是跟ssm框架时差不多,问题都不大。需要注意的是前端的一些和视图模板的一些知识。包括提取出共用的模板,点击员工管理或部门管理时,选中哪个,哪个就进行高亮表示(这里使用三元组,也就是上述模板中用橙色加粗所表示的,当activeUri是emps时高亮员工管理,否则是depts时就加亮部门管理)。部门管理只是简单的搭建了页面出来,就不实现了,只是看下切换列表时的效果,由于相关信息比较多,有些代码会遗漏等等,只要明白其中的原理及思想,自己进行改造还是不难的。其中代码有一些是增删改的,暂时可不比理会。

具体流程:点击员工管理,发送post请求的地址为/emps,然后显示相关信息在右边这一块。同理点击部门管理,发送post请求的地址为/depts,然后显示相关信息在右边这一块。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020-02-03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
WAF那些事儿
网站应用级入侵防御系统(Web Application Firewall,WAF),也称为Web防火墙,可以为Web服务器等提供针对常见漏洞(如DDOS攻击、SQL注入、XML注入、XSS等)的防护。在渗透测试工作中,经常遇到WAF的拦截,特别是在SQL注入、文件上传等测试中,为了验证WAF中的规则是否有效,可以尝试进行WAF绕过。本章将讨论注入和文件上传漏洞如何绕过WAF及WebShell的变形方式。
Ms08067安全实验室
2023/12/26
4920
WAF那些事儿
WEB指纹探测工具
WEB指纹就是指WEB应用的一些特征信息,比如CMS系统、操作系统、开发语言、WAF等信息。
cultureSun
2023/05/18
7040
WEB指纹探测工具
Waf识别工具和83个Waf拦截页面
乌鸦安全的技术文章仅供参考,此文所提供的信息只为网络安全人员对自己所负责的网站、服务器等(包括但不限于)进行检测或维护参考,未经授权请勿利用文章中的技术资料对任何计算机系统进行入侵操作。利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责。
乌鸦安全
2021/09/03
10.5K0
Waf识别工具和83个Waf拦截页面
graphw00f:一款功能强大的GraphQL服务器引擎指纹识别工具
graphw00f是一款针对GQL节点的GraphQL指纹识别工具,该工具可以混合发送良性和恶意查询请求,以帮助广大研究人员识别和确定目标应用程序背后的GraphQL引擎。
FB客服
2021/10/21
1.2K0
干货 | 各种WAF绕过手法学习
https://github.com/danielmiessler/SecLists/tree/master/Fuzzing
Power7089
2021/04/30
4K0
干货|挖掘赏金漏洞中,绕过WAF的常用5种方式
WAF是一种用于过滤和阻止恶意网络流量的网络安全解决方案。国外网站常见的供应商包括CloudFlare、AWS、Citrix、Akamai、Radware、Microsoft Azure和Barracuda。
HACK学习
2023/08/22
1.9K0
干货|挖掘赏金漏洞中,绕过WAF的常用5种方式
Nginx添加开源防火墙(waf)防护
由于原生态的Nginx的一些安全防护功能有限,就研究能不能自己编写一个WAF,参考Kindle大神的ngx_lua_waf,自己尝试写一个了,使用两天时间,边学Lua,边写。不过不是安全专业,只实现了一些比较简单的功能:
王先森sec
2023/04/24
2.8K0
Nginx添加开源防火墙(waf)防护
信息打点-主机架构&蜜罐识别&WAF识别&端口扫描&协议识别&服务安全
Apache、Nginx(反向代理服务器)、IIS、lighttpd等 Web服务器主要用于提供静态内容,如HTML、CSS和JavaScript等,以及处理对这些内容的HTTP请求。Web服务器通常使用HTTP协议来与客户端通信,以便在浏览器中呈现网页。一些常见的Web服务器软件包括Apache、Nginx和Microsoft IIS等。
没事就要多学习
2024/07/18
2310
信息打点-主机架构&蜜罐识别&WAF识别&端口扫描&协议识别&服务安全
老外的漏洞赏金猎人顶级侦察工具
在本博客中,我们探讨了为漏洞赏金猎人提供支持的顶级侦察工具。从Shodan的IoT设备洞察到Waymore的Web应用程序漏洞识别,该工具库中的每个工具在保护数字环境方面都发挥着至关重要的作用。加入我们的网络侦察之旅,这些工具是揭开安全系统秘密的关键。
潇湘信安
2024/03/22
6580
老外的漏洞赏金猎人顶级侦察工具
whatweb----web指纹探测工具
WhatWeb是一款kali自带的工具。可以识别网站。它认可网络技术,包括内容管理系统(CMS)、博客平台、统计/分析包、JavaScript库、网络服务器和嵌入式设备。 WhatWeb有900多个插件,每个插件都可以识别不同的东西。它还可以识别版本号、电子邮件地址、帐户ID、web框架模块、SQL错误等。
cultureSun
2023/05/18
5130
聊一聊 WAF CDN 的识别方法
在日常渗透中,经常会遇到目标网站存在 WAF 和 CDN 的情况,如果直接对其进行漏洞扫描的话,大概率发现不了安全问题,反而给目标留下很多漏洞测试的告警,即浪费时间又没有效果,在做漏洞扫描之前可以先进行 WAF 的识别,如果确认没有 WAF 的情况,在进行漏洞扫描,而存在 WAF 的目标,可以进行手工测试,尽量不要使用明显的攻击方式,找一些逻辑方面的问题,WAF 是无法进行识别的。
信安之路
2021/12/01
1.5K0
聊一聊 WAF CDN 的识别方法
黑客玩具入门——2、Kali常用命令与简单工具
就可以使用下面学习的命令了,另外,如果你有过计算机基础,那么Mac的terminal和Git的gitbash,都是可以练习大部分的linux命令的。下面我们就学习一些入门的基础命令
zaking
2023/11/30
1.2K0
黑客玩具入门——2、Kali常用命令与简单工具
Kali Linux Web渗透测试手册(第二版) - 2.4 - 识别Web应用防火墙
thr0cyte,Gr33k,花花,MrTools,R1ght0us,7089bAt,
用户1631416
2018/12/19
1K0
Kali Linux Web渗透测试手册(第二版) - 2.4 - 识别Web应用防火墙
BypassWAF(小白食用)
前言:现在绕过waf手法在网上层出不穷,但是大家好像忘记一个事情就是,思路比方法更有价值,大家对着网上一些手法直接生搬硬套,不在意是不是适合的场景,网上的文章,好像着急的把所有的绕过方法都给你罗列出来。没有传授给你相应的技巧。到最后,小白拿着一堆绕waf的方法却被waf拦在外面。
红队蓝军
2025/02/12
2280
BypassWAF(小白食用)
wafw00f源码及流量特征分析
To do its magic, WAFW00F does the following:
亿人安全
2022/12/23
3940
wafw00f源码及流量特征分析
Bypass WAF (小白食用)
前言:现在绕过waf手法在网上层出不穷,但是大家好像忘记一个事情就是,思路比方法更有价值,大家对着网上一些手法直接生搬硬套,不在意是不是适合的场景,网上的文章,好像着急的把所有的绕过方法都给你罗列出来。没有传授给你相应的技巧。到最后,小白拿着一堆绕waf的方法却被waf拦在外面。
亿人安全
2024/09/18
2350
Bypass WAF (小白食用)
性能测试工具ApacheBench
ApacheBench是一个用来衡量http服务器性能的单线程命令行工具。原本针对Apache http服务器,但是也适用于其他http服务器。
陌涛
2019/07/11
2.2K0
Centos7安装openresty实现WAF防火墙功能
OpenResty® 是一个结合了 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。 OpenResty® 通过汇聚各种设计精良的 Nginx 模块(主要由 OpenResty 团队自主开发),从而将 Nginx 有效地变成一个强大的通用 Web 应用平台。这样,Web 开发人员和系统工程师可以使用 Lua 脚本语言调动 Nginx 支持的各种 C 以及 Lua 模块,快速构造出足以胜任 10K 乃至 1000K 以上单机并发连接的高性能 Web 应用系统。 OpenResty® 的目标是让你的Web服务直接跑在 Nginx 服务内部,充分利用 Nginx 的非阻塞 I/O 模型,不仅仅对 HTTP 客户端请求,甚至于对远程后端诸如 MySQL、PostgreSQL、Memcached 以及 Redis 等都进行一致的高性能响应。
星哥玩云
2022/05/30
2.5K0
Centos7安装openresty实现WAF防火墙功能
wrk 压测
通过解读 ab 和 wrk 关键参数可知: 1.ab 不支持从文件或使用编码,动态修改 POST 或 url 信息; 2.通过 google 了解到 ab 不支持多线程。 以上两个特性 wrk 可以支持,而 Jmeter 需安装 GUI,没有 CLI 方便没有详细去了解,选择用 wrk 进行压测。
lukachen
2023/10/22
3380
Nginx基础 - Nginx+Lua实现灰度发布与WAF
1.Nginx加载Lua环境 默认情况下Nginx不支持Lua模块, 需要安装LuaJIT解释器, 并且需要重新编译Nginx, 建议使用openrestry
子润先生
2021/08/03
1.7K0
相关推荐
WAF那些事儿
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验