当前位置:网站首页>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
边栏推荐
- Dictionary & lt; T1,T2> Sorting problem
- CTF-MISC学习之从开始到放弃
- 内网渗透系列:内网隧道之icmptunnel(jamesbarlow师傅的)
- sentinel集成nacos动态更新数据原理
- C problem of marking the position of polygons surrounded by multiple rectangles
- KCD_EXCEL_OLE_TO_INT_CONVERT报错SY-subrc = 2
- 读取修改resource文件夹下的json文件
- The projection vector of a vector to a plane
- 一文了解系列,对web渗透的常见漏洞总结(持续更新)
- Index locked data cannot be written to es problem handling
猜你喜欢
About USB flash drive data prompt raw, need to format, data recovery notes
How does Apache Hudi accelerate traditional batch mode?
MySQL--锁的奥秘--数据怎么锁
SAP GUI安全性
C # control the camera, rotate and drag the observation script (similar to scenes observation mode)
第七章 资产减值
Intranet penetration series: icmptunnel of Intranet tunnel (by master dhavalkapil)
Protobuf use
BUUCTF MISC刷題
Plane definition - plane equation
随机推荐
Using lambda expression to solve the problem of C file name sorting (whether it is 100 or 11)
Chapter IV intangible assets
Série de pénétration Intranet: icmpsh du tunnel Intranet
读书笔记
VBA调用SAP RFC实现数据读取&写入
webflux文件上传下载
About unity to obtain links related to the transformation of real geographic maps into 3D
MySQL8. 0 installation / uninstallation tutorial [window10 version]
每天工作4小时的程序员
SQL user-defined scalar value function that looks up relevant column values n times forward or backward according to a specified table name, column name and column value
How does Apache Hudi accelerate traditional batch mode?
The projection vector of a vector to a plane
IT高薪者所具备的人格魅力
TA notes of Zhuang understand (VII) < Lambert + Phong + shadow + 3evcolor + Ao >
KCD_ EXCEL_ OLE_ TO_ INT_ Convert reports an error sy subrc = 2
03use of scanner class (console input)
Unity gets a resource that is referenced by those resources
Redis -- why is the string length of string emstr the upper limit of 44 bytes?
一些关于网络安全的好教程或笔记的链接,记录一下
內網滲透系列:內網隧道之icmpsh