WINDOWS下烧一只鹅
Teensy++2.0的烧录
按理来说,应该在开篇介绍一下Teensy,也就是Badusb,但是我比较讨厌罗嗦,用东北话来说,干就行了!不明白的自己去百度,烧鹅的一个好处是:可以很简单就完成模拟鼠标和键盘操作。不过大部分人都是在Kali环境下操作的,我就简单介绍一下在WINDOWS下环境操作。
所需工具:
1.Teensy ++ 2.0
2.Teensyduino插件
3.arduino
之所以选择这个版本很简单,因为便宜!50块钱左右。
附上两个需要用的工具下载链接:
ARDUINO 1.8.5 : https://www.arduino.cc/en/Main/Software/
Teensyduino插件: http://www.pjrc.com/teensy/td_download.html
全部是WINDOWS版本的。
下面进入安装步骤
第一步是安装ARDUINO 1.8.5
选择I Agree,
选择NEXT
选择Install
然后开始进入安装
所有提示驱动设备安装的都要点安装
安装完成,点击close.
下面开始安装Teensyduino插件:
选择NEXT
选择Next
提示安装设备,点击安装
选择好arduino安装文件的位置点击Next,
全部选择,然后Next,
安装完成Done
具体操作来了
点击工具,选择Teensy++2.0,
来个简单试一下吧
void setup()
{
Serial.begin(9600); // USB is always 12 Mbit/sec
}
void loop()
{
Serial.println("Hello World...");
delay(1000); // do not print too fast!
}
点击勾的那个符号,编译一下,然后点板子上的黑色按钮.
提示就可以烧录了
再来个鼠标的例子吧 代码:
void setup() { } // no setup needed
void loop() {
int i;
for (i=0; i<40; i++) {
Mouse.move(2, -1);
delay(25);
}
for (i=0; i<40; i++) {
Mouse.move(2, 2);
delay(25);
}
for (i=0; i<40; i++) {
Mouse.move(-4, -1);
delay(25);
}
}
这里一定注意,选择USB类型
int myKeyBreak = 50;
void setup() {
delay(5000);
omg("cmd.exe");
delay(500);
Keyboard.println("color a&&cls");
delay(myKeyBreak);
ascii_println("echo Welcome to 07V8!");
delay(10000);
delay(myKeyBreak);
ascii_println("net user");
delay(myKeyBreak);
delay(10000);
ascii_println("echo Finish!");
delay(myKeyBreak);
delay(10000);
ascii_println("exit");
delay(myKeyBreak);
delay(10000);
}
void loop() {
}
void ascii_println(char *string)
{
ascii_type_this(string);
Keyboard.set_key1(KEY_ENTER);
Keyboard.send_now();
delay(100);
Keyboard.set_key1(0);
Keyboard.send_now();
delay(100);
}
void ascii_type_this(char *string)
{
int count, length;
length = strlen(string);
for(count = 0 ; count < length ; count++)
{
char a = string[count];
ascii_input(ascii_convert(a));
}
}
void ascii_input(char *string)
{
if (string == "000") return;
int count, length;
length = strlen(string);
Keyboard.set_modifier(MODIFIERKEY_ALT);
Keyboard.send_now();
for(count = 0 ; count < length ; count++)
{
char a = string[count];
if (a == '1') Keyboard.set_key1(KEYPAD_1);
if (a == '2') Keyboard.set_key1(KEYPAD_2);
if (a == '3') Keyboard.set_key1(KEYPAD_3);
if (a == '4') Keyboard.set_key1(KEYPAD_4);
if (a == '5') Keyboard.set_key1(KEYPAD_5);
if (a == '6') Keyboard.set_key1(KEYPAD_6);
if (a == '7') Keyboard.set_key1(KEYPAD_7);
if (a == '8') Keyboard.set_key1(KEYPAD_8);
if (a == '9') Keyboard.set_key1(KEYPAD_9);
if (a == '0') Keyboard.set_key1(KEYPAD_0);
Keyboard.send_now();
Keyboard.set_key1(0);
delay(11);
Keyboard.send_now();
}
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
}
char* ascii_convert(char string)
{
if (string == 'T') return "84";
if (string == ' ') return "32";
if (string == '!') return "33";
if (string == '\"') return "34";
if (string == '#') return "35";
if (string == '$') return "36";
if (string == '%') return "37";
if (string == '&') return "38";
if (string == '\'') return "39";
if (string == '(') return "40";
if (string == ')') return "41";
if (string == '*') return "42";
if (string == '+') return "43";
if (string == ',') return "44";
if (string == '-') return "45";
if (string == '.') return "46";
if (string == '/') return "47";
if (string == '0') return "48";
if (string == '1') return "49";
if (string == '2') return "50";
if (string == '3') return "51";
if (string == '4') return "52";
if (string == '5') return "53";
if (string == '6') return "54";
if (string == '7') return "55";
if (string == '8') return "56";
if (string == '9') return "57";
if (string == ':') return "58";
if (string == ';') return "59";
if (string == '<') return "60";
if (string == '=') return "61";
if (string == '>') return "62";
if (string == '?') return "63";
if (string == '@') return "64";
if (string == 'A') return "65";
if (string == 'B') return "66";
if (string == 'C') return "67";
if (string == 'D') return "68";
if (string == 'E') return "69";
if (string == 'F') return "70";
if (string == 'G') return "71";
if (string == 'H') return "72";
if (string == 'I') return "73";
if (string == 'J') return "74";
if (string == 'K') return "75";
if (string == 'L') return "76";
if (string == 'M') return "77";
if (string == 'N') return "78";
if (string == 'O') return "79";
if (string == 'P') return "80";
if (string == 'Q') return "81";
if (string == 'R') return "82";
if (string == 'S') return "83";
if (string == 'T') return "84";
if (string == 'U') return "85";
if (string == 'V') return "86";
if (string == 'W') return "87";
if (string == 'X') return "88";
if (string == 'Y') return "89";
if (string == 'Z') return "90";
if (string == '[') return "91";
if (string == '\\') return "92";
if (string == ']') return "93";
if (string == '^') return "94";
if (string == '_') return "95";
if (string == '`') return "96";
if (string == 'a') return "97";
if (string == 'b') return "98";
if (string == 'c') return "99";
if (string == 'd') return "100";
if (string == 'e') return "101";
if (string == 'f') return "102";
if (string == 'g') return "103";
if (string == 'h') return "104";
if (string == 'i') return "105";
if (string == 'j') return "106";
if (string == 'k') return "107";
if (string == 'l') return "108";
if (string == 'm') return "109";
if (string == 'n') return "110";
if (string == 'o') return "111";
if (string == 'p') return "112";
if (string == 'q') return "113";
if (string == 'r') return "114";
if (string == 's') return "115";
if (string == 't') return "116";
if (string == 'u') return "117";
if (string == 'v') return "118";
if (string == 'w') return "119";
if (string == 'x') return "120";
if (string == 'y') return "121";
if (string == 'z') return "122";
if (string == '{') return "123";
if (string == '|') return "124";
if (string == '}') return "125";
if (string == '~') return "126";
Keyboard.print(string);
return "000";
}
void release_keys()
{
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
delay(100);
}
void send_keys(byte key, byte modifier)
{
if(modifier)
Keyboard.set_modifier(modifier);
Keyboard.set_key1(key);
Keyboard.send_now();
delay(100);
release_keys();
}
void omg(char *SomeCommand)
{
Keyboard.set_modifier(128);
Keyboard.set_key1(KEY_R);
Keyboard.send_now();
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
delay(1500);
ascii_type_this(SomeCommand);
Keyboard.set_key1(KEY_ENTER);
Keyboard.send_now();
Keyboard.set_key1(0);
Keyboard.send_now();
}
这个是命令是干嘛的,你懂的!