@@ -24,11 +24,9 @@ ac = hacklib.AuthClient()
2424# Logging into a gmail account
2525htmldata = ac.login(' https://gmail.com' , ' email' , ' password' )
2626
27- # Returns HTML whether login works or not.
28- try :
29- if ' Inbox' in htmldata: print ' Login Success.'
30- else : print ' Login Failed.'
31- except : print ' Couldn\' t even connect. :('
27+ # Check for a string in the resulting page
28+ if ' Inbox' in htmldata: print ' Login Success.'
29+ else : print ' Login Failed.'
3230
3331# For logins using HTTP Basic Auth:
3432try :
@@ -106,19 +104,17 @@ Socks4/5 proxy scraping and tunneling
106104``` python
107105>> > import hacklib
108106>> > import urllib2
109- # Scrape recently added Socks proxies from the internet
110- >> > proxylist = hacklib.getProxies()
107+ >> > proxylist = hacklib.getProxies() # scrape recently added socks proxies from the internet
111108>> > proxy = hacklib.Proxy()
112- # Automatically find and connect to a working proxy in proxylist
113- >> > proxy.connect(proxylist)
109+ >> > proxy.connect(proxylist) # automatically find and connect to a working proxy in proxylist
114110>> > proxy.IP
115111u ' 41.203.214.58'
116112>> > proxy.port
11711365000
118114>> > proxy.country
119115u ' KE'
120- # All Python network activity across all modules are routed through the proxy
121- >> > urllib2.urlopen(' http://icanhazip.com/' ).read()
116+ # All Python network activity across all modules are routed through the proxy:
117+ >> > urllib2.urlopen(' http://icanhazip.com/' ).read()
122118' 41.203.214.58\n '
123119# Notes: Only network activity via Python are masked by the proxy.
124120# Network activity on other programs such as your webbrowser remain unmasked.
0 commit comments