This commit is contained in:
benji.benji committed 2026-08-20 14:41:48 +02:00
1 parent 93d65bb2be
commit cbd46cc96f
7 files changed
+222 -16

No files matched your search

+32 -16
View File
@@ -17,7 +17,7 @@ import shutil
import re
from concurrent.futures import ThreadPoolExecutor, as_completed
SCANFOLDER=os.path.join(os.path.dirname(sys.argv[0]),"recons_scans")
KEYWORDS = [".txt", "pass", "creds", "user", ".dic", "hash", "<!--"]
KEYWORDS = [".txt", "pass", "creds", "user", ".dic", "hash", "<!--","admin"]
services=[]
CRITICS_PORTS=[21,1234,4444,9000,5000,88,139,445]
CRITICS_SERVICES=["kerberos","redis","microsoft-ds","ldap","netbios-ssn"]
@@ -50,6 +50,7 @@ TIPS = [
CONFIG_FOLDER = f"/home/coder/.config/recon"
if not os.path.isdir(SCANFOLDER):
os.makedirs(SCANFOLDER)
os.chdir(SCANFOLDER)
if not os.path.isdir(CONFIG_FOLDER):
os.makedirs(CONFIG_FOLDER)
if not os.path.isfile(os.path.join(CONFIG_FOLDER, "wordlists.txt")):
@@ -172,7 +173,7 @@ def detect_service(ip, port, timeout=3):
s.sendall(http_req.encode())
resp = _safe_recv(s, 8192)
if resp and resp.startswith("HTTP/"):
info["service"] = info.get("service") or "http"
info["service"] = "http"
info["banner"] = (info["banner"] or "") + "\n" + resp.splitlines()[0]
# try to extract Server header
m = _server_header_re.search(resp)
@@ -193,7 +194,7 @@ def detect_service(ip, port, timeout=3):
with ctx.wrap_socket(s, server_hostname=ip) as ss:
cert = ss.getpeercert()
# presence of cert => TLS-enabled service (https or other tls)
info["service"] = info.get("service") or "tls"
info["service"] = info["service"] or "tls"
info["extra"]["tls_subject"] = cert.get("subject")
info["extra"]["tls_issuer"] = cert.get("issuer")
# sometimes certificate commonName contains hostname only; no version
@@ -350,7 +351,7 @@ def tcp_scan(
print(f"\n[!] Scan complete. Found {len(open_ports)} open ports.")
return sorted(open_ports)
def udp_scan(
ip, start_port=1, end_port=7000, timeout=0.4, max_threads=os.cpu_count() * 50
ip, start_port=1, end_port=65535, timeout=0.4, max_threads=os.cpu_count() * 50
):
open_ports = []
lock = Lock()
@@ -377,14 +378,18 @@ def udp_scan(
def _gobuster_probe(args):
"""
Worker for multiprocessing pool.
Args: (target, directory, ssl)
Args: (target,port, directory, ssl)
Returns: tuple (url, matches, short_content) or None
"""
target, directory, ssl = args
target,port, directory, ssl = args
directory = directory.strip()
if not directory:
return None
url = f"https://{target}/{directory}" if ssl else f"http://{target}/{directory}"
if port == 80 or port == 443:
url = f"https://{target}/{directory}" if ssl else f"http://{target}/{directory}"
else:
url="http://" if not ssl == True else "https://"
url+=f"{target}:{port}/{directory}"
try:
# Each process creates its own short-lived request
r = requests.get(url, timeout=5)
@@ -408,6 +413,7 @@ def _gobuster_probe(args):
def gobuster(
target,
port=80,
ssl=False,
rapport=None,
wordlist_path=WORDLIST,
@@ -437,7 +443,7 @@ def gobuster(
worker_count = processes if (processes and processes > 0) else max(2, cpu)
# build args for pool
tasks = [(target, d, ssl) for d in dirs]
tasks = [(target,port, d, ssl) for d in dirs]
results = []
try:
@@ -568,6 +574,11 @@ def subdnsfind(target):
print(f"port: {Colors.ORANGE}{service['port']}{Colors.END} | service: {Colors.ORANGE}{service['service']}{Colors.END} | version: {service['version']}\n")
else:
print(f"port: {service['port']} | service: {service['service']} | version: {service['version']}\n")
if "http" in service['service']:
gobuster(target,service['port'],ssl=False,rapport=rapport)
if "https" in service['service']:
gobuster(target,service['port'],ssl=True,rapport=rapport)
safe_target = re.sub(r"[^a-zA-Z0-9_.-]", "_", subdomain)
output_file = f"gobuster_{safe_target}.txt"
@@ -595,7 +606,6 @@ def subdnsfind(target):
rapport.append(f"\n {subdomain} ROBOTS.txt content:\n{robots_content}")
analyze_entries(target, robots_content.splitlines(), rapport)
gobuster(target, ssl=use_https, rapport=rapport)
rapport.append(f"\n\n {subdomain} GOBUSTER DIRECTORY SCAN")
if os.path.exists(output_file):
with open(output_file, "r") as f:
@@ -639,7 +649,7 @@ def main():
try:
ip = socket.gethostbyname(target)
result = re.compile('\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b').match(target)
result = re.compile(r'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b').match(target)
if not result:
isdomain=True
print("\nDomain mode detected ")
@@ -668,12 +678,18 @@ def main():
rapport += [f"{port}/UDP" for port in open_ports]
for service in services:
if service['port'] in CRITICS_PORTS or service['service'] in CRITICS_SERVICES:
print(f"port: {Colors.RED}{service['port']}{Colors.END} | service: {Colors.RED}{service['service']}{Colors.END} | version: {service['version']}\n")
elif service['port'] in MID_PORTS or service['service'] in MID_SERVICES:
print(f"port: {Colors.ORANGE}{service['port']}{Colors.END} | service: {Colors.ORANGE}{service['service']}{Colors.END} | version: {service['version']}\n")
else:
print(f"port: {service['port']} | service: {service['service']} | version: {service['version']}\n")
if service['port'] in CRITICS_PORTS or service['service'] in CRITICS_SERVICES:
print(f"port: {Colors.RED}{service['port']}{Colors.END} | service: {Colors.RED}{service['service']}{Colors.END} | version: {service['version']}\n")
elif service['port'] in MID_PORTS or service['service'] in MID_SERVICES:
print(f"port: {Colors.ORANGE}{service['port']}{Colors.END} | service: {Colors.ORANGE}{service['service']}{Colors.END} | version: {service['version']}\n")
else:
print(f"port: {service['port']} | service: {service['service']} | version: {service['version']}\n")
if "http" in service['service']:
gobuster(target,service['port'],ssl=False,rapport=rapport)
if "https" in service['service']:
gobuster(target,service['port'],ssl=True,rapport=rapport)
safe_target = re.sub(r"[^a-zA-Z0-9_.-]", "_", target)
output_file = f"gobuster_{safe_target}.txt"
@@ -0,0 +1,9 @@
Scanning 192.168.0.180
TCP OPEN PORTS:
22/TCP
111/TCP
2766/TCP
8006/TCP
UDP OPEN PORTS:
@@ -0,0 +1 @@
# Nmap 7.99 scan initiated Tue Aug 4 21:24:25 2026 as: nmap -A -T5 -oN scan_192.168.0.180.txt -p- --script http-title --script-args http.max-redirects=3 192.168.0.180
@@ -0,0 +1,14 @@
Scanning 192.168.0.218
TCP OPEN PORTS:
22/TCP
80/TCP
81/TCP
443/TCP
3000/TCP
3001/TCP
3500/TCP
4500/TCP
8000/TCP
UDP OPEN PORTS:
@@ -0,0 +1,148 @@
# Nmap 7.99 scan initiated Tue Aug 4 21:28:15 2026 as: nmap -A -T5 -oN scan_192.168.0.218.txt -p- --script http-title --script-args http.max-redirects=3 192.168.0.218
Warning: 192.168.0.218 giving up on port because retransmission cap hit (2).
Nmap scan report for docker.local (192.168.0.218)
Host is up (0.015s latency).
Not shown: 65500 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 10.0p2 Debian 7+deb13u4 (protocol 2.0)
80/tcp open http OpenResty web app server
|_http-title: 404 Not Found
|_http-server-header: openresty
81/tcp open http OpenResty web app server
|_http-title: Nginx Proxy Manager
|_http-server-header: openresty
443/tcp open ssl/https openresty
|_http-server-header: openresty
|_http-title: 400 The plain HTTP request was sent to HTTPS port
1539/tcp filtered intellistor-lm
1887/tcp filtered filex-lport
3000/tcp open ppp?
| fingerprint-strings:
| DNSStatusRequestTCP, DNSVersionBindReqTCP, Kerberos, LANDesk-RC, LDAPBindReq, LDAPSearchReq, LPDString, NCP, RPCCheck, RTSPRequest, SMBProgNeg, SSLSessionReq, TLSSessionReq, TerminalServer, TerminalServerCookie, X11Probe:
| HTTP/1.1 505 HTTP Version Not Supported
| Connection: close
| FourOhFourRequest, GetRequest, HTTPOptions, SIPOptions:
| HTTP/1.1 400 Bad Request
|_ Connection: close
3001/tcp open ssl/http nginx
|_http-title: SpeedTest by OpenSpeedTest\xE2\x84\xA2
3500/tcp open http nginx
|_http-title: SpeedTest by OpenSpeedTest\xE2\x84\xA2
4000/tcp open http nginx
| http-title: Login - Speedtest Tracker ...
|_Requested resource was http://docker.local:4000/admin/login
4500/tcp open http nginx
|_http-title: Apprise API
7905/tcp filtered unknown
8000/tcp open nagios-nsca Nagios NSCA
|_http-title: Site doesn't have a title (text/plain; charset=utf-8).
9443/tcp open ssl/http Golang net/http server
| fingerprint-strings:
| GenericLines:
| HTTP/1.1 400 Bad Request
| Content-Type: text/plain; charset=utf-8
| Connection: close
| Request
| GetRequest, HTTPOptions:
| HTTP/1.0 200 OK
| Accept-Ranges: bytes
| Cache-Control: max-age=31536000
| Content-Length: 14202
| Content-Security-Policy: script-src 'self' https://js.hsforms.net https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/; object-src 'none'; frame-ancestors 'none'; frame-src https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/
| Content-Type: text/html; charset=utf-8
| Last-Modified: Thu, 25 Jun 2026 01:23:35 GMT
|_ Permissions-Policy: accelerometer=(),ambient-light-sensor=(),attribution-reporting=(),autoplay=(),battery=(),browsing-topics=(),camera=(),captured-surface-control=(),ch-device-memory=(),ch-downlink=(),ch-dpr=(),ch-ect=(),ch-prefers-color-scheme=(),ch-prefers-reduced-motion=(),ch-prefers-reduced-transparency=(),ch-rtt=(),ch-save-data=(),ch-ua=(),ch-ua-arch=(),ch-ua-bitness=(),ch-ua-form-factors=(),ch-ua-full-version=(),ch-ua-full-version-list=(),ch-ua-mobil
|_http-title: Portainer
12960/tcp filtered unknown
14775/tcp filtered unknown
15095/tcp filtered unknown
15404/tcp filtered unknown
15573/tcp filtered unknown
17346/tcp filtered unknown
29510/tcp filtered unknown
29729/tcp filtered unknown
30560/tcp filtered unknown
38032/tcp filtered unknown
38924/tcp filtered unknown
40616/tcp filtered unknown
43885/tcp filtered unknown
46070/tcp filtered unknown
46734/tcp filtered unknown
56764/tcp filtered unknown
57365/tcp filtered unknown
57422/tcp filtered unknown
61250/tcp filtered unknown
62572/tcp filtered unknown
65187/tcp filtered unknown
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port3000-TCP:V=7.99%I=7%D=8/4%Time=6A723D61%P=x86_64-pc-linux-gnu%r(Get
SF:Request,2F,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nConnection:\x20close\
SF:r\n\r\n")%r(NCP,3E,"HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20Suppo
SF:rted\r\nConnection:\x20close\r\n\r\n")%r(HTTPOptions,2F,"HTTP/1\.1\x204
SF:00\x20Bad\x20Request\r\nConnection:\x20close\r\n\r\n")%r(RTSPRequest,3E
SF:,"HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20Supported\r\nConnection
SF::\x20close\r\n\r\n")%r(RPCCheck,3E,"HTTP/1\.1\x20505\x20HTTP\x20Version
SF:\x20Not\x20Supported\r\nConnection:\x20close\r\n\r\n")%r(DNSVersionBind
SF:ReqTCP,3E,"HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20Supported\r\nC
SF:onnection:\x20close\r\n\r\n")%r(DNSStatusRequestTCP,3E,"HTTP/1\.1\x2050
SF:5\x20HTTP\x20Version\x20Not\x20Supported\r\nConnection:\x20close\r\n\r\
SF:n")%r(SSLSessionReq,3E,"HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20S
SF:upported\r\nConnection:\x20close\r\n\r\n")%r(TerminalServerCookie,3E,"H
SF:TTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20Supported\r\nConnection:\x
SF:20close\r\n\r\n")%r(TLSSessionReq,3E,"HTTP/1\.1\x20505\x20HTTP\x20Versi
SF:on\x20Not\x20Supported\r\nConnection:\x20close\r\n\r\n")%r(Kerberos,3E,
SF:"HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20Supported\r\nConnection:
SF:\x20close\r\n\r\n")%r(SMBProgNeg,3E,"HTTP/1\.1\x20505\x20HTTP\x20Versio
SF:n\x20Not\x20Supported\r\nConnection:\x20close\r\n\r\n")%r(X11Probe,3E,"
SF:HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20Supported\r\nConnection:\
SF:x20close\r\n\r\n")%r(FourOhFourRequest,2F,"HTTP/1\.1\x20400\x20Bad\x20R
SF:equest\r\nConnection:\x20close\r\n\r\n")%r(LPDString,3E,"HTTP/1\.1\x205
SF:05\x20HTTP\x20Version\x20Not\x20Supported\r\nConnection:\x20close\r\n\r
SF:\n")%r(LDAPSearchReq,3E,"HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20
SF:Supported\r\nConnection:\x20close\r\n\r\n")%r(LDAPBindReq,3E,"HTTP/1\.1
SF:\x20505\x20HTTP\x20Version\x20Not\x20Supported\r\nConnection:\x20close\
SF:r\n\r\n")%r(SIPOptions,2F,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nConnec
SF:tion:\x20close\r\n\r\n")%r(LANDesk-RC,3E,"HTTP/1\.1\x20505\x20HTTP\x20V
SF:ersion\x20Not\x20Supported\r\nConnection:\x20close\r\n\r\n")%r(Terminal
SF:Server,3E,"HTTP/1\.1\x20505\x20HTTP\x20Version\x20Not\x20Supported\r\nC
SF:onnection:\x20close\r\n\r\n");
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port9443-TCP:V=7.99%T=SSL%I=7%D=8/4%Time=6A723D64%P=x86_64-pc-linux-gnu
SF:%r(GetRequest,4034,"HTTP/1\.0\x20200\x20OK\r\nAccept-Ranges:\x20bytes\r
SF:\nCache-Control:\x20max-age=31536000\r\nContent-Length:\x2014202\r\nCon
SF:tent-Security-Policy:\x20script-src\x20'self'\x20https://js\.hsforms\.n
SF:et\x20https://www\.google\.com/recaptcha/\x20https://www\.gstatic\.com/
SF:recaptcha/;\x20object-src\x20'none';\x20frame-ancestors\x20'none';\x20f
SF:rame-src\x20https://www\.google\.com/recaptcha/\x20https://www\.gstatic
SF:\.com/recaptcha/\r\nContent-Type:\x20text/html;\x20charset=utf-8\r\nLas
SF:t-Modified:\x20Thu,\x2025\x20Jun\x202026\x2001:23:35\x20GMT\r\nPermissi
SF:ons-Policy:\x20accelerometer=\(\),ambient-light-sensor=\(\),attribution
SF:-reporting=\(\),autoplay=\(\),battery=\(\),browsing-topics=\(\),camera=
SF:\(\),captured-surface-control=\(\),ch-device-memory=\(\),ch-downlink=\(
SF:\),ch-dpr=\(\),ch-ect=\(\),ch-prefers-color-scheme=\(\),ch-prefers-redu
SF:ced-motion=\(\),ch-prefers-reduced-transparency=\(\),ch-rtt=\(\),ch-sav
SF:e-data=\(\),ch-ua=\(\),ch-ua-arch=\(\),ch-ua-bitness=\(\),ch-ua-form-fa
SF:ctors=\(\),ch-ua-full-version=\(\),ch-ua-full-version-list=\(\),ch-ua-m
SF:obil")%r(GenericLines,67,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent
SF:-Type:\x20text/plain;\x20charset=utf-8\r\nConnection:\x20close\r\n\r\n4
SF:00\x20Bad\x20Request")%r(HTTPOptions,4034,"HTTP/1\.0\x20200\x20OK\r\nAc
SF:cept-Ranges:\x20bytes\r\nCache-Control:\x20max-age=31536000\r\nContent-
SF:Length:\x2014202\r\nContent-Security-Policy:\x20script-src\x20'self'\x2
SF:0https://js\.hsforms\.net\x20https://www\.google\.com/recaptcha/\x20htt
SF:ps://www\.gstatic\.com/recaptcha/;\x20object-src\x20'none';\x20frame-an
SF:cestors\x20'none';\x20frame-src\x20https://www\.google\.com/recaptcha/\
SF:x20https://www\.gstatic\.com/recaptcha/\r\nContent-Type:\x20text/html;\
SF:x20charset=utf-8\r\nLast-Modified:\x20Thu,\x2025\x20Jun\x202026\x2001:2
SF:3:35\x20GMT\r\nPermissions-Policy:\x20accelerometer=\(\),ambient-light-
SF:sensor=\(\),attribution-reporting=\(\),autoplay=\(\),battery=\(\),brows
SF:ing-topics=\(\),camera=\(\),captured-surface-control=\(\),ch-device-mem
SF:ory=\(\),ch-downlink=\(\),ch-dpr=\(\),ch-ect=\(\),ch-prefers-color-sche
SF:me=\(\),ch-prefers-reduced-motion=\(\),ch-prefers-reduced-transparency=
SF:\(\),ch-rtt=\(\),ch-save-data=\(\),ch-ua=\(\),ch-ua-arch=\(\),ch-ua-bit
SF:ness=\(\),ch-ua-form-factors=\(\),ch-ua-full-version=\(\),ch-ua-full-ve
SF:rsion-list=\(\),ch-ua-mobil");
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Tue Aug 4 21:28:57 2026 -- 1 IP address (1 host up) scanned in 41.40 seconds
@@ -0,0 +1,7 @@
Scanning 142.251.142.14
TCP OPEN PORTS:
80/TCP
443/TCP
UDP OPEN PORTS:
@@ -0,0 +1,11 @@
# Nmap 7.99 scan initiated Tue Aug 4 21:26:40 2026 as: nmap -A -T5 -oN scan_google.com.txt -p- --script http-title --script-args http.max-redirects=3 google.com
Nmap scan report for google.com (142.251.209.142)
Host is up (0.054s latency).
Other addresses for google.com (not scanned): 2a00:1450:4007:811::200e
rDNS record for 142.251.209.142: pnpara-ah-in-f14.1e100.net
Not shown: 51151 filtered tcp ports (no-response), 14383 filtered tcp ports (host-unreach)
PORT STATE SERVICE VERSION
443/tcp open tcpwrapped
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Tue Aug 4 21:27:10 2026 -- 1 IP address (1 host up) scanned in 29.59 seconds