Advertisement
Guest User

Untitled

a guest
Mar 18th, 2012
1,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.07 KB | None | 0 0
  1. #   spys.ru/en/socks-proxy-list/
  2. #this tool will gather about 175 fresh socks5 proxy servers and write them to your proxychains config file
  3. #this script will delete your current config, just a warning
  4. # look at the bottem of this script for the proxychains config
  5. #looks ugly but it works, takes a few minutes to complete, i dont feel like fixing this
  6. #sudo ruby socks5_gather.rb   (must use sudo to write to the config)
  7.  
  8. require 'socket'
  9. response_buf=""
  10. file = File.open("/etc/proxychains.conf", "w")
  11.  
  12. for i in 0..5
  13.     if i==0
  14.  
  15.     s=TCPSocket.new("spys.ru",80)
  16.     s.print("
  17. GET /en/socks-proxy-list/ HTTP/1.1
  18. Host: spys.ru
  19. User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
  20. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  21. Accept-Language: en-us,en;q=0.5
  22. Connection: keep-alive
  23. Referer: http://spys.ru/en/socks-proxy-list/3/
  24. Cookie: __utma=74835280.648937846.1329030876.1330398972.1330401161.20; __utmz=74835280.1329890931.9.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __utmc=74835280; __utmb=74835280.6.10.1330401161
  25.  
  26. ")
  27.         while line=s.gets
  28.         response_buf<<line
  29.         end
  30.         puts response_buf.length
  31.     else
  32.  
  33.  
  34. s=TCPSocket.new("spys.ru",80)
  35. s.print("
  36. GET /en/socks-proxy-list/#{i}/ HTTP/1.1
  37. Host: spys.ruhttp://gethub.com/
  38. User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
  39. Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  40. Accept-Language: en-us,en;q=0.5
  41. Connection: keep-alive
  42. Referer: http://spys.ru/en/socks-proxy-list/3/
  43. Cookie: __utma=74835280.648937846.1329030876.1330398972.1330401161.20; __utmz=74835280.1329890931.9.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __utmc=74835280; __utmb=74835280.6.10.1330401161
  44.  
  45. ")
  46.         while line=s.gets
  47.         response_buf<<line
  48.         end
  49.         puts response_buf.length
  50.  
  51.     end
  52. end
  53.  
  54.  
  55. #establish vars for ports               sypher=response_buf.scan(/<\/script><\/td><\/tr><\/table><script type=\"text\/javascript\">.*.<\/script>/)
  56. for i in response_buf.scan(/<\/script><\/td><\/tr><\/table><script type=\"text\/javascript\">.*.<\/script>/).to_s.gsub('</script></td></tr></table><script type="text/javascript">',"\n").gsub("</script>","\n").gsub(";"," ").split
  57.     if i.include?("^")
  58.         eval(i[0..7])
  59.     end
  60. end
  61.  
  62.  
  63. list=response_buf.gsub("</script></font></td>"," xxx\n\n").gsub('<script type="text/javascript">document.write("<font class=spy2>:<\/font>"'," ").gsub('</font> <font class=spy14>',"xyxy").gsub("+(","").gsub(/\^....\)/," ").scan(/xyxy.*.xxx/).to_s.gsub(" ) xxx","\n").gsub("xyxy","")
  64. response_buf=""
  65. socks5=""
  66. for i in list.map
  67. for x in i.split
  68. if x.include?(".")
  69. socks5<<"\nsocks5 #{x} "
  70. else
  71. socks5<<eval(x).to_s
  72. end
  73. end
  74. end
  75. #socks5 now holds the list ready to write /etc/proxychains.conf
  76.  
  77. #this is your options for the config file... depending on the job, you may need to modify time out options etc... !!!
  78.  
  79. file.print("random_chain
  80. chain_len = 1
  81. #quiet_mode
  82. proxy_dns
  83. tcp_read_time_out 5000
  84. tcp_connect_time_out 1500
  85. [ProxyList]
  86.  
  87. #{socks5}")
  88. file.close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement