+
+
+
+[](LICENSE)
+[](https://python.org)
+[](https://github.com/cyberviser/Hancock)
+
+**Authorized penetration testing toolkit — vulnerability scanning, stress testing, and exploit chain simulation.**
+
+> ⚠️ **FOR AUTHORIZED USE ONLY.** Use only on systems you own or have explicit written permission to test. Unauthorized use is illegal.
+
+
⚠ AUTHORIZED USE ONLY — FOR PENTESTERS & RED TEAMS
+
TERMINAL PRESSURE
+
Authorized penetration testing toolkit — vulnerability scanning, connection stress testing, and exploit chain simulation. Built for red teams by CyberViser.
[+] Injecting backdoor sim on 192.168.1.1 - Codex tip: Replace with real rev-shell
+
+
+
+
+
+
// capabilities
+
+
+
🔍
+
Vulnerability Scanner
+
Automated nmap-based scanning across ports 1–1024 with service detection and CVE correlation. Outputs structured reports.
+ scan <target>
+
+
+
💥
+
Stress Testing
+
Multi-threaded connection load testing for authorized resilience assessments. Configurable thread count and duration.
+ stress <target> --port 80
+
+
+
⛓️
+
Exploit Chain Sim
+
Simulate multi-stage exploit chains for authorized red team exercises. Documents attack paths without executing payloads.
+ exploit <target> --payload default_backdoor
+
+
+
📋
+
Report Generation
+
Auto-generates timestamped plaintext reports after each scan or test run. Ready to drop into your pentest report.
+ output: report_YYYYMMDD.txt
+
+
+
🤖
+
Hancock Integration
+
Pair with Hancock AI to get instant triage, CVE analysis, and PICERL playbooks for every finding TerminalPressure uncovers.
+ cyberviser.netlify.app
+
+
+
🛡️
+
Proprietary License
+
CyberViser Proprietary License — permitted for authorized research and testing. Commercial use requires a license agreement.
+ cyberviser@proton.me
+
+
+
+
+
+ ⚠️ This tool is for authorized security testing only. You must have explicit written permission to test any system. Unauthorized use is illegal under the CFAA and equivalent laws. CyberViser assumes no liability for misuse.
+
TerminalPressure handles the exploitation. Hancock handles the analysis — triage findings, generate CVE reports, write executive summaries, and build IR playbooks using AI.
+ Explore Hancock AI →
+
+
+
+
+
+
diff --git a/requirements.txt b/requirements.txt
index 761b2c3..3cb84f3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
-python-nmap
-scapy
+python-nmap>=0.7.1
+scapy>=2.5.0
+requests>=2.32.0
diff --git a/terminal_pressure.py b/terminal_pressure.py
index b064653..bd46de2 100644
--- a/terminal_pressure.py
+++ b/terminal_pressure.py
@@ -1,14 +1,34 @@
#!/usr/bin/env python3
+# Copyright (c) 2025 CyberViser. All Rights Reserved.
+# Licensed under the CyberViser Proprietary License — see LICENSE for details.
+# FOR AUTHORIZED SECURITY TESTING ONLY. Unauthorized use is illegal and prohibited.
import argparse
-import nmap # Requires pip install python-nmap (user installs)
+import concurrent.futures
+import importlib
+import logging
import socket
-import requests
-from scapy.all import * # For packet crafting; pip install scapy
-import random
-import threading
import time
+def _load_optional_dependency(module_name, package_name):
+ """Import command-specific dependencies only when the command is used."""
+ try:
+ return importlib.import_module(module_name)
+ except ImportError as exc:
+ raise SystemExit(
+ f"Missing optional dependency '{package_name}'. "
+ f"Install it with `pip install {package_name}`."
+ ) from exc
+
+
+def positive_int(value):
+ value = int(value)
+ if value <= 0:
+ raise argparse.ArgumentTypeError("must be a positive integer")
+ return value
+
+
def scan_vulns(target):
+ nmap = _load_optional_dependency("nmap", "python-nmap")
scanner = nmap.PortScanner()
print(f"[+] Pressuring target: {target}")
scanner.scan(target, '1-1024', '-sV --script vuln')
@@ -29,54 +49,57 @@ def flood():
end_time = time.time() + duration
while time.time() < end_time:
try:
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.connect((target, port))
- s.send(b"GET / HTTP/1.1\r\nHost: " + target.encode() + b"\r\n\r\n")
- s.close()
- except:
- pass
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+ s.connect((target, port))
+ s.send(b"GET / HTTP/1.1\r\nHost: " + target.encode() + b"\r\n\r\n")
+ except (socket.error, OSError) as e:
+ logging.debug("Connection error: %s", e)
print(f"[+] Applying pressure to {target}:{port} with {threads} threads for {duration}s")
- for _ in range(threads):
- t = threading.Thread(target=flood)
- t.start()
+ max_workers = min(threads, 100)
+ with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:
+ futures = [executor.submit(flood) for _ in range(threads)]
+ concurrent.futures.wait(futures)
def exploit_chain(target, payload="default_backdoor"):
# Shadow module: Simulate exploit (real: inject shellcode)
if payload == "default_backdoor":
print(f"[+] Injecting backdoor sim on {target} - Codex tip: Replace with real rev-shell")
# Placeholder: In prod, use metasploit embeds or custom C2
- pkt = IP(dst=target)/TCP(dport=4444, flags="S")/Raw(load="CHAOS_AWAKEN")
- send(pkt, verbose=0)
+ scapy = _load_optional_dependency("scapy.all", "scapy")
+ pkt = scapy.IP(dst=target) / scapy.TCP(dport=4444, flags="S") / scapy.Raw(load=b"CHAOS_AWAKEN")
+ scapy.send(pkt, verbose=0)
else:
print(f"[+] Custom exploit chain: {payload}")
-def main():
+def build_parser():
parser = argparse.ArgumentParser(description="Terminal Pressure: Cyber Tool for Pressure Testing")
- subparsers = parser.add_subparsers(dest='command')
+ subparsers = parser.add_subparsers(dest='command', required=True)
scan_parser = subparsers.add_parser('scan', help='Scan for vulnerabilities')
scan_parser.add_argument('target', type=str, help='Target IP/hostname')
stress_parser = subparsers.add_parser('stress', help='Stress test (DDoS sim)')
stress_parser.add_argument('target', type=str, help='Target IP/hostname')
- stress_parser.add_argument('--port', type=int, default=80, help='Port')
- stress_parser.add_argument('--threads', type=int, default=50, help='Threads')
- stress_parser.add_argument('--duration', type=int, default=60, help='Duration in seconds')
+ stress_parser.add_argument('--port', type=positive_int, default=80, help='Port')
+ stress_parser.add_argument('--threads', type=positive_int, default=50, help='Threads')
+ stress_parser.add_argument('--duration', type=positive_int, default=60, help='Duration in seconds')
exploit_parser = subparsers.add_parser('exploit', help='Exploit chain (advanced)')
exploit_parser.add_argument('target', type=str, help='Target IP/hostname')
exploit_parser.add_argument('--payload', type=str, default='default_backdoor', help='Payload type')
+ return parser
- args = parser.parse_args()
+def main(argv=None):
+ parser = build_parser()
+ args = parser.parse_args(argv)
if args.command == 'scan':
scan_vulns(args.target)
elif args.command == 'stress':
stress_test(args.target, args.port, args.threads, args.duration)
- elif args.command == 'exploit':
- exploit_chain(args.target, args.payload)
else:
- parser.print_help()
+ exploit_chain(args.target, args.payload)
+ return 0
if __name__ == "__main__":
- main()
+ raise SystemExit(main())
diff --git a/tests/test_terminal_pressure.py b/tests/test_terminal_pressure.py
new file mode 100644
index 0000000..df998c5
--- /dev/null
+++ b/tests/test_terminal_pressure.py
@@ -0,0 +1,38 @@
+import unittest
+from unittest.mock import patch
+
+import terminal_pressure
+
+
+class TerminalPressureCliTests(unittest.TestCase):
+ def test_stress_command_does_not_import_optional_modules(self):
+ with patch("terminal_pressure._load_optional_dependency", side_effect=AssertionError("unexpected import")), \
+ patch("terminal_pressure.stress_test") as stress_test:
+ result = terminal_pressure.main(
+ ["stress", "127.0.0.1", "--port", "8080", "--threads", "2", "--duration", "1"]
+ )
+
+ self.assertEqual(result, 0)
+ stress_test.assert_called_once_with("127.0.0.1", 8080, 2, 1)
+
+ def test_scan_reports_missing_python_nmap_dependency(self):
+ with patch("terminal_pressure.importlib.import_module", side_effect=ImportError("missing")):
+ with self.assertRaises(SystemExit) as exc:
+ terminal_pressure.scan_vulns("127.0.0.1")
+
+ self.assertIn("python-nmap", str(exc.exception))
+
+ def test_exploit_reports_missing_scapy_dependency(self):
+ with patch("terminal_pressure.importlib.import_module", side_effect=ImportError("missing")):
+ with self.assertRaises(SystemExit) as exc:
+ terminal_pressure.exploit_chain("127.0.0.1")
+
+ self.assertIn("scapy", str(exc.exception))
+
+ def test_positive_int_parser_rejects_zero(self):
+ with self.assertRaises(SystemExit):
+ terminal_pressure.main(["stress", "127.0.0.1", "--threads", "0"])
+
+
+if __name__ == "__main__":
+ unittest.main()