joelsernamoreno / EvilCrowCable-Pro

Evil Crow Cable Pro device
Creative Commons Attribution 4.0 International
82 stars 4 forks source link

How to deal with strings of symbol and other special characters like unicode? #2

Open andizaa opened 5 days ago

andizaa commented 5 days ago

When writing payload of strings, it seems it can not read characters like : ; ( ) " '' and $ how to write those strings and how to escape it?

joelsernamoreno commented 5 days ago

Hello

What keyboard layout do you have?

Have you configured this on the device?

andizaa commented 5 days ago

I have configured the cable and it works well for ascii strings and numbers, but it gives wrong typing of symbols like : ; ( ) " '' and $. For example I go to cmd to type: msg Hello then the cable write this: msg } Hello It types * with } It's US Keyboard as in this file: EvilCrowCable-Pro\libraries\USBCrowKeyboard\USBCrowKeyboard\USBCrowKeyboard.cpp

define US_KEYBOARD

joelsernamoreno commented 5 days ago

And your computer is configured with the EN_US layout?

andizaa commented 5 days ago

Yes my computer is EN_US layout. But the weird part is when payload is to open notepad those strings works well : !@#$%^&():<> But only in cmd and powershell, those strings are converted to something else. Please try yourself, open cmd, and type: msg Hello That will be converted to } Even when I modify cmd to: start msg Hello --> it still converted to: start msg } Hello --> which doesnt run the message box But the weird part is I then type in cmd: msg Hello --> it's converted to: msg } Hello --> the shows at the end but not after "msg" and in powershell the $var will be converted to >var

andizaa commented 5 days ago

and also in cmd this prompt: curl https://google.com --> becomes: curl https>&&google.com --> which makes curl not working

joelsernamoreno commented 4 days ago

I have tested your error now, these are my results:

payload

layout-library

layout notepad cmd powershell

It seems that there is no problem here

andizaa commented 4 days ago

as I said, if you open notepad or cmd and directly type !@#$%^&*()_+{}:"<>?[]; That will work just fine. But try put that symbol into arguments, for example in cmd, type: curl https://google.com ----> this will write: curl https>&&google.com (that's weird)

joelsernamoreno commented 4 days ago

Write your payload here and I will test this

andizaa commented 4 days ago

include "exfil.h"

include "phukd.h"

void payload() { delay(2300); Keyboard.press(KEY_LEFT_GUI); Keyboard.press('r'); delay(100); Keyboard.releaseAll(); delay(500); Keyboard.print("cmd"); delay(500); Keyboard.press(KEY_RETURN); delay(100); Keyboard.releaseAll(); delay(1500); Keyboard.print("curl https://google.com"); Keyboard.press(KEY_RETURN); delay(100); Keyboard.releaseAll(); delay(300); Keyboard.print("msg * Hello Friend!"); Keyboard.press(KEY_RETURN); delay(100); Keyboard.releaseAll(); }

Both cmd prompts are not working. The * is replaced with } and the : and // is replaced with > and &&

andizaa commented 4 days ago

image

This is what shows in my cmd

joelsernamoreno commented 4 days ago

I have copied your code and have no problem with this:

exec
joelsernamoreno commented 4 days ago

Check my video:

https://github.com/user-attachments/assets/490e239e-171e-4a6b-9aca-efe176f49d9d

andizaa commented 4 days ago

ah, so what's the problem then? I use US Keyboard. What keyboard do you use? I already tried ES, US, UK, all the same gives wrong character (in cmd argument). Also in powershell the string $ and : is converted to something else. But when I type in notepad, the symbol works just fine.

joelsernamoreno commented 4 days ago

My Windows 11 is configured with U.S. English layout

Evil Crow Cable Pro is configured with US layout

Can you try this on another computer or increase the delays in the payload?

andizaa commented 4 days ago

https://github.com/user-attachments/assets/fa8a832b-06d5-49f2-ac33-9a0db65c3f6c

I already tried in 3 computers, all the same. As you can see with my payload above this shows different characters in the cmd. Is it the hardware? I bought it from alixpress

andizaa commented 4 days ago

image

Also tried the US Layout ascii map with this payload: Keyboard.print("msg "); Keyboard.print(0x33); Keyboard.press(KEY_LEFT_SHIFT); Keyboard.press(0x33); Keyboard.write(0x33); delay(200); Keyboard.releaseAll();

But all that doesnt show the symbol * Instead it shows following symbol: image