Weil Jimmer's BlogWeil Jimmer's Blog


Month:December 2017

Found 1 records. Now is Page 1 / 1.

BadUSB 初體驗 Arduino Duckuino Hid Keyboard Attack
No Comments

發布:
更新:2017-12-24 19:36:21

最近不知道為啥,突然心血來潮一直想要來編譯 USB隨身碟,做一支 BadUSB,遺憾的是一直找不到目標型號的控制器(Controller)。後來搜尋,沒想到網路上竟然已經有賣類似功能的東西了!

BadUSB 顧名思義就是壞的 USB 碟,會執行一些程式碼,可能會讓電腦受損,而這類攻擊都是需要實體插入電腦裡面的,並且,防毒軟體有很大機率是掃描不到,程式碼都是在閃存控制器(Flash Memory Controller)裡面,除非很底層的軟體,否則幾乎是碰不到那區塊。

雖然一般隨身碟拿來修改的話,價格比較便宜,但是不太好操作,真正的 Rubbery Ducky 又太貴了,買不起。網路上的 Arduino 做成的微型控制器比較便宜一點。很久以前也有萌生用 Arduino 實作的想法,不過太醜了,就是一塊電路板,沒有殼,網路上找不太到賣殼的,而現在我找到的真的很精美,不是 MicroUSB 所以連轉接都不用,於是乎買來體驗一下。僅僅是測試,至於啥麼用途,可以自由發揮,例如:騙別人這是普通的隨身碟之類的,插上去就立刻變身成鍵盤執行惡意代碼。

上圖即是我網購的帶有 Arduino ATmega32U4 控制器的 USB,外觀就像正常的隨身碟,不是所有 Arduino 都可以當成鍵盤用,例如 Arduino Nano 就不行。

這樣一來就可以把 Arduino 當成 Rubbery Ducky 使用,直接實行 Hid Keyboard Attack。網路上已經有教學文章可以直接將 Rubbery Ducky 的程式碼 轉為 Arduino專用的程式碼。這樣就不太需要自己修改。

可以參考:https://github.com/Nurrl/Duckuino

DELAY 2000
GUI r
DELAY 100
SHIFT
STRING cmd
ENTER
DELAY 100
STRING shutdown -t 0 -y -s
ENTER

以上是我編譯的 Script Example,用途是立刻將電腦關機,當我實際運行時有遇到不少麻煩,好像開不了 Windows Key + R Key,最後解決方法是把

Keyboard.press("r"); 
換成
Keyboard.press('r');

就這個單雙引號害我 Debug 好久,加上 Delay 好像也沒用。覺得奇特。

運行結果如下方影片:

By Weil Jimmer


This entry was posted in Arduino, C, General, Experience, Functions, Note By Weil Jimmer.

 1 /1 頁)

Visitor Count

pop
nonenonenone

Note

重啟核四,關閉維修火力發電廠,減少空氣汙染,以核能養綠能。

支持網路中立性.
Support Net Neutrality.

Celebration for General Data Protection Regulation.

隨時注意自己的CPU使用狀態,有不少網站會沒有徵求同意就用您的電腦挖礦。

不用 Line 改用 Telegram。跟上最新潮流。

支持臺灣實施無條件基本收入

歡迎前來本站。

Words Quiz


Search

Music

Counter

2301
天前是本網站的生日

Republic Of China
The strong do what they can and the weak suffer what they must.

Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1NRMVGGpm2T1pmeejisLSEhCXfCefEW9V4
paypal
Register in linode via invitation link and stay active for three months.Linode

The Lie We Live

The Lie We Live

The Questions We Never Ask

The Questions We Never Ask

Support The Zeitgeist Movement

The Zeitgeist Movement

Man

Man

In The Fall

In The Fall

Facebook is EATING the Internet

Facebook

Categories

Android (7)

Announcement (4)

Arduino (2)

Bash (2)

C (3)

C# (5)

C++ (1)

Experience (42)

Flash (2)

Free (13)

Functions (36)

Games (13)

General (50)

HTML (7)

Java (13)

JS (7)

Mood (24)

Note (28)

Office (1)

PHP (9)

Privacy (4)

Product (12)

Python (4)

Software (11)

The Internet (16)

Tools (14)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)