Reputation: 3584
The following is what a hacker always does.
I have a list of SOCKS5 proxies and a list of username/password combos. I want to test the username/password list with different SOCKS5 proxies for a website www.example.com/login.html.
I am using Python 2.5 on CentOS 5.5.
How can I use socksipy or other modules? Could you please give me a code snippet? Thanks a lot!
Upvotes: 2
Views: 3686
Reputation: 42050
you can trying using pycurl
import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, 'www.example.com/login.php')
pycurlConnect.setopt(pycurl.POSTFIELDS, POST_DATA)
c.setopt(pycurl.PROXY, 'yourproxy')
c.setopt(pycurl.PROXYPORT, 8080)
c.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_SOCKS5)
c.perform()
The POST_DATA variable should look something like this depending exact arguments required by the login form:
POST_DATA = 'username=meatsafe&password=murderer'
Upvotes: 4