# DNS Shell | Tool to Compromise and Maintain control Over Victim Machine 🚪

**URL:** <https://onehack.st/t/dns-shell-tool-to-compromise-and-maintain-control-over-victim-machine/59632>\
**Category:** Tools & Scripts\
**Tags:** hacking, networking\
**Created:** [October 3, 2019, 1:44pm UTC](https://onehack.st/t/dns-shell-tool-to-compromise-and-maintain-control-over-victim-machine/59632 "2019-10-03T13:44:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheJoker](https://onehack.st/user_avatar/onehack.st/thejoker/32/22660_2.png) [@TheJoker](https://onehack.st/u/TheJoker)\
**Post date:** [October 3, 2019, 1:44pm UTC](https://onehack.st/t/dns-shell-tool-to-compromise-and-maintain-control-over-victim-machine/59632/1 "2019-10-03T13:44:51Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/7/b/7b8ba67ba625d18d79eba12112d59b793edebe72.jpeg)

# [https://github.com/sensepost/DNS-Shell](https://github.com/sensepost/DNS-Shell)

DNS protocol runs on the application layer of **TCP/IP Model**. When an attacker or pentester tries to exploit DNS with **RCE** vulnerability (Remote Command Execution) destination server acts as the backdoor.

DNS Shell Tool is python based exploitation tool to compromise and also maintaining the access via command and control to the server.

**Here we have used Kali Linux(Attacker Machine) and Victim Machine (Windows 10)**

## **ATTACKER MACHINE**

- Download the DNS SHELL tool from Github
- Execute the command: **python DNS-SHELL.py**

It can be utilized with different modes, **Recursive mode** (It will run the DNS name) and **Direct mode** will run as Ip address provided (Kali Linux IP)

## **Generating Payload – DNS Shell**

Recursive Command – **Python DNS-Shell.py -l -r**

Direct command – **Python DNS-Shell.py -l -d**

## **Victims Machine**

- Run & Execute the Command with **CMD** : **Powershell.exe -e** 

 ![image](https://onehack.st/uploads/default/original/3X/5/f/5f09a54f39330da6db542833800c112b9a837b0d.png)

## **BACK TO ATTACKERS MACHINE**

- Once the payload is executed in victims machine. Shell of Windows 10 machine is obtained.

 ![image](https://onehack.st/uploads/default/original/3X/6/8/68a705acfcc3ea8bdfa3bbb90c0a0a4d6462dc30.jpeg)

- Above Figure shows destination **(windows 10)** now acts as **backdoor** and command is entered and turns to Convert Channel to over port 53 of DNS.
