SOCKS - Socket Secure ====================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is SOCKS?** SOCKS stands for Socket Secure. It is a network protocol that routes network packets between a client and a server through a proxy server, allowing applications to bypass firewalls, hide IP addresses, or access restricted content. Unlike HTTP proxies, SOCKS is protocol-agnostic and works at a lower level. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is SOCKS useful?** * Supports any type of traffic (HTTP, FTP, SMTP, etc.) * Works with TCP and UDP * Doesn’t interpret or modify the data being transferred * Helps with anonymity, firewall traversal, and geo-unblocking .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How it works?** * **Client connects to SOCKS server** – The application is configured to use a SOCKS proxy. * **SOCKS server establishes connection** – It opens a connection to the target server on behalf of the client. * **Data is relayed** – The SOCKS server forwards data between the client and the destination without inspecting it. * **Connection ends** – Once the session is complete, the proxy closes the connection. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is SOCKS used?** * Torrenting and P2P apps – For anonymous and unrestricted access * Bypassing censorship – In restricted networks or countries * Gaming – To reduce latency or access region-locked servers * Secure tunneling – Often used with SSH for encrypted proxying .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why OSI Layer: Session Layer (Layer 5)?** * It manages sessions between applications across networks * It is protocol-independent, unlike HTTP proxies * It establishes and maintains end-to-end connections for any type of traffic .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`SOCKS Version&RFC Details ` * :ref:`SOCKS Basic Setup on Ubuntu using IPv4 ` * :ref:`SOCKS Basic Setup on Ubuntu using IPv6 ` * :ref:`SOCKS Protocol Packet Details ` * :ref:`SOCKS Usecases ` * :ref:`SOCKS Basic Features ` * :ref:`SOCKS Feature : Protocol Agnostic ` * :ref:`SOCKS Feature : Supports TCP and UDP ` * :ref:`SOCKS Feature : Authentication support ` * :ref:`SOCKS Feature : IP Address Hiding ` * :ref:`SOCKS Feature : firewall traversal ` * :ref:`SOCKS Feature : Domain Name Resolution ` * :ref:`SOCKS Feature : No Content Inspection ` * :ref:`SOCKS Feature : IPv6 support ` * :ref:`SOCKS Feature : Flexible Application Use ` * :ref:`SOCKS Feature : Lightweight and fast ` * :ref:`Reference links ` .. _SOCKS_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _SOCKS_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _SOCKS_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _SOCKS_step5: .. tab-set:: .. tab-item:: SOCKS Version&RFC Details .. csv-table:: :file: ./SOCKS/SOCKS_rfcdetails.csv :widths: 10,10,10,30 :header-rows: 1 .. _SOCKS_step19: .. tab-set:: .. tab-item:: SOCKS Basic Setup on Ubuntu using IPv4 * setup .. _SOCKS_step20: .. tab-set:: .. tab-item:: SOCKS Basic Setup on Ubuntu using IPv6 * setup .. _SOCKS_step6: .. tab-set:: .. tab-item:: SOCKS Protocol Packet Details **Client Greeting Packet** .. csv-table:: :file: ./SOCKS/SOCKS_packetdetails1.csv :widths: 10,20,30,10 :header-rows: 1 **Server Method Selection Packet** .. csv-table:: :file: ./SOCKS/SOCKS_packetdetails2.csv :widths: 10,20,30,10 :header-rows: 1 **Authentication(if required) Packet** .. csv-table:: :file: ./SOCKS/SOCKS_packetdetails3.csv :widths: 10,20,30,10 :header-rows: 1 **Client Connection Request Packet** .. csv-table:: :file: ./SOCKS/SOCKS_packetdetails4.csv :widths: 10,20,30,10 :header-rows: 1 **Server Connection Reply Packet** .. csv-table:: :file: ./SOCKS/SOCKS_packetdetails5.csv :widths: 10,20,30,10 :header-rows: 1 **Data Transfer Packet** .. csv-table:: :file: ./SOCKS/SOCKS_packetdetails6.csv :widths: 10,20,30,10 :header-rows: 1 .. _SOCKS_step7: .. tab-set:: .. tab-item:: SOCKS Usecases .. csv-table:: :file: ./SOCKS/SOCKS_usecases.csv :widths: 10,20,30 :header-rows: 1 .. _SOCKS_step8: .. tab-set:: .. tab-item:: SOCKS Basic Features .. csv-table:: :file: ./SOCKS/SOCKS_basicfeatures.csv :widths: 10,10,30 :header-rows: 1 .. _SOCKS_step9: .. tab-set:: .. tab-item:: SOCKS Feature : Protocol Agnostic **Protocol Agnostic - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature1_Protocol_Agnostic.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step10: .. tab-set:: .. tab-item:: SOCKS Feature : Supports TCP and UDP **Supports TCP and UDP - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature2_Supports_TCP_and_UDP.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step11: .. tab-set:: .. tab-item:: SOCKS Feature : Authentication support **Authentication support - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature3_Authentication_support.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step12: .. tab-set:: .. tab-item:: SOCKS Feature : IP Address Hiding **IP Address Hiding - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature4_IP_Address_Hiding.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step13: .. tab-set:: .. tab-item:: SOCKS Feature : firewall traversal **firewall traversal - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature5_firewall_traversal.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step14: .. tab-set:: .. tab-item:: SOCKS Feature : Domain Name Resolution **Domain Name Resolution - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature6_Domain_Name_Resolution.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step15: .. tab-set:: .. tab-item:: SOCKS Feature : No Content Inspection **No Content Inspection - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature7_No_Content_Inspection.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step16: .. tab-set:: .. tab-item:: SOCKS Feature : IPv6 support **IPv6 support - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature8_IPv6_support.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step17: .. tab-set:: .. tab-item:: SOCKS Feature : Flexible Application Use **Flexible Application Use - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature9_Flexible_Application_Use.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step21: .. tab-set:: .. tab-item:: SOCKS Feature : Lightweight and fast **Lightweight and fast - Testcases** .. csv-table:: :file: ./SOCKS/SOCKS_feature10_Lightweight_and_fast.csv :widths: 10,10,30,20 :header-rows: 1 .. _SOCKS_step18: .. tab-set:: .. tab-item:: Reference links * Reference links