当前位置:网站首页>Intranet penetration series: dns2tcp of Intranet tunnel
Intranet penetration series: dns2tcp of Intranet tunnel
2022-04-23 08:01:00 【Fish in Siyuan Lake】
Preface
This paper studies DNS A tool for tunnels ,dns2tcp
github:https://github.com/alex-sector/dns2tcp
One 、 summary
1、 brief introduction
Last updated on 2017 year ,C Language writing
TCP over DNS, That is, through DNS Tunnel forwarding TCP Connect , No encryption . Direct connection is adopted , But the speed is not particularly optimistic , Advantage lies in kali Directly integrated with this tool , part linux Distributions can also be downloaded directly through the package tool , Relatively convenient
- Use legal DNS Server implementation DNS Tunnel
- C/S(dns2tcpc / dns2tcpd) structure
- Default by TXT Record encryption (base64) To transmit data (A Limited record length )
- Keep the connection after the tunnel is built , Probably 0.6s Send a packet , The biggest is 3s You can set
- Need to cooperate with other agent tools
2、 principle
DNS See the principle in : One article makes it clear DNS Domain name resolution
This tool is to put data in TXT In the record base64 Transmit after encryption ,DNS The packet passes through the authority DNS Provided by the server NS Record and A Record to the server DNS The server , Complete the traffic agent
3、 usage
Common commands :
-c Large flow compression
-F The front desk operation
-f Specify profile
-r Specify the resources to use
-z Appoint DNS domain name
-k Set the transmission password
-l Listen on local port
-d Compilation level (1 | 2 |3 )
(1) Server side
modify /etc/dns2tcpd.conf The configuration file
Build a tunnel dns2tcpd -F -d 1 -f /etc/dns2tcpd.conf
(2) client
Test whether it can be connected :dns2tcpc -z xxx.xx.xxx
Build a tunnel to use ssh service :dns2tcpc -c -k password -d 1 -l 7002 -r ssh -z xxx.xx.xxx
Then throw the corresponding service into the locally set port
Two 、 practice
1、 Test scenarios
(1) attack
Kali2021 192.168.10.128
(2)DNS The server
windows server 2008 :192.168.10.200
Set static IP, See https://blog.csdn.net/pockeyfan/article/details/42063683
newly build A Record , Point to the server kali

Create a new delegate ( namely NS Record ) Point to the just set A Recorded domain name

Build another one A The record points to windows server own

(3) Target machine
Ubuntu 18.04 192.168.10.129
Because the simulation is DNS The server is the real authoritative server , That is, the target should be able to DNS Resolved to DNS The server , So we should take the target plane's DNS Analytical change

nslookup Check out

2、 Build a tunnel
(1) Server side
start-up apache service

Modify the configuration file

After modification

Start listening

(2) client
Test whether it can be connected

start-up

Then you can visit http service

Similar ones ssh、nc、smtp And other agency methods can be represented through the tunnel
notes :ssh Occasionally prompt reset peer, Maybe try a few more times
3、 Grab the bag and have a look
handshake phase

Heartbeat bag , All serious domain names

When using the tunnel , A lot of TXT Record pack , Content base64 After encryption, put it in the domain name

3、 ... and 、 Explore
1、 Source code and Analysis
TODO
2、 Detection and bypass
(1) abnormal DNS Number of packets
As shown in the figure above , Using DNS Tunnel time ,1s There will be close 200 individual DNS package , And they all come from the same DNS The server
Bypass method : Add interval in the middle , But this will lead to very slow speed
(2) Special record type TXT
Usually only mail servers / The gateway will send TXT Record , And there won't be so many , natural DNS In network traffic ,TXT The proportion of records may be only 1%-2%
The way around : A mixture of A、AAAA、TXT、MX、CNAME Etc
(3) Abnormal domain name
There are similar in the domain name base64 String , It can be detected by information entropy and other methods
The way around : Maintain a common domain name dictionary , And then split , But this will greatly increase the number of packets
For example, now we need to put a file name finalexamanswer.doc Spread it out
base64 once -> ZmluYWxleGFtYW5zd2VyLmRvYw
Then code the common domain name , become Zm -> zone.music.domain,lu -> login.user.domain,YW``yun.web.domain …
(4) Heartbeat bag
The interval and number of heartbeat packets are problems
Bypass method : The interval can be lengthened , Even random , The quantity can be changed UDP socket Rebuild the tunnel
(5) Command characteristics
Some characteristic strings of the command
Bypass method : Change the string
Conclusion
Heartbeat packet is a request for normal domain name, which is very good , But there is still room for improvement
版权声明
本文为[Fish in Siyuan Lake]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230628265645.html
边栏推荐
- 内网渗透系列:内网隧道之dns2tcp
- C#控制相机,旋转,拖拽观察脚本(类似Scenes观察方式)
- BUUCTF MISC刷題
- SAP GUI security
- Redis--为什么字符串emstr的字符串长度是44字节上限?
- 05 use of array
- 【Unity VFX】VFX特效入门笔记-火花制作
- CTF攻防世界刷题51-
- Simplify exporting to SVG data files and all images in SVG folder
- Using lambda expression to solve the problem of C file name sorting (whether it is 100 or 11)
猜你喜欢

Research on software security based on NLP (I)

SAP tr manual import system operation manual

Feign源码分析

Chapter V investment real estate

Internal network security attack and defense: a practical guide to penetration testing (8): Authority maintenance analysis and defense

Unity get real geographic map application terrain notes

【编程实践/嵌入式比赛】嵌入式比赛学习记录(一):TCP服务器和web界面的建立

《内网安全攻防:渗透测试实战指南》读书笔记(五):域内横向移动分析及防御

Zhuang understand's TA notes (VI) < fakeenvreflect & rust, rust effect >

Plane definition - plane equation
随机推荐
内网渗透系列:内网隧道之icmp_tran
Post of experience in preparation for guarantee and research -- the 18th (2021) Central South planning department promoted the exemption to Zhejiang University Institute of Technology
读取修改resource文件夹下的json文件
Internal network security attack and defense: a practical guide to penetration testing (IV): Authority improvement analysis and defense
Houdini流体>>粒子流体导出到unity笔记
Zhuang understand's TA notes (VI) < fakeenvreflect & rust, rust effect >
Ribbon启动流程
IDEA快捷键
SAP自建表log功能开启
strcat()、strcpy()、strcmp()、strlen()
A series of articles, a summary of common vulnerabilities of Web penetration (continuously updated)
一些关于网络安全的好教程或笔记的链接,记录一下
About unity to obtain links related to the transformation of real geographic maps into 3D
Complete learning from scratch, machine learning and deep learning, including theory and code implementation, mainly using scikit and mxnet, and some practices (on kaggle)
【问题解决】VS2019解决编译生成的exe文件打不开的情况
SAP tr manual import system operation manual
从ES、MongoDB、Redis、RocketMQ出发谈分布式存储
VBA calls SAP RFC to read & write data
SAP GUI安全性
Personality charm of high paid it workers