Advertisement
Guest User

Untitled

a guest
Sep 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import requests
  2.  
  3. with requests.Session() as s:
  4. headers1 = {'Cookie':'wordpress_test_cookie=WP Cookie check'}
  5. datas={'log':'admin','pwd':'admin','wp-submit':'Log In','redirect_to':'/wordpress/wp-admin/','testcookie':'1'}
  6. s.post("http://ip/wordpress/wp-admin",headers=headers1,data=datas)
  7. re = s.get("http://ip/wordpress/wp-admin").text
  8. print (re)
  9.  
  10. wp_login = 'http://ip/wordpress/wp-login.php'
  11. wp_admin = 'http://ip/wordpress/wp-admin/'
  12. username = 'admin'
  13. password = 'admin'
  14.  
  15. with requests.Session() as s:
  16. headers1 = { 'Cookie':'wordpress_test_cookie=WP Cookie check' }
  17. datas={
  18. 'log':username, 'pwd':password, 'wp-submit':'Log In',
  19. 'redirect_to':wp_admin, 'testcookie':'1'
  20. }
  21. s.post(wp_login, headers=headers1, data=datas)
  22. resp = s.get(wp_admin)
  23. print(resp.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement