cybortx 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cybortx-2.1.0/PKG-INFO ADDED
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: cybortx
3
+ Version: 2.1.0
4
+ Summary: cybortX - Ultra-fast IP and Port Discovery Tool
5
+ Author-email: Abdulbasid Yakubu <cybort@example.com>
6
+ Requires-Python: >=3.8
@@ -0,0 +1,49 @@
1
+ # cybortX
2
+
3
+ **Author:** Abdulbasid Yakubu (Codename: cybort)
4
+
5
+ cybortX is a professional, ultra-fast IP and port discovery tool for security researchers and bug bounty hunters. It features asynchronous scanning, SSL bypass for service banner grabbing, and Cloudflare origin IP discovery.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install cybortx
11
+ # Scan top ports on a domain
12
+ cybortX example.com
13
+
14
+ # Scan specific ports
15
+ cybortX example.com -p 80,443,8080
16
+
17
+ # Scan an IP range
18
+ cybortX 192.168.1.1 -p 1-1000
19
+
20
+
21
+ Next, update your `pyproject.toml`. This tells PyPI everything it needs to know about your package, including its dependencies and the command that should be created.
22
+ ```bash
23
+ cat > ~/cybortX/pyproject.toml << 'EOF'
24
+ [build-system]
25
+ requires = ["setuptools>=61.0"]
26
+ build-backend = "setuptools.build_meta"
27
+
28
+ [project]
29
+ name = "cybortx"
30
+ version = "2.2.0"
31
+ description = "cybortX - Ultra-fast IP and Port Discovery Tool"
32
+ readme = "README.md"
33
+ authors = [
34
+ {name = "Abdulbasid Yakubu", email = "cybort@example.com"}
35
+ ]
36
+ requires-python = ">=3.8"
37
+ dependencies = [
38
+ "requests",
39
+ "dnspython",
40
+ ]
41
+
42
+ [project.scripts]
43
+ cybortX = "cybortx:main"
44
+
45
+ [tool.setuptools]
46
+ py-modules = ["cybortx"]
47
+
48
+ [tool.setuptools.packages.find]
49
+ include = ["core*", "utils*"]
File without changes
@@ -0,0 +1,108 @@
1
+ import socket
2
+ import ssl
3
+ import concurrent.futures
4
+
5
+ from utils.ui import C_GREEN, C_YELLOW, C_RESET, C_DIM
6
+
7
+ TOP_PORTS = [
8
+ 21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 443, 445, 993, 995,
9
+ 1723, 3306, 3389, 5900, 8080, 8443, 20, 69, 79, 88, 102, 110, 119,
10
+ 123, 137, 138, 161, 162, 179, 389, 427, 443, 444, 465, 500, 512,
11
+ 513, 514, 515, 520, 548, 554, 587, 623, 626, 631, 636, 646, 873,
12
+ 990, 993, 995, 1025, 1026, 1027, 1028, 1029, 1080, 1194, 1433,
13
+ 1434, 1521, 1701, 1723, 1755, 1812, 1813, 1883, 1900, 2000, 2049,
14
+ 2082, 2083, 2086, 2087, 2095, 2096, 2222, 2483, 2484, 3000, 3128,
15
+ 3260, 3306, 3389, 3689, 3690, 4000, 4369, 5000, 5060, 5222, 5269,
16
+ 5353, 5432, 5555, 5601, 5672, 5900, 5901, 5984, 6000, 6379, 6667,
17
+ 7000, 7077, 8000, 8008, 8080, 8081, 8443, 8888, 9000, 9090, 9200,
18
+ 9300, 10000, 11211, 27017, 27018, 50000, 50070
19
+ ]
20
+
21
+ SERVICES = {
22
+ 20: "ftp-data", 21: "ftp", 22: "ssh", 23: "telnet", 25: "smtp",
23
+ 53: "dns", 80: "http", 110: "pop3", 111: "rpcbind", 135: "msrpc",
24
+ 139: "netbios-ssn", 143: "imap", 443: "https", 445: "smb", 465: "smtps",
25
+ 587: "smtp-submission", 993: "imaps", 995: "pop3s", 1723: "pptp",
26
+ 2082: "cpanel", 2083: "cpanel-ssl", 2086: "whm", 2087: "whm-ssl",
27
+ 2095: "webmail", 2096: "webmail-ssl", 3306: "mysql", 3389: "rdp",
28
+ 5432: "postgresql", 5900: "vnc", 6379: "redis", 8080: "http-proxy",
29
+ 8443: "https-alt", 27017: "mongodb"
30
+ }
31
+
32
+ SSL_PORTS = [443, 465, 993, 995, 2083, 2087, 2096, 8443]
33
+ WEB_PORTS = [80, 443, 8080, 8000, 8008, 2082, 2083, 2086, 2087, 2095, 2096, 8443]
34
+
35
+ def parse_ports(port_str):
36
+ if not port_str or port_str.lower() == "top":
37
+ return sorted(list(set(TOP_PORTS)))
38
+
39
+ ports = set()
40
+ for part in port_str.split(","):
41
+ part = part.strip()
42
+ if "-" in part:
43
+ try:
44
+ start, end = part.split("-")
45
+ ports.update(range(int(start), int(end) + 1))
46
+ except ValueError:
47
+ return []
48
+ else:
49
+ try:
50
+ ports.add(int(part))
51
+ except ValueError:
52
+ return []
53
+
54
+ return sorted([p for p in ports if 1 <= p <= 65535])
55
+
56
+ def scan_and_grab(ip, port, timeout=1.5):
57
+ try:
58
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
59
+ s.settimeout(timeout)
60
+ result = s.connect_ex((ip, port))
61
+
62
+ if result != 0:
63
+ s.close()
64
+ return port, False, None
65
+
66
+ banner = None
67
+ try:
68
+ if port in SSL_PORTS:
69
+ context = ssl.create_default_context()
70
+ context.check_hostname = False
71
+ context.verify_mode = ssl.CERT_NONE
72
+ s = context.wrap_socket(s, server_hostname=ip)
73
+
74
+ if port in WEB_PORTS:
75
+ req = f"GET / HTTP/1.1\r\nHost: {ip}\r\nUser-Agent: Mozilla/5.0\r\nConnection: close\r\n\r\n"
76
+ s.sendall(req.encode())
77
+
78
+ data = s.recv(1024)
79
+ if data:
80
+ banner = data.decode('utf-8', errors='ignore').strip().split('\n')[0]
81
+ if len(banner) > 70:
82
+ banner = banner[:70] + "..."
83
+ except Exception:
84
+ pass
85
+
86
+ s.close()
87
+ return port, True, banner
88
+ except Exception:
89
+ return port, False, None
90
+
91
+ def run_scanner(ip, ports):
92
+ open_ports = []
93
+
94
+ with concurrent.futures.ThreadPoolExecutor(max_workers=50) as executor:
95
+ futures = {executor.submit(scan_and_grab, ip, port): port for port in ports}
96
+
97
+ for future in concurrent.futures.as_completed(futures):
98
+ port, is_open, banner_text = future.result()
99
+ if is_open:
100
+ open_ports.append(port)
101
+ service_name = SERVICES.get(port, "unknown")
102
+
103
+ print(f"{C_GREEN}[+]{C_RESET} {C_BOLD if 'C_BOLD' in globals() else ''}{ip}:{port}{C_RESET} [OPEN] - {C_YELLOW}{service_name}{C_RESET}")
104
+
105
+ if banner_text:
106
+ print(f" {C_DIM}└─ {banner_text}{C_RESET}")
107
+
108
+ return open_ports
@@ -0,0 +1,130 @@
1
+ import socket
2
+ import ssl
3
+ import ipaddress
4
+ import requests
5
+ import re
6
+ from utils.ui import C_GREEN, C_YELLOW, C_RED, C_RESET, C_DIM, C_CYAN, C_BOLD
7
+
8
+ # Official Cloudflare IPv4 ranges (can be fetched dynamically, hardcoded for reliability)
9
+ CLOUDFLARE_CIDRS = [
10
+ "103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "104.16.0.0/13",
11
+ "104.24.0.0/14", "108.162.192.0/18", "131.0.72.0/22", "141.101.64.0/18",
12
+ "162.158.0.0/15", "172.64.0.0/13", "173.245.48.0/20", "188.114.96.0/20",
13
+ "190.93.240.0/20", "197.234.240.0/22", "198.41.128.0/17"
14
+ ]
15
+ CLOUDFLARE_NETS = [ipaddress.ip_network(cidr) for cidr in CLOUDFLARE_CIDRS]
16
+
17
+ def is_cloudflare_ip(ip_str):
18
+ try:
19
+ ip = ipaddress.ip_address(ip_str)
20
+ return any(ip in net for net in CLOUDFLARE_NETS)
21
+ except ValueError:
22
+ return False
23
+
24
+ def get_candidates_from_crtsh(domain):
25
+ candidates = set()
26
+ try:
27
+ r = requests.get(f"https://crt.sh/?q=%25.{domain}&output=json", timeout=15)
28
+ if r.status_code == 200:
29
+ for entry in r.json():
30
+ for sub in entry.get('name_value', '').split('\n'):
31
+ sub = sub.strip().lower()
32
+ if sub and '*' not in sub:
33
+ try:
34
+ ip = socket.gethostbyname(sub)
35
+ if not is_cloudflare_ip(ip):
36
+ candidates.add(ip)
37
+ except socket.gaierror:
38
+ pass
39
+ except Exception:
40
+ pass
41
+ return candidates
42
+
43
+ def get_candidates_from_spf(domain):
44
+ candidates = set()
45
+ try:
46
+ import dns.resolver
47
+ answers = dns.resolver.resolve(domain, 'TXT')
48
+ for rdata in answers:
49
+ txt = b''.join(rdata.strings).decode('utf-8', errors='ignore')
50
+ if 'v=spf1' in txt:
51
+ for match in re.finditer(r'ip[46]:([0-9a-fA-F.:]+)', txt):
52
+ ip = match.group(1)
53
+ if not is_cloudflare_ip(ip):
54
+ candidates.add(ip)
55
+ except Exception:
56
+ pass
57
+ return candidates
58
+
59
+ def get_candidates_from_mx(domain):
60
+ candidates = set()
61
+ try:
62
+ import dns.resolver
63
+ answers = dns.resolver.resolve(domain, 'MX')
64
+ for rdata in answers:
65
+ mx_host = str(rdata.exchange).rstrip('.')
66
+ try:
67
+ ip = socket.gethostbyname(mx_host)
68
+ if not is_cloudflare_ip(ip):
69
+ candidates.add(ip)
70
+ except socket.gaierror:
71
+ pass
72
+ except Exception:
73
+ pass
74
+ return candidates
75
+
76
+ def verify_origin(ip, domain, timeout=3):
77
+ try:
78
+ headers = {"Host": domain, "User-Agent": "Mozilla/5.0"}
79
+ r = requests.get(f"http://{ip}/", headers=headers, timeout=timeout, allow_redirects=False)
80
+ if r.status_code in [200, 301, 302, 403]:
81
+ return True, r.status_code
82
+ except Exception:
83
+ pass
84
+ return False, None
85
+
86
+ def find_origin(domain):
87
+ print(f"\n{C_CYAN}[*]{C_RESET} Checking if {domain} is behind Cloudflare...")
88
+ try:
89
+ resolved_ip = socket.gethostbyname(domain)
90
+ except socket.gaierror:
91
+ print(f"{C_RED}[-]{C_RESET} Could not resolve {domain}")
92
+ return None
93
+
94
+ if not is_cloudflare_ip(resolved_ip):
95
+ print(f"{C_DIM} Not behind Cloudflare (resolved to {resolved_ip}).{C_RESET}")
96
+ return resolved_ip
97
+
98
+ print(f"{C_YELLOW}[!]{C_RESET} Cloudflare detected ({resolved_ip}). Searching for origin...")
99
+
100
+ candidates = set()
101
+ print(f"{C_DIM} - Querying crt.sh...{C_RESET}")
102
+ candidates.update(get_candidates_from_crtsh(domain))
103
+ print(f"{C_DIM} - Parsing SPF records...{C_RESET}")
104
+ candidates.update(get_candidates_from_spf(domain))
105
+ print(f"{C_DIM} - Checking MX records...{C_RESET}")
106
+ candidates.update(get_candidates_from_mx(domain))
107
+
108
+ if not candidates:
109
+ print(f"{C_RED}[-]{C_RESET} No candidate IPs found.")
110
+ return None
111
+
112
+ print(f"{C_GREEN}[+]{C_RESET} Found {len(candidates)} candidate(s). Verifying...")
113
+
114
+ verified = []
115
+ for ip in candidates:
116
+ success, status = verify_origin(ip, domain)
117
+ if success:
118
+ verified.append((ip, status))
119
+ print(f" {C_GREEN}✓{C_RESET} {C_BOLD}{ip}{C_RESET} (HTTP {status})")
120
+ else:
121
+ print(f" {C_DIM}✗ {ip} (no web response){C_RESET}")
122
+
123
+ if verified:
124
+ print(f"\n{C_GREEN}[+]{C_RESET} Origin candidate(s) found:")
125
+ for ip, status in verified:
126
+ print(f" {C_BOLD}{ip}{C_RESET} (HTTP {status})")
127
+ return verified[0][0]
128
+ else:
129
+ print(f"{C_RED}[-]{C_RESET} Could not verify any origin IP.")
130
+ return None
@@ -0,0 +1,95 @@
1
+ import asyncio
2
+ import ipaddress
3
+ import socket
4
+ import time
5
+ from typing import Iterable
6
+
7
+
8
+ DEFAULT_PORTS = [
9
+ 21, 22, 23, 25, 53, 80, 110, 111, 135, 139, 143, 443, 445,
10
+ 993, 995, 1433, 1521, 1723, 2049, 2082, 2083, 2181, 2375,
11
+ 2376, 3000, 3128, 3306, 3389, 4444, 5000, 5432, 5555, 5601,
12
+ 5672, 5900, 5984, 6379, 6443, 7001, 7077, 8000, 8008, 8080,
13
+ 8081, 8443, 8888, 9000, 9090, 9200, 9300, 10000, 11211,
14
+ 27017, 27018, 50000, 50070,
15
+ ]
16
+
17
+
18
+ def parse_targets(target: str) -> list[str]:
19
+ """Accept IP, CIDR, hostname, or comma-separated list."""
20
+ targets = []
21
+ for part in target.split(","):
22
+ part = part.strip()
23
+ if not part:
24
+ continue
25
+ try:
26
+ net = ipaddress.ip_network(part, strict=False)
27
+ targets.extend(str(ip) for ip in net.hosts())
28
+ continue
29
+ except ValueError:
30
+ pass
31
+ try:
32
+ infos = socket.getaddrinfo(part, None)
33
+ ips = sorted({i[4][0] for i in infos})
34
+ targets.extend(ips)
35
+ except socket.gaierror:
36
+ raise ValueError(f"Cannot resolve target: {part}")
37
+ return targets
38
+
39
+
40
+ def parse_ports(spec: str) -> list[int]:
41
+ """Accept '80', '1-1000', '22,80,443', or 'top'."""
42
+ if spec.lower() == "top":
43
+ return DEFAULT_PORTS
44
+ ports = set()
45
+ for chunk in spec.split(","):
46
+ chunk = chunk.strip()
47
+ if "-" in chunk:
48
+ a, b = chunk.split("-", 1)
49
+ ports.update(range(int(a), int(b) + 1))
50
+ else:
51
+ ports.add(int(chunk))
52
+ return sorted(p for p in ports if 1 <= p <= 65535)
53
+
54
+
55
+ async def _check_port(ip: str, port: int, timeout: float) -> tuple[int, float] | None:
56
+ start = time.perf_counter()
57
+ try:
58
+ reader, writer = await asyncio.wait_for(
59
+ asyncio.open_connection(ip, port), timeout=timeout
60
+ )
61
+ latency = (time.perf_counter() - start) * 1000
62
+ writer.close()
63
+ try:
64
+ await writer.wait_closed()
65
+ except Exception:
66
+ pass
67
+ return port, round(latency, 2)
68
+ except (asyncio.TimeoutError, ConnectionRefusedError, OSError):
69
+ return None
70
+
71
+
72
+ async def _scan_ip(ip: str, ports: Iterable[int], concurrency: int, timeout: float):
73
+ sem = asyncio.Semaphore(concurrency)
74
+
75
+ async def limited(p):
76
+ async with sem:
77
+ return await _check_port(ip, p, timeout)
78
+
79
+ results = await asyncio.gather(*(limited(p) for p in ports))
80
+ return ip, [r for r in results if r]
81
+
82
+
83
+ async def scan_async(targets: list[str], ports: list[int],
84
+ concurrency: int = 1000, timeout: float = 1.0,
85
+ on_ip_done=None) -> dict:
86
+ sem = asyncio.Semaphore(concurrency)
87
+
88
+ async def run(ip):
89
+ res = await _scan_ip(ip, ports, concurrency, timeout)
90
+ if on_ip_done:
91
+ on_ip_done(*res)
92
+ return res
93
+
94
+ all_results = await asyncio.gather(*(run(ip) for ip in targets))
95
+ return {ip: open_ports for ip, open_ports in all_results if open_ports}
@@ -0,0 +1,67 @@
1
+ import re
2
+ from urllib.parse import urlsplit
3
+
4
+
5
+ def validate_domain(value):
6
+
7
+ if not isinstance(value, str):
8
+ return None
9
+
10
+ value = value.strip()
11
+
12
+ if not value or any(ord(c) < 32 for c in value):
13
+ return None
14
+
15
+ try:
16
+ if "://" not in value:
17
+ value = "//" + value
18
+
19
+ parsed = urlsplit(value)
20
+
21
+ if parsed.scheme and parsed.scheme.lower() not in (
22
+ "http", "https"
23
+ ):
24
+ return None
25
+
26
+ if parsed.username or parsed.password:
27
+ return None
28
+
29
+ host = parsed.hostname
30
+
31
+ if not host:
32
+ return None
33
+
34
+ # Validate supplied port.
35
+ if parsed.port is not None:
36
+ if not 1 <= parsed.port <= 65535:
37
+ return None
38
+
39
+ # Convert internationalized domains.
40
+ domain = host.rstrip(".").encode("idna").decode("ascii").lower()
41
+
42
+ if len(domain) > 253:
43
+ return None
44
+
45
+ labels = domain.split(".")
46
+
47
+ if len(labels) < 2:
48
+ return None
49
+
50
+ for label in labels:
51
+ if (
52
+ not label
53
+ or len(label) > 63
54
+ or not re.fullmatch(
55
+ r"[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",
56
+ label
57
+ )
58
+ ):
59
+ return None
60
+
61
+ if not re.fullmatch(r"[a-z]{2,63}", labels[-1]):
62
+ return None
63
+
64
+ return domain
65
+
66
+ except (ValueError, UnicodeError):
67
+ return None
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: cybortx
3
+ Version: 2.1.0
4
+ Summary: cybortX - Ultra-fast IP and Port Discovery Tool
5
+ Author-email: Abdulbasid Yakubu <cybort@example.com>
6
+ Requires-Python: >=3.8
@@ -0,0 +1,25 @@
1
+ README.md
2
+ cybortx.py
3
+ pyproject.toml
4
+ requirements.txt
5
+ core/__init__.py
6
+ core/engine.py
7
+ core/origin.py
8
+ core/scanner.py
9
+ core/validator.py
10
+ cybortx.egg-info/PKG-INFO
11
+ cybortx.egg-info/SOURCES.txt
12
+ cybortx.egg-info/dependency_links.txt
13
+ cybortx.egg-info/entry_points.txt
14
+ cybortx.egg-info/top_level.txt
15
+ modules/__init__.py
16
+ modules/dns_analysis.py
17
+ modules/http_analysis.py
18
+ modules/ip_intelligence.py
19
+ modules/nameserver.py
20
+ modules/ssl_analysis.py
21
+ modules/tls_analysis.py
22
+ modules/whois_lookup.py
23
+ utils/__init__.py
24
+ utils/reporter.py
25
+ utils/ui.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cybortX = cybortx:main
@@ -0,0 +1,3 @@
1
+ core
2
+ cybortx
3
+ utils
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import argparse
4
+ import sys
5
+ import socket
6
+ import time
7
+
8
+ from utils.ui import print_banner, print_help, C_GREEN, C_RED, C_RESET, C_BOLD, C_YELLOW
9
+ from core.engine import parse_ports, run_scanner
10
+ from core.origin import find_origin
11
+
12
+ def main():
13
+ parser = argparse.ArgumentParser(add_help=False)
14
+ parser.add_argument("target", nargs="?", help="Target IP or Domain")
15
+ parser.add_argument("-p", "--ports", help="Ports to scan")
16
+ parser.add_argument("-h", "--help", action="store_true")
17
+ args = parser.parse_args()
18
+
19
+ if args.help or not args.target:
20
+ print_banner()
21
+ print_help()
22
+ sys.exit(0)
23
+
24
+ print_banner()
25
+ target = args.target
26
+
27
+ # --- Cloudflare Origin Discovery (Automatic) ---
28
+ scan_ip = target
29
+ if not target.replace('.', '').isdigit(): # It's a domain, not a raw IP
30
+ origin_ip = find_origin(target)
31
+ if origin_ip:
32
+ scan_ip = origin_ip
33
+ print(f"\n{C_GREEN}[*]{C_RESET} Using discovered IP for scanning: {C_BOLD}{scan_ip}{C_RESET}\n")
34
+ else:
35
+ # Fall back to normal resolution
36
+ try:
37
+ scan_ip = socket.gethostbyname(target)
38
+ print(f"\n{C_RESET}[*] Falling back to resolved IP: {C_BOLD}{scan_ip}{C_RESET}\n")
39
+ except socket.gaierror:
40
+ print(f"{C_RED}[ERROR]{C_RESET} Could not resolve IP for: {target}")
41
+ sys.exit(1)
42
+ else:
43
+ scan_ip = target
44
+
45
+ # --- Port Scanning ---
46
+ ports_to_scan = parse_ports(args.ports)
47
+ if not ports_to_scan:
48
+ print(f"{C_RED}[ERROR]{C_RESET} Invalid port format.")
49
+ sys.exit(1)
50
+
51
+ print(f"{C_RESET}[*] Scanning {len(ports_to_scan)} Ports on {C_BOLD}{scan_ip}{C_RESET}...\n")
52
+ start_time = time.time()
53
+
54
+ try:
55
+ open_ports = run_scanner(scan_ip, ports_to_scan)
56
+ except KeyboardInterrupt:
57
+ print(f"\n{C_RESET}[!] Scan interrupted by user.")
58
+ sys.exit(1)
59
+
60
+ elapsed = round(time.time() - start_time, 2)
61
+ if not open_ports:
62
+ print(f"{C_RESET}[-] No open ports found.")
63
+
64
+ print(f"\n{C_RESET}[*] Scan completed in {elapsed} seconds.")
65
+ print(f"{C_RESET}[*] Found {C_GREEN}{len(open_ports)}{C_RESET} open port(s) on {C_BOLD}{scan_ip}{C_RESET}")
66
+
67
+ if __name__ == "__main__":
68
+ main()
File without changes
@@ -0,0 +1,28 @@
1
+ import dns.resolver
2
+
3
+
4
+ def dns_analysis(domain):
5
+
6
+ records = {}
7
+ record_types = ["A", "AAAA", "MX", "NS", "TXT", "CNAME"]
8
+
9
+ resolver = dns.resolver.Resolver()
10
+ resolver.timeout = 3
11
+ resolver.lifetime = 5
12
+
13
+ for record_type in record_types:
14
+
15
+ try:
16
+ answers = resolver.resolve(domain, record_type)
17
+
18
+ records[record_type] = [
19
+ str(answer) for answer in answers
20
+ ]
21
+
22
+ except Exception:
23
+ records[record_type] = []
24
+
25
+ return {
26
+ "status": "COMPLETED",
27
+ "records": records
28
+ }
@@ -0,0 +1,50 @@
1
+ import requests
2
+
3
+
4
+ def http_analysis(domain):
5
+
6
+ results = {}
7
+
8
+ for scheme in ["http", "https"]:
9
+
10
+ url = f"{scheme}://{domain}"
11
+
12
+ try:
13
+ response = requests.get(
14
+ url,
15
+ timeout=10,
16
+ allow_redirects=True,
17
+ headers={
18
+ "User-Agent": "CYBORT-X/1.0"
19
+ }
20
+ )
21
+
22
+ headers = dict(response.headers)
23
+
24
+ security_headers = [
25
+ "Strict-Transport-Security",
26
+ "Content-Security-Policy",
27
+ "X-Frame-Options",
28
+ "X-Content-Type-Options",
29
+ "Referrer-Policy"
30
+ ]
31
+
32
+ results[scheme] = {
33
+ "status_code": response.status_code,
34
+ "final_url": response.url,
35
+ "server": headers.get("Server", "Not disclosed"),
36
+ "security_headers": {
37
+ header: headers.get(header, "Missing")
38
+ for header in security_headers
39
+ }
40
+ }
41
+
42
+ except requests.RequestException as error:
43
+ results[scheme] = {
44
+ "error": str(error)
45
+ }
46
+
47
+ return {
48
+ "status": "COMPLETED",
49
+ "http_analysis": results
50
+ }
@@ -0,0 +1,76 @@
1
+ import socket
2
+ import requests
3
+ from ipwhois import IPWhois
4
+
5
+
6
+ def ip_intelligence(domain):
7
+
8
+ try:
9
+ addresses = socket.getaddrinfo(
10
+ domain, None, proto=socket.IPPROTO_TCP
11
+ )
12
+
13
+ ips = sorted(set(item[4][0] for item in addresses))
14
+
15
+ output = []
16
+
17
+ for ip in ips:
18
+
19
+ info = {
20
+ "ip": ip,
21
+ "asn": "Not available",
22
+ "network": "Not available",
23
+ "country": "Not available",
24
+ "city": "Not available",
25
+ "isp": "Not available"
26
+ }
27
+
28
+ try:
29
+ if ":" not in ip:
30
+ rdap = IPWhois(ip).lookup_rdap(
31
+ depth=0,
32
+ retry_count=0
33
+ )
34
+
35
+ info["asn"] = rdap.get("asn", "Not available")
36
+ info["network"] = rdap.get(
37
+ "network", {}
38
+ ).get("name", "Not available")
39
+ info["country"] = rdap.get(
40
+ "network", {}
41
+ ).get("country", "Not available")
42
+
43
+ except Exception:
44
+ pass
45
+
46
+ try:
47
+ response = requests.get(
48
+ f"http://ip-api.com/json/{ip}",
49
+ params={"fields": "status,country,city,isp"},
50
+ timeout=5
51
+ )
52
+
53
+ geo = response.json()
54
+
55
+ if geo.get("status") == "success":
56
+ info["country"] = geo.get(
57
+ "country", info["country"]
58
+ )
59
+ info["city"] = geo.get("city", "Not available")
60
+ info["isp"] = geo.get("isp", "Not available")
61
+
62
+ except Exception:
63
+ pass
64
+
65
+ output.append(info)
66
+
67
+ return {
68
+ "status": "COMPLETED",
69
+ "addresses": output
70
+ }
71
+
72
+ except Exception as error:
73
+ return {
74
+ "status": "ERROR",
75
+ "error": str(error)
76
+ }
@@ -0,0 +1,29 @@
1
+ import dns.resolver
2
+
3
+
4
+ def nameserver_analysis(domain):
5
+
6
+ try:
7
+ answers = dns.resolver.resolve(
8
+ domain, "NS", lifetime=5
9
+ )
10
+
11
+ nameservers = []
12
+
13
+ for answer in answers:
14
+ ns = str(answer.target).rstrip(".")
15
+
16
+ nameservers.append({
17
+ "nameserver": ns
18
+ })
19
+
20
+ return {
21
+ "status": "COMPLETED",
22
+ "nameservers": nameservers
23
+ }
24
+
25
+ except Exception as error:
26
+ return {
27
+ "status": "ERROR",
28
+ "error": str(error)
29
+ }
@@ -0,0 +1,64 @@
1
+ import socket
2
+ import ssl
3
+ from datetime import datetime, timezone
4
+
5
+
6
+ def ssl_analysis(domain):
7
+
8
+ try:
9
+ context = ssl.create_default_context()
10
+
11
+ with socket.create_connection(
12
+ (domain, 443), timeout=8
13
+ ) as connection:
14
+
15
+ with context.wrap_socket(
16
+ connection,
17
+ server_hostname=domain
18
+ ) as secure_socket:
19
+
20
+ cert = secure_socket.getpeercert()
21
+
22
+ not_before = datetime.strptime(
23
+ cert["notBefore"],
24
+ "%b %d %H:%M:%S %Y %Z"
25
+ ).replace(tzinfo=timezone.utc)
26
+
27
+ not_after = datetime.strptime(
28
+ cert["notAfter"],
29
+ "%b %d %H:%M:%S %Y %Z"
30
+ ).replace(tzinfo=timezone.utc)
31
+
32
+ now = datetime.now(timezone.utc)
33
+
34
+ issuer = dict(
35
+ (key, value)
36
+ for item in cert.get("issuer", [])
37
+ for key, value in item
38
+ )
39
+
40
+ subject = dict(
41
+ (key, value)
42
+ for item in cert.get("subject", [])
43
+ for key, value in item
44
+ )
45
+
46
+ return {
47
+ "status": "COMPLETED",
48
+ "issuer": issuer,
49
+ "subject": subject,
50
+ "valid_from": str(not_before),
51
+ "expires": str(not_after),
52
+ "days_remaining": (
53
+ not_after - now
54
+ ).days,
55
+ "domain_match": True,
56
+ "certificate_verified": True
57
+ }
58
+
59
+ except Exception as error:
60
+ return {
61
+ "status": "ERROR",
62
+ "certificate_verified": False,
63
+ "error": str(error)
64
+ }
@@ -0,0 +1,50 @@
1
+ import socket
2
+ import ssl
3
+
4
+
5
+ def tls_analysis(domain):
6
+
7
+ versions = [
8
+ ("TLS 1.0", ssl.TLSVersion.TLSv1),
9
+ ("TLS 1.1", ssl.TLSVersion.TLSv1_1),
10
+ ("TLS 1.2", ssl.TLSVersion.TLSv1_2),
11
+ ("TLS 1.3", ssl.TLSVersion.TLSv1_3),
12
+ ]
13
+
14
+ results = {}
15
+
16
+ for name, version in versions:
17
+
18
+ try:
19
+ context = ssl.SSLContext(
20
+ ssl.PROTOCOL_TLS_CLIENT
21
+ )
22
+
23
+ context.check_hostname = True
24
+ context.verify_mode = ssl.CERT_REQUIRED
25
+ context.minimum_version = version
26
+ context.maximum_version = version
27
+
28
+ with socket.create_connection(
29
+ (domain, 443), timeout=5
30
+ ) as connection:
31
+
32
+ with context.wrap_socket(
33
+ connection,
34
+ server_hostname=domain
35
+ ) as secure_socket:
36
+
37
+ results[name] = {
38
+ "supported": True,
39
+ "negotiated": secure_socket.version()
40
+ }
41
+
42
+ except Exception:
43
+ results[name] = {
44
+ "supported": False
45
+ }
46
+
47
+ return {
48
+ "status": "COMPLETED",
49
+ "protocols": results
50
+ }
@@ -0,0 +1,95 @@
1
+ import whois
2
+ from datetime import datetime, date
3
+
4
+
5
+ def clean(value):
6
+
7
+ if value is None:
8
+ return None
9
+
10
+ if isinstance(value, (datetime, date)):
11
+ return value.isoformat()
12
+
13
+ if isinstance(value, dict):
14
+ return {
15
+ str(k): clean(v)
16
+ for k, v in value.items()
17
+ }
18
+
19
+ if isinstance(value, (list, tuple, set)):
20
+ return [
21
+ clean(item)
22
+ for item in value
23
+ ]
24
+
25
+ if isinstance(value, bytes):
26
+ return value.decode("utf-8", errors="replace")
27
+
28
+ if isinstance(value, (str, int, float, bool)):
29
+ return value
30
+
31
+ return str(value)
32
+
33
+
34
+ def whois_lookup(domain):
35
+
36
+ try:
37
+
38
+ # Perform real WHOIS lookup
39
+ data = whois.whois(domain)
40
+
41
+ # Extract every parsed field
42
+ if isinstance(data, dict):
43
+ parsed_data = dict(data)
44
+ else:
45
+ parsed_data = vars(data)
46
+
47
+ # Remove internal parser objects
48
+ parsed_data.pop("parser", None)
49
+
50
+ # Preserve complete raw WHOIS response
51
+ raw_response = getattr(data, "text", None)
52
+
53
+ # Some versions expose raw text differently
54
+ if not raw_response:
55
+ raw_response = parsed_data.get("text")
56
+
57
+ # Clean every available field
58
+ details = {
59
+ str(key): clean(value)
60
+ for key, value in parsed_data.items()
61
+ }
62
+
63
+ # Remove empty fields from parsed information
64
+ details = {
65
+ key: value
66
+ for key, value in details.items()
67
+ if value not in (None, "", [], {})
68
+ }
69
+
70
+ # Build complete response
71
+ result = {
72
+ "status": "COMPLETED",
73
+ "query": domain,
74
+ "source": "python-whois",
75
+ "total_fields": len(details),
76
+ "details": details,
77
+ "raw_whois": (
78
+ raw_response
79
+ if isinstance(raw_response, str)
80
+ else None
81
+ ),
82
+ "raw_response_available": isinstance(
83
+ raw_response, str
84
+ ) and bool(raw_response.strip())
85
+ }
86
+
87
+ return result
88
+
89
+ except Exception as error:
90
+
91
+ return {
92
+ "status": "ERROR",
93
+ "query": domain,
94
+ "error": str(error)
95
+ }
@@ -0,0 +1,21 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "cybortx"
7
+ version = "2.1.0"
8
+ description = "cybortX - Ultra-fast IP and Port Discovery Tool"
9
+ authors = [
10
+ {name = "Abdulbasid Yakubu", email = "cybort@example.com"}
11
+ ]
12
+ requires-python = ">=3.8"
13
+
14
+ [project.scripts]
15
+ cybortX = "cybortx:main"
16
+
17
+ [tool.setuptools]
18
+ py-modules = ["cybortx"]
19
+
20
+ [tool.setuptools.packages.find]
21
+ include = ["core*", "utils*"]
@@ -0,0 +1,7 @@
1
+ dnspython
2
+ python-whois
3
+ requests
4
+ cryptography
5
+ ipwhois
6
+ rich
7
+ colorama
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,31 @@
1
+ import json
2
+ import os
3
+ import re
4
+ from datetime import datetime, timezone
5
+ from pathlib import Path
6
+
7
+
8
+ def save_report(target: str, results: dict) -> str:
9
+ data_home = Path(
10
+ os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share")
11
+ )
12
+ reports_dir = data_home / "cybortx" / "reports"
13
+ reports_dir.mkdir(parents=True, exist_ok=True)
14
+
15
+ safe = re.sub(r"[^a-zA-Z0-9.-]", "_", target)[:60]
16
+ ts = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
17
+ filepath = reports_dir / f"{safe}_{ts}.json"
18
+
19
+ report = {
20
+ "tool": "CYBORT X",
21
+ "version": "2.0.0",
22
+ "target": target,
23
+ "timestamp": datetime.now(timezone.utc).isoformat(),
24
+ "results": {
25
+ ip: [{"port": p, "latency_ms": l} for p, l in ports]
26
+ for ip, ports in results.items()
27
+ },
28
+ }
29
+ with open(filepath, "w", encoding="utf-8") as f:
30
+ json.dump(report, f, indent=4, ensure_ascii=False, default=str)
31
+ return str(filepath)
@@ -0,0 +1,36 @@
1
+ C_GREEN = "\033[92m"
2
+ C_CYAN = "\033[96m"
3
+ C_YELLOW = "\033[93m"
4
+ C_RED = "\033[91m"
5
+ C_BOLD = "\033[1m"
6
+ C_RESET = "\033[0m"
7
+ C_DIM = "\033[2m"
8
+
9
+ VERSION = "2.1.0"
10
+ AUTHOR = "Abdulbasid Yakubu"
11
+ CODENAME = "cybort"
12
+
13
+ BANNER_ART = r"""
14
+ ___ __ __ ___ ___ ____ _____ __ __
15
+ / __| \ \/ / _ ) / _ \| _ \_ _|\ \/ /
16
+ | (__ > / | _ \| (_) | |_) || | > <
17
+ \___| /_ \___/ \___/|____/ |_| /_/\_\
18
+ """
19
+
20
+ def print_banner():
21
+ print(f"{C_BOLD}{C_CYAN}{BANNER_ART}{C_RESET} {C_DIM}v{VERSION}{C_RESET}\n")
22
+ print(f" Author: {C_BOLD}{AUTHOR}{C_RESET} | Codename: {C_DIM}{CODENAME}{C_RESET}\n")
23
+ print(f"{C_RESET}[!] Use with caution. You are responsible for your actions.")
24
+ print(f"{C_RESET}[!] Developers assume no liability and are not responsible for any misuse or damage.\n")
25
+
26
+ def print_help():
27
+ print(f"{C_CYAN}Usage:{C_RESET}")
28
+ print(f" cybortX <target> [options]\n")
29
+ print(f"{C_CYAN}Options:{C_RESET}")
30
+ print(f" -p, --ports Ports to scan (e.g. 80,443 or 1-1000 or 'top')")
31
+ print(f" -h, --help Show this help menu\n")
32
+ print(f"{C_CYAN}Examples:{C_RESET}")
33
+ print(f" cybortX example.com")
34
+ print(f" cybortX 127.0.0.1 -p 1-1000")
35
+ print(f" cybortX example.com -p 80,443,8080")
36
+ print()