Hacking Out of a Network - Computerphile
Key Moments
Learn how to bypass network restrictions using SSH tunneling, proxies, and DNS. Warning: illegal and risky.
Key Insights
Network administrators implement firewalls to block access to certain websites or services.
SSH tunneling can be used to create secure connections and bypass port restrictions.
SOCKS proxies, configured via SSH tunnels, can reroute traffic to circumvent firewalls.
Using TCP over TCP can cause performance issues; tools like sTunnel wrap tunneling more effectively.
Changing SSH's default port or using web proxies can further bypass restrictions.
Tunneling over DNS (e.g., using Iodine) offers another stealthy method to exfiltrate data.
Attempting to bypass network security is illegal and highly risky, often triggering alarms.
Security professionals can detect unusual, long-lived connections typical of tunneling.
Constantly being lucky to avoid detection is statistically improbable.
Even with sophisticated tunneling, network monitoring can lead to quick detection.
UNDERSTANDING NETWORK RESTRICTIONS AND BLOCKING RULES
This video explores methods to bypass network restrictions, often implemented by administrators using firewalls. These firewalls can block access based on specific websites, ports, or services. For example, a network administrator might block YouTube to conserve bandwidth on a train or in an airport. Blocking can target IP addresses, ports like 80 for HTTP or 443 for HTTPS, or specific services like email or SSH, thereby controlling network access and preventing unauthorized usage.
SSH TUNNELING FOR BENDING RULES
One primary method to circumvent network restrictions is through Secure Shell (SSH) tunneling. While SSH is typically used for secure remote login and file transfer, it can also be leveraged to create tunnels. By configuring an SSH command to listen on a local port and forward traffic down the secure connection to a remote server, users can effectively bypass blocked ports. This creates a virtual tunnel, allowing traffic intended for blocked services to be rerouted through the allowed SSH connection.
UTILIZING PROXIES VIA SSH TUNNELS
SSH tunnels can be further utilized to set up proxy servers, such as SOCKS proxies. By directing local traffic to a specific port (e.g., 1080) on the local machine, this traffic is then tunneled through SSH and emerges on the remote server. This allows the user's entire machine or web browser to use this tunnelled connection as a proxy, making it appear as though the traffic is originating from the remote server, thereby bypassing local network restrictions. However, TCP over TCP, used in this method, can lead to performance issues.
IMPROVED TUNNELING WITH S HUTTLE AND PORT REDIRECTION
To address the inefficiency of TCP over TCP, tools like sTunnel are introduced. S Tunnel offers a more robust and convenient way to manage tunneling, handling the underlying protocols more effectively. Additionally, if an administrator blocks the default SSH port (22), one can reconfigure SSH to run on an alternative port. If even that proves difficult, a server you control can be instructed to act as an SSH server on a non-standard port, allowing SSH connections even when the standard port is blocked.
WEB PROXIES AND NETCAT FOR ADVANCED BYPASSES
In highly secured environments where only specific exit points like web proxies are allowed, advanced techniques are required. The netcat command is highlighted as a versatile tool for network testing and establishing generic connections. By using a web proxy and clever port redirection, for instance, mapping traffic arriving on port 443 back to port 22, an SSH connection can be established. This allows for tunneled access even when the administrator has strictly limited outbound connections to a web proxy.
DNS TUNNELING AND OTHER EXFILTRATION METHODS
Domain Name Service (DNS) tunneling presents another sophisticated method to exfiltrate data or establish covert channels. Systems like Iodine exploit the DNS protocol, which is rarely blocked, to transmit data. By using subdomains or specially crafted DNS requests, data can be embedded and transmitted to a controlled DNS server. Other methods, like embedding data within ICMP (ping) packets, demonstrate the wide array of techniques available for network traffic manipulation and data exfiltration.
SIGNIFICANT RISKS AND DETECTION VULNERABILITIES
Despite the ingenuity of these techniques, attempting to bypass network security is highly illegal and carries significant risks. In corporate or restricted environments, administrators often employ sophisticated monitoring systems. Long-lived connections, typical of tunneling, are immediately suspicious and can trigger alarms. Endpoint monitoring and intrusion detection systems are designed to identify unusual traffic patterns and unauthorized software installations, such as sTunnel.
THE PROBABILITY OF DETECTION
Security professionals emphasize that while one might occasionally evade detection, the probability of remaining undetected over time is extremely low. The analogy of needing to be lucky every time versus an administrator only needing to be lucky once to catch an intruder highlights this disparity. Security measures are constantly evolving, and persistent attempts to bypass them are likely to be discovered, leading to severe consequences.
Mentioned in This Episode
●Software & Apps
●Companies
●Concepts
Network Tunneling: The Dos and Don'ts
Practical takeaways from this episode
Do This
Avoid This
Common Questions
You can bypass network restrictions by using techniques like SSH tunneling. This involves creating an encrypted connection to a server outside the restricted network, which then forwards your traffic, making it appear as legitimate SSH traffic.
Topics
Mentioned in this video
A versatile networking utility used for reading from and writing to network connections using TCP or UDP. It's described as a generic way to listen on ports, test connections, and facilitate tunneling.
A firewall command-line tool for Linux systems, used here to demonstrate blocking specific ports and IP addresses.
A target machine used in the demonstration with a test web page, serving as the endpoint for network access attempts.
A remote server used throughout the demonstration as an intermediary or target for SSH connections and tunneling.
More from Computerphile
View all 82 summaries
21 minVector Search with LLMs- Computerphile
15 minCoding a Guitar Sound in C - Computerphile
13 minCyclic Redundancy Check (CRC) - Computerphile
13 minBad Bot Problem - Computerphile
Found this useful? Build your knowledge library
Get AI-powered summaries of any YouTube video, podcast, or article in seconds. Save them to your personal pods and access them anytime.
Try Summify free