hello,大家好我是你们的坤哥,聊聊安全绕不开的话题POC(漏洞概念验证),只知道拿着工具扫的你,尝试过自己写POC吗?
看坤哥极限拉扯你和大手子之间的差距。
配合B站视频观看更佳:
POC(漏洞概念验证脚本)诞生全过程,有手就能写,ChatGPT辅助写POC_哔哩哔哩_bilibili
启动靶场
靶场使用的是DVWA,借助Docker一键启动靶场。
$ sudo docker pull vulnerables/web-dvwa
$ sudo docker run --rm -it -p 80:80 vulnerables/web-dvwa
[+] Starting mysql...
[ ok ] Starting MariaDB database server: mysqld.
[+] Starting apache
[....] Starting Apache httpd web server: apache2AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
. ok
==> /var/log/apache2/access.log <==
==> /var/log/apache2/error.log <==
[Mon May 08 13:04:56.685132 2023] [mpm_prefork:notice] [pid 306] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Mon May 08 13:04:56.685222 2023] [core:notice] [pid 306] AH00094: Command line: '/usr/sbin/apache2'
==> /var/log/apache2/other_vhosts_access.log <==
Command Injection
登入DVWA
后找到Command Injection
使用Payload
触发漏洞,输入框内填入secself.com&&whoami
目前为止已经可以手动测试出漏洞,怎么批量去检测这个同类型漏洞呢?
POC编写思路
从刚才的动作思考一下,浏览器输入网址->回车->页面展示,这几个动作在代码里应该是什么样子的?
- 代码请求网址,拿到响应信息
- 处理响应信息,匹配关键信息检测