Skip to content

This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.

Add files via upload

Abdul Wahab Junaidb4c1962b174c
diff --git a/Python Tools/TOR_Network/circuit-status.py b/Python Tools/TOR_Network/circuit-status.py
new file mode 100644
index 0000000..cba0a81
--- /dev/null
+++ b/Python Tools/TOR_Network/circuit-status.py
@@ -0,0 +1,7 @@
+from stem.control import Controller
+
+controller = Controller.from_port(port=9051)
+controller.authenticate()
+
+print(controller.get_info('circuit-status'))
+
diff --git a/Python Tools/TOR_Network/introduction_points.py b/Python Tools/TOR_Network/introduction_points.py
new file mode 100644
index 0000000..973a71c
--- /dev/null
+++ b/Python Tools/TOR_Network/introduction_points.py
@@ -0,0 +1,10 @@
+from stem.control import Controller
+
+with Controller.from_port(port = 9051) as controller:
+ controller.authenticate()
+ desc = controller.get_hidden_service_descriptor('3g2upl4pq6kufc4m')
+
+ print("DuckDuckGo's introduction points are...\n")
+
+ for introduction_point in desc.introduction_points():
+ print(' %s:%s => %s' % (introduction_point.address, introduction_point.port, introduction_point.identifier))
diff --git a/Python Tools/TOR_Network/list_circuits.py b/Python Tools/TOR_Network/list_circuits.py
new file mode 100644
index 0000000..b3d3971
--- /dev/null
+++ b/Python Tools/TOR_Network/list_circuits.py
@@ -0,0 +1,20 @@
+from stem import CircStatus
+from stem.control import Controller
+
+with Controller.from_port(port = 9051) as controller:
+ controller.authenticate()
+
+ for circ in sorted(controller.get_circuits()):
+ if circ.status != CircStatus.BUILT:
+ continue
+
+ print("Circuit %s (%s)" % (circ.id, circ.purpose))
+
+ for i, entry in enumerate(circ.path):
+ div = '+' if (i == len(circ.path) - 1) else '|'
+ fingerprint, nickname = entry
+
+ desc = controller.get_network_status(fingerprint, None)
+ address = desc.address if desc else 'unknown'
+
+ print(" %s- %s (%s, %s)" % (div, fingerprint, nickname, address))
diff --git a/Python Tools/TOR_Network/network-status.py b/Python Tools/TOR_Network/network-status.py
new file mode 100644
index 0000000..bf22171
--- /dev/null
+++ b/Python Tools/TOR_Network/network-status.py
@@ -0,0 +1,10 @@
+from stem.control import Controller
+
+controller = Controller.from_port(port=9051)
+controller.authenticate()
+
+entries = controller.get_network_statuses()
+for routerEntry in entries:
+ print('Nickname:',routerEntry.nickname)
+ print('Fingerprint:',routerEntry.fingerprint)
+
diff --git a/Python Tools/TOR_Network/requests_proxy.py b/Python Tools/TOR_Network/requests_proxy.py
new file mode 100644
index 0000000..88d80c8
--- /dev/null
+++ b/Python Tools/TOR_Network/requests_proxy.py
@@ -0,0 +1,24 @@
+import requests
+
+def get_tor_session():
+ session = requests.session()
+ # Tor uses the 9050 port as the default socks port
+ session.proxies = {'http': 'socks5://127.0.0.1:9050',
+ 'https': 'socks5://127.0.0.1:9050'}
+ return session
+
+# Following prints your normal public IP
+print("Normal Public IP:",requests.get("http://httpbin.org/ip").text)
+
+# Make a request through the Tor connection
+# IP visible through Tor
+session = get_tor_session()
+print("IP for Tor connection:",session.get("http://httpbin.org/ip").text)
+# Above should print an IP different than your public IP
+
+response = session.get('https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/')
+#get headers dictionary response
+for key,value in response.headers.items():
+ print(key,value)
+
+
diff --git a/Python Tools/TOR_Network/servers_descriptors.py b/Python Tools/TOR_Network/servers_descriptors.py
new file mode 100644
index 0000000..2259bb7
--- /dev/null
+++ b/Python Tools/TOR_Network/servers_descriptors.py
@@ -0,0 +1,13 @@
+from stem.descriptor.remote import DescriptorDownloader
+
+downloader = DescriptorDownloader()
+
+descriptors = downloader.get_server_descriptors().run()
+
+for descriptor in descriptors:
+ print('Descriptor', str(descriptor))
+ print('Certificate', descriptor.certificate)
+ print('ONion key', descriptor.onion_key)
+ print('Signing key', descriptor.signing_key)
+ print('Signature', descriptor.signature)
+
diff --git a/Python Tools/TOR_Network/show-descriptors.py b/Python Tools/TOR_Network/show-descriptors.py
new file mode 100644
index 0000000..cfcd1ea
--- /dev/null
+++ b/Python Tools/TOR_Network/show-descriptors.py
@@ -0,0 +1,11 @@
+from stem.descriptor.remote import DescriptorDownloader
+
+downloader = DescriptorDownloader()
+descriptors = downloader.get_consensus().run()
+
+for descriptor in descriptors:
+ print('Nickname:',descriptor.nickname)
+ print('Fingerprint:',descriptor.fingerprint)
+ print('Address:',descriptor.address)
+ print('Bandwidth:',descriptor.bandwidth)
+
diff --git a/Python Tools/TOR_Network/stem_new_identity.py b/Python Tools/TOR_Network/stem_new_identity.py
new file mode 100644
index 0000000..8f06787
--- /dev/null
+++ b/Python Tools/TOR_Network/stem_new_identity.py
@@ -0,0 +1,29 @@
+import time
+from stem import Signal
+from stem.control import Controller
+
+import requests
+
+def get_tor_session():
+ session = requests.session()
+ # Tor uses the 9050 port as the default socks port
+ session.proxies = {'http': 'socks5h://127.0.0.1:9050','https': 'socks5h://127.0.0.1:9050'}
+ return session
+
+
+def main():
+ while True:
+ time.sleep(5)
+ print ("Rotating IP")
+ with Controller.from_port(port = 9051) as controller:
+ controller.authenticate()
+ controller.signal(Signal.NEWNYM) #gets new identity
+ # Make a request through the Tor connection
+ # IP visible through Tor
+ # Should print an IP different than your public IP
+ session = get_tor_session()
+ print(session.get("http://httpbin.org/ip").text)
+
+if __name__ == '__main__':
+ main()
+
diff --git a/Python Tools/TOR_Network/stem_new_identity_socket.py b/Python Tools/TOR_Network/stem_new_identity_socket.py
new file mode 100644
index 0000000..b848135
--- /dev/null
+++ b/Python Tools/TOR_Network/stem_new_identity_socket.py
@@ -0,0 +1,22 @@
+import time, socks, socket
+import requests
+from stem import Signal
+from stem.control import Controller
+
+numberIPAddresses=5
+
+with Controller.from_port(port = 9051) as controller:
+ controller.authenticate()
+ socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050)
+ socket.socket = socks.socksocket
+
+ for i in range(0, numberIPAddresses):
+ newIPAddress = requests.get("http://icanhazip.com").text
+ print("NewIP Address: %s" % newIPAddress)
+ controller.signal(Signal.NEWNYM)
+ if controller.is_newnym_available() == False:
+ print("Waiting time for Tor to change IP: "+ str(controller.get_newnym_wait()) +" seconds")
+ time.sleep(controller.get_newnym_wait())
+
+ controller.close()
+
diff --git a/Python Tools/TOR_Network/test-torpy.py b/Python Tools/TOR_Network/test-torpy.py
new file mode 100644
index 0000000..def24d5
--- /dev/null
+++ b/Python Tools/TOR_Network/test-torpy.py
@@ -0,0 +1,13 @@
+from torpy.http.requests import TorRequests
+
+with TorRequests() as tor_requests:
+ print("building circuit...")
+ with tor_requests.get_session() as session:
+ print(session.get("http://httpbin.org/ip").json())
+ print("renewing circuit...")
+ with tor_requests.get_session() as session:
+ print(session.get("http://httpbin.org/ip").json())
+
+ response = session.get('http://3g2upl4pq6kufc4m.onion')
+ for key,value in response.headers.items():
+ print(key,value)
diff --git a/Python Tools/TOR_Network/test_anonymize.py b/Python Tools/TOR_Network/test_anonymize.py
new file mode 100644
index 0000000..d41105c
--- /dev/null
+++ b/Python Tools/TOR_Network/test_anonymize.py
@@ -0,0 +1,15 @@
+import requests
+from anonymize import enable_proxy, disable_proxy
+
+#This url returns your ip as plain text
+url = 'http://icanhazip.com'
+
+
+def test_requests():
+ print('requests: %s' % requests.get(url).text)
+
+enable_proxy()
+test_requests()
+
+disable_proxy()
+test_requests()
diff --git a/Python Tools/TOR_Network/tor_request.py b/Python Tools/TOR_Network/tor_request.py
new file mode 100644
index 0000000..d4c5477
--- /dev/null
+++ b/Python Tools/TOR_Network/tor_request.py
@@ -0,0 +1,17 @@
+from torrequest import TorRequest
+
+with TorRequest(proxy_port=9050, ctrl_port=9051, password=None) as tr:
+ response = tr.get('http://ipecho.net/plain')
+ print(response.text) # not your IP address
+
+ # TorRequest object also exposes the underlying Stem controller
+ # and Requests session objects for more flexibility.
+
+ print(type(tr.ctrl)) # a stem.control.Controller object
+ tr.ctrl.signal('CLEARDNSCACHE') # see Stem docs for the full AP
+
+ tr.reset_identity()
+
+ response = tr.get('http://ipecho.net/plain')
+ print(response.text) # another IP address
+