Skip to content

Commit 8a7cb6e

Browse files
Merge branch 'master' into master
2 parents fdc7b32 + bf54a10 commit 8a7cb6e

5 files changed

Lines changed: 176 additions & 13 deletions

File tree

DOOM_port_Scanner/DOOM.py

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import socket
22
from IPy import IP
3+
import subprocess
4+
import sys
5+
import asyncio
6+
from datetime import datetime
37

8+
subprocess.call('cls', shell=True)
49

510
print(
611
"""
712
You are using the DOOM Port scanner.
813
9-
10-
1. You can change the range of the ports you want to scan.
11-
2. You can change the speedof the scan
12-
3. you can scan a list of targets by using ', ' after each target
13-
4. You can scan both URL links and both IP's
14-
15-
16-
"""
14+
1. Fast scanning to provide the open ports
15+
2. You can scan both URL links and both IP's
16+
3. Gives Total scanning time
1717
)
1818
# ip adresess
1919
targets = input("enter targets or URL's ")
@@ -31,7 +31,48 @@
3131
)
3232
except:
3333
speed = 0.1
34+
""")
35+
# Ask for input
36+
remoteServer = input("Enter a remote host to scan: ")
37+
remoteServerIP = socket.gethostbyname(remoteServer)
38+
39+
# Print a nice banner with information on which host we are about to scan
40+
print("-" * 60)
41+
print("Please wait, scanning remote host", remoteServerIP)
42+
print("-" * 60)
43+
44+
# Check what time the scan started
45+
t1 = datetime.now()
46+
47+
async def scan_port(port):
48+
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
49+
sock.setblocking(False)
50+
try:
51+
await asyncio.wait_for(
52+
asyncio.get_event_loop().sock_connect(sock, (remoteServerIP, port)),
53+
timeout=1
54+
)
55+
print("Port {}: Open".format(port))
56+
except (socket.timeout, ConnectionRefusedError):
57+
pass
58+
finally:
59+
sock.close()
60+
61+
async def main():
62+
tasks = []
63+
for port in range(1, 1025):
64+
tasks.append(scan_port(port))
65+
await asyncio.gather(*tasks)
3466

67+
try:
68+
asyncio.run(main())
69+
except KeyboardInterrupt:
70+
print("You pressed Ctrl+C")
71+
sys.exit()
72+
73+
except socket.gaierror:
74+
print('Hostname could not be resolved. Exiting')
75+
sys.exit()
3576

3677
def multi_targets(ip):
3778
converted_ip = check_ip(ip)
@@ -79,3 +120,15 @@ def scan_port(ip, port):
79120
multi_targets(ip_add.strip(" "))
80121
else:
81122
multi_targets(targets)
123+
124+
except socket.error:
125+
print("Couldn't connect to server")
126+
sys.exit()
127+
128+
# Checking the time again
129+
t2 = datetime.now()
130+
131+
# Calculates the difference of time, to see how long it took to run the script
132+
total = t2 - t1
133+
134+
print('Scanning Completed in:', total)

DOOM_port_Scanner/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The DOOM Port Scanner is a tool designed to scan ports on a target system quickl
66

77
- Fast and efficient port scanning.
88
- Support for scanning multiple target systems simultaneously.
9-
- Customizable scan options, including port range and timeout.
9+
- Gives Total scanning time.
1010
- Clear and concise output displaying open ports and associated services.
1111

1212
## Installation
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Python Script to bruteforce for Json Web Token Secret.
4+
#
5+
6+
from concurrent.futures import ThreadPoolExecutor as executor
7+
import argparse
8+
import jwt, sys
9+
10+
def crack(token, algo, secret):
11+
options = { 'verify_exp':False}
12+
try:
13+
payload = jwt.decode(token, secret, algorithm=algo, options=options)
14+
print("The Secret Key: "+secret)
15+
print("Payload: "+str(payload))
16+
except Exception:
17+
return False
18+
19+
20+
parser = argparse.ArgumentParser()
21+
22+
parser.add_argument("-t", dest="token", type=str, help="Json Web Token.", required=True)
23+
parser.add_argument("-w", dest="wordlist", type=str, help="Wordlist Of Secrets.", required=True)
24+
parser.add_argument("-c", dest="threads", type=int, help="Threds Number (Default: 10).")
25+
parser.add_argument("-a", dest="algo", type=str, help="The Algorithm (Default: HS256).")
26+
args = parser.parse_args()
27+
token = str(args.token)
28+
wlist = str(args.wordlist)
29+
threads = args.threads
30+
algo = str(args.algo)
31+
if threads == None:
32+
threads = 10
33+
if algo == None:
34+
algo = 'HS256'
35+
36+
secrets = open(wlist, 'r')
37+
with executor(max_workers=int(threads)) as exe:
38+
[exe.submit(crack, token, algo, secret.strip('\n')) for secret in secrets]
39+
40+
41+
print("* Done! *")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Jwt_Secret_Bruteforce
2+
3+
Short description of package/script
4+
5+
- This Script Was simple to setup
6+
- Need import argparse, jwt, sys ThreadPoolExecutor
7+
8+
## Setup instructions
9+
10+
Just Need to Import argparse, jwt, sys ThreadPoolExecutor then run the Jwt_Secret_Bruteforce.py file and for running python3 is must be installed!
11+
12+
## Detailed explanation of script, if needed
13+
14+
This Script Is Only for Jwt_Secret_Bruteforce use only!
15+
16+
## Author(s)
17+
18+
Kalivarapubindusree

Port-Scanner/Port_Scanner.py

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,49 @@
1-
import socket
21
import time
32
import threading
4-
from queue import Queue
53
import pandas as pd
6-
import lxml
4+
import socket
5+
from queue import Queue
76

8-
socket.setdefaulttimeout(0.25)
7+
socket.setdefaulttimeout(1)
98
print_lock = threading.Lock()
109

1110
target = input("Enter the host to be scanned: ")
1211
t_IP = socket.gethostbyname(target)
1312
url = f"https://www.speedguide.net/ip/{t_IP}"
1413
a = pd.read_html(url)
14+
1515
result = {}
1616
for i in range(len(a[1])):
1717
result[str(a[1][0][i])[:-1]] = a[1][1][i]
18+
19+
result = dict(zip(a[1][0], a[1][1]))
20+
1821
ports_arr = []
22+
max_connections = 100
23+
max_ports = 500
24+
25+
def portscan(q):
26+
while True:
27+
worker = q.get()
28+
if worker is None:
29+
break
30+
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
31+
try:
32+
con = s.connect((t_IP, worker))
33+
with print_lock:
34+
ports_arr.append(worker)
35+
con.close()
36+
except:
37+
pass
38+
finally:
39+
q.task_done()
40+
41+
def threader(q):
42+
for _ in range(max_connections):
43+
t = threading.Thread(target=portscan, args=(q,))
44+
t.daemon = True
45+
t.start()
46+
1947

2048

2149
def portscan(port):
@@ -37,17 +65,27 @@ def threader():
3765

3866

3967
q = Queue()
68+
4069
startTime = time.time()
4170

71+
4272
for x in range(100):
4373
t = threading.Thread(target=threader)
4474
t.daemon = True
4575
t.start()
4676

4777
for worker in range(1, 500):
78+
threader(q)
79+
80+
for worker in range(1, max_ports + 1):
4881
q.put(worker)
4982

5083
q.join()
84+
85+
# Stop the threads
86+
for _ in range(max_connections):
87+
q.put(None)
88+
5189
result["ports"] = ports_arr
5290
print(result)
5391

@@ -62,3 +100,16 @@ def PortInfo(port_no):
62100
"Description": a[2]["Details"][0],
63101
}
64102
return final
103+
# Exception Handling
104+
try:
105+
a = pd.read_html(url)
106+
final = {
107+
"Port": a[2]["Port(s)"][0],
108+
"Protocol": a[2]["Protocol"][0],
109+
"Service": a[2]["Service"][0],
110+
"Description": a[2]["Details"][0]
111+
}
112+
return final
113+
except Exception as e:
114+
print(f"Error fetching port info for port {port_no}: {e}")
115+
return {}

0 commit comments

Comments
 (0)