#!/usr/bin/env python3
import socket, ssl, threading
from cryptography.fernet import Fernet
from hashlib import sha256
class SecureTunnel:
def __init__(self, target, port=443):
self.target = target
self.port = port
self.key = Fernet.generate_key()
self.cipher = Fernet(self.key)
self.ctx = ssl.create_default_context()
def establish(self):
sock = socket.socket(socket.AF_INET)
wrapped = self.ctx.wrap_socket(sock)
wrapped.connect((self.target, self.port))
return self._handshake(wrapped)
def _handshake(self, conn):
token = sha256(self.key).hexdigest()
conn.send(token.encode())
resp = conn.recv(4096)
return self.cipher.decrypt(resp)
def scan_network(subnet, ports=[22,80,443]):
hosts = []
for host in ipaddress.IPv4Network(subnet):
for port in ports:
try:
s = socket.socket()
s.settimeout(0.5)
s.connect((str(host), port))
hosts.append((str(host), port))
except: pass
return hosts
if __name__ == "__main__":
tunnel = SecureTunnel("10.0.0.1")
tunnel.establish()
results = scan_network("192.168.1.0/24")
for host, port in results:
print(f"[+] {host}:{port}")
logging.info("Scan complete")Real-world terminal labs. Zero fluff.
Become a certified industry professional.
Hands-on Linux & Windows terminal practice
Real-time skill metrics and heatmaps
Compete with top security researchers
Industry-recognized proof of expertise
Master the basics of monitoring, detection, and incident response.
45 Modules
Join the world's most elite learning community today.
INITIALIZE SECURE LOGIN