salawank

nt-upload.py

Oct 9th, 2013
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. """
  3. Need to have pycurl installed
  4. tdr(dot)local(at)gmail(dot)com
  5. """
  6. import re
  7. import sys
  8. import pycurl
  9. import cStringIO
  10.    
  11. input = sys.argv[1]
  12. response = cStringIO.StringIO()
  13. c = pycurl.Curl()
  14. c.setopt(c.POST, 1)
  15. c.setopt(c.URL, "https://www.networktotal.com/upload.php")
  16. data = [('uploaded', (c.FORM_FILE, input))]
  17. c.setopt(c.HTTPPOST, data)
  18. c.setopt(c.SSL_VERIFYPEER, 0)  
  19. c.setopt(c.SSL_VERIFYHOST, 0)
  20. c.setopt(c.WRITEFUNCTION, response.write)
  21. #c.setopt(c.VERBOSE, 1)
  22. c.perform()
  23. c.close()
  24. results = response.getvalue()
  25. #print results
  26. if 'Sorry' in results:
  27.     print 'The file you tried to upload did not pass the pcap check!Sorry your file was not processed!'
  28. else:
  29.     print '\nFile '+input+' has been uploaded.\n'
  30.     result = ''.join(re.findall('https.+',results))
  31.     print '\nHASH for query:\n'+result[-42:-9]
  32.     print '\nComplete URL result:\n'+result[:-43]
RAW Paste Data