Skip to content

Instantly share code, notes, and snippets.

@b1nary
Created February 8, 2012 17:35
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save b1nary/1771518 to your computer and use it in GitHub Desktop.
[Ruby] Post form data trough socks
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