Created
February 8, 2012 17:35
-
-
Save b1nary/1771518 to your computer and use it in GitHub Desktop.
[Ruby] Post form data trough socks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rest-client' | |
# Socksify is amazing handling Proxys, also Socks like tor | |
# The proxy is simply aviable in the whole script | |
require 'socksify' | |
TCPSocket::socks_server = "127.0.0.1" | |
TCPSocket::socks_port = 9070 | |
# Create a cookie | |
@cookie = {'name' => 'content'} | |
# Make a "ever" loop | |
while true | |
begin | |
# Request the Page. RestClient let us also use getparas as url, and post to them, AMAZING! :D | |
res = RestClient.post 'http://domain.tld/path/page.php?get=value', {'post_key' => 'post_value'}, :cookies => @cookie | |
# Print the answer | |
puts res.body | |
rescue | |
puts ":: Error :/" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment