Guest User

Untitled

a guest
Mar 22nd, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import requests
  2. import os
  3. from bs4 import BeautifulSoup
  4.  
  5. url = 'http://5.9.247.121/d34dc0d3'
  6. h = {'X-0x0ACE-Key' : 'rNpMY4b6gPjyEOqLR0YQMAnVmwDbd7LReD3k5x849KJarWelNGpvZo12zwPJDxRa'}
  7. r = requests.get(url, headers=h)
  8. s = r.text
  9. soup = BeautifulSoup(s, 'html.parser')
  10. v = soup.input['value']
  11. s = soup.findAll('span', attrs={'class':'challenge'})[0].contents[0]
  12. l = s.split()
  13. a, b = (l[0][1:-1], l[2][:-1])
  14. os.system('echo "{} {}" | ./a.out > out'.format(a, b))
  15. f = open('out')
  16. s = f.read()
  17. r = requests.post(url, headers=h, data={'solution': s, 'verification': v})
  18. print(r.text)
Advertisement
Add Comment
Please, Sign In to add comment