-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtor-test.py
More file actions
31 lines (23 loc) · 798 Bytes
/
tor-test.py
File metadata and controls
31 lines (23 loc) · 798 Bytes
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
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import requests
url = 'https://api.ipify.org/'
def getip_requests(url):
print "(+) Sending request with plain requests..."
r = requests.get(url)
print "(+) IP is: " + r.text.replace("\n", "")
def getip_requesocks(url):
print "(+) Sending request with requesocks..."
proxies = {'http': 'socks5://122.192.32.77:7280',
'https': 'socks5://122.192.32.77:7280'}
r = requests.get(url, proxies = proxies)
print "(+) IP is: " + r.text.replace("\n", "")
def main():
print "Running tests..."
getip_requests(url)
getip_requesocks(url)
os.system("""(echo authenticate ; echo signal newnym; echo quit) | nc localhost 9051""")
getip_requesocks(url)
if __name__ == "__main__":
main()