spacehuhn / wifi_ducky

Upload, save and run keystroke injection payloads with an ESP8266 + ATMEGA32U4
MIT License
1.26k stars 295 forks source link

Has anyone been able to get the all in one boards from aliexpress to work? #91

Open samr28 opened 6 years ago

samr28 commented 6 years ago

I purchased this board: https://www.aliexpress.com/item/ATMEGA32U4-ESP8266-ESP-12E-ESP12E-Badusb-TF-Micro-SD-Virtual-Keyboard-Development-Board-for-Arduino/32839674193.html?spm=a2g0s.9042311.0.0.R4hbkG

My computer picks it up as an arduino leonardo. So I uploaded the code that allows you to flash the esp board (https://gist.github.com/spacehuhn/b2b7d897550bc07b26da8464fa7f4b36.) Then I tried to use nodemcu to flash it but got the following errors:

Note:Detect serial port changed.
Note:Auto MAP serial port.Port-->COM7

Error:Serial port connect failed, please check it.

Has anyone else been able to get this board or one similar to it working? The bottom says CJMCU-3212 if that helps.

wilson289296 commented 6 years ago

I'd like to know this as well, I haven't been able to get the nodemcu flasher to detect my mac address. I'm a bit concerned as most of the tutorials say the gpio pin is supposed to be disconnected after flashing so it doesn't enter flash mode, but it seems all the pins are permanently soldered on this AIO board. I also haven't been able to find any tutorials involving these aliexpress boards.

terrabitz commented 6 years ago

There is just one tutorial that I have found for this, but it is entirely in Chinese: https://www.bilibili.com/video/av22645681. If anyone understands it, I would love to figure this out as well. I've been trying to flash just the ESP8266 using a USB-to-TTL device, but haven't had any luck. According to the video, the 4 pins on the right-most side under the "CJMCU" label are Rx, Tx, Vcc, and GND respectively. I've been connecting to those four and then connecting the two circles on the top left, which I presume is to pull CH_PD up. I've been staring at this board for hours, and still haven't been able to make much progress. I'll probably try and pull the board apart once I get some better soldering equipment.

wilson289296 commented 6 years ago

As luck would have it, I speak mandarin. I've watched the video and I think I have the steps down. I'll try to get my hands on that adapter he mentioned and I'll see if it works. In short, though (not having verified my understanding), you grab that adapter, match the holes on the 3212 board to the terminations on the adapter, plug both the badusb and the adapter into your computer, use arduino ide to flash it. But during the entire time you do so, you need to make sure you connect the two silver metallic circles on the upper right side of the TOP of board (this grounds the "firmware flash" pin on the 8266, telling the 8266 that it's supposed to be in fw flashing mode) and hold the white button on the board for the entire duration of the flash. He didn't mention what he used, but I'm assuming it's just the standard nodemcu flasher according to this project's documentation. See if you guys can work it out; if you need more translated details, let me know and I'll give line by line translation. Good luck to all!

samr28 commented 6 years ago

So I was able to get the esp flasher uploaded to the arduino with program_pin and enable_pin at the defaults (program: 12 & enable 13). I then connected the two metal circles on the board, pressed the reset button and while still connecting the metal circles, I tried to flash with nodemcu. It looked promising at the beginning but after waiting a few minutes, I gave up and checked the logs. When I hold down the white button, the device turns off so I don't think that part is right. Maybe you need to press it at a specific time?

Logs:

Note:Serial port disconnected.
Warning:Serial port closed by user.
Note:Detect serial port changed.
Note:Auto MAP serial port.Port-->COM7
pjaakko commented 6 years ago

It's nice to find out, that I'm not only one trying to solve the mystery of this CJMCU-3212 badusb device :-)

Has anyone managed to figure out how to use the default firmware? When I powered the device, it creates WLAN AP with SSID "AI-THINKER_" without password. ESP assigns IP address from 192.168.4.0/24 network but there isn't http server or anything running.

samr28 commented 6 years ago

Mine is the same as @pjaakko. I think we need to figure out how to flash the ESP to get the http server running. From what I understand, to do this, we need to get the leonardo to run the flasher arduino sketch which basically just forwards everything to the ESP board. Then we can put the real arduino sketch on it and we should be good.

I also tried an IP scanner to see if it was just running on a different ip or something but I didn't find anything running so I think the http server is just not running.

Maybe @wilson289296 can re check the video to see what exactly we should be doing for flashing. I tried connecting the two metallic circles but when I press and hold the button (which appears to be a reset button), the device will not turn on. So maybe it was some sort of miscommunication or translation error? I'm not quite sure.

wilson289296 commented 6 years ago

I'll try to get a line-by-line translation of the video done by the end of this week, sorry for the slow progress.

SmartContractsAgency commented 6 years ago

@wilson289296 thank you we are waiting)

I hoped that we can flash esp without any additional adapters.

also I think that we can check number of pins connected to esp and atmega program_pin and enable_pin

maybe it is not 12/13 can we check with multimeter?

pjaakko commented 6 years ago

We seems to be more or less stuck here. Is there any other community, forum or such to discuss about this aliexpress device?

puckk commented 5 years ago

@wilson289296 some news?

samr28 commented 5 years ago

I went through that video again and found some info on the pins: https://i.imgur.com/MgTCnhV.jpg. But other than that, no progress :(

ghost commented 5 years ago

Hello guys, im new at this tread. So do we have anything new? @wilson289296 did you translated the video?

ghost commented 5 years ago

Iam trying to get contact with the video creator at bilibili.

ghost commented 5 years ago

For god sake!!!. I can't send a message to the bilibili guy cus i don't have level in the plataform.

ghost commented 5 years ago

Anyone, try to contact this guy, https://space.bilibili.com/39602674/#/, he is creator of the only vídeo in the world explaning how to configure the CJMCU-3212. I don't know how do i get this "trustness level" to contact someone at bilibili.

puckk commented 5 years ago

Hi, I was able to make it work! I made a guide for you

https://github.com/puckk/CJMCU-3212

ghost commented 5 years ago

i lv you man

AieCaPique commented 5 years ago

Hello Thank you puckk for your tutorial :) It works great for me with the flash version for windows Can you get the micro SD slot to work?

puckk commented 5 years ago

Yes, the SD card worked with the examples of the Arduino IDE.

AieCaPique commented 5 years ago

Puckk could you add to your tutorial the method to operate the SD slot ? thank you very much

FietsenRijder commented 5 years ago

Hello, I'm planning on buying one of these. Would you recommend them? And @Puckk thanks already for your tutorial, but is there a way on looping the two circles without that special wire or can you just do it with something else? Thank you

samr28 commented 5 years ago

@FietsenRijder You should just need to short those two pads together. Any object that conducts electricity (like a paperclip) should work.

FietsenRijder commented 5 years ago

@samr28 Thanks for your quick respond do you recommend it and does it work? @puckk @ AieCaPique

AieCaPique commented 5 years ago

yes for me it works very well I just need to make conf for the micro SD is supported

FietsenRijder commented 5 years ago

@puckk So the thing is delivered but I don't understand how to flash it I did step 1 of your tutorial and when i plug the usb in a red light on top turns on but I don't understand step 2. First how to install esptool? And what to do then i'm new so can you be a little more specific? Thank You

samr28 commented 5 years ago

@FietsenRijder What OS is your computer? You need to install python and then follow the instructions here: https://github.com/espressif/esptool#installation--dependencies

FietsenRijder commented 5 years ago

@samr28 I'm running the latest windows 10. I do not understand how to install. @AieCaPique @puckk What sd card are you using and does te 6 pin thing that comes with it work to bridge? And @puckk do you have to bridge first and then plug in or how did you do that, I do not understand it at all.

Please help me

FietsenRijder

riogesulgon commented 5 years ago

Hi, Please help to troubleshoot the steps I am using. There seems to be something I am missing.

  1. I have uploaded step1.ino using the Leonardo board. It seems that the program is setting the following pins:
  1. Removed the device from usb socket and soldered wires to the top two right pads so i can easily join and remove the ends of the wires.
  2. Joined the wires and inserted the device into the usb port and ran the command. However I am getting the following error message:
esptool.py.exe --trace   --baud 115200 --port COM9 write_flash 0x00000 /dev/esp8266_wifi_duck_4mb.bin --flash_size 4MB --flash_mode dio --flash_freq 40m
esptool.py v2.5.0
Serial port COM9
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes:
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.103 Timed out waiting for packet header
.TRACE +0.054 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU

20180925_010119

I am running this on Windows 10 by the way and will try to run on Mac OS later as the interaction between serial port and esptool might not be working properly. Appreciate any help you might provide in the meanwhile. Thanks.

samr28 commented 5 years ago

@riogesulgon I had the same issue with esptool. To fix it, I used nodemcu which worked the first try.

riogesulgon commented 5 years ago

Thanks @samr28! I was able to flash the firmware using the nodemcu flasher (https://github.com/nodemcu/nodemcu-flasher). My board is now working properly.

AieCaPique commented 5 years ago

Hello everyone can you get the card to work with the Micro SD slot?

I thank you in advance for your help because me on my side the SSID works but impossible to operate the Micro SD

chepo92 commented 5 years ago

@AieCaPique the SD slot seems to be wired to the Atmega, at least the example sketchs are working for me (use SS pin 8)

TheIronShadow commented 5 years ago

I have a question. so if you follow the guide the wifi mode and sd card mode will work?. don't you have to upload the duckduino-microsd or duckduino-microsd/dip.

and how to make the wifi and microsd with dip switch working?

AieCaPique commented 5 years ago

@TheIronShadow for me wifi works, code execution also works. The only thing that does not work is the micro sd part to store more code or executables as would a rubber ducky

ghost commented 5 years ago

@AieCaPique if you get it to work with the SD card please create a clear tutorial on everything.

ghost commented 5 years ago

If someone could take the code from http://seytonic.com/2016/11/26/arduino-rubber-ducky-microsd/ and merge it with the wifi code it would be great.

ghost commented 5 years ago

@puckk @AieCaPique @chepo92 @cristyanul did you guys get the SD card working somehow? Trying it atm. It would be awesome if you could share the code.

ghost commented 5 years ago

You could use the SD card to pull and run files from it. Paxy's duckuino has this kind of capability. Source to paxy's code, links in desc. -> https://youtu.be/3A53g0j-ugw He has not made it for the WiFi version tho as you can see, but it should work with little bit of tweaking. Remember to share if you get it working.

rl34075 commented 5 years ago

Please, look at www.l2r1.com.br. There are some scripts to configure your cjmcu esp8266.

AieCaPique commented 5 years ago

Thanks @rl34075 for the tutorial on my side I am step by step the procedure but the script.txt does not work more since I followed the indication I can not write the characters & and% with the function ALT NUM_3 NUM_7 for example for the%

If someone has an idea

rl34075 commented 5 years ago

I think the problem is in keyboard layout... The script is to english Layout... maybe you need to remap ekyboard keys.

Em qui, 18 de abr de 2019 às 09:43, AieCaPique notifications@github.com escreveu:

Thanks @rl34075 https://github.com/rl34075 for the tutorial on my side I am step by step the procedure but the script.txt does not work more since I followed the indication I can not write the characters & and% with the function ALT NUM_3 NUM_7 for example for the%

If someone has an idea

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spacehuhn/wifi_ducky/issues/91#issuecomment-484490225, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGRHCTFD2NCHVVOYBJTE5DPRBUGBANCNFSM4FAO6GYA .

-- Leonardo La Rosa

TechieRuss commented 5 years ago

I think I solved the mystery of not being able to flash the esp8266 using the atmega32u4 as a serial pass-through. A banggood seller posted this "schematic" http://myosuploads3.banggood.com/products/20190102/20190102202550CJMCU-32U4TFWIFIforreference.pdf As you can see this thing has so many errors that if any of the Chinese fab houses are actually following it I'm shocked that these cards work at all.

I was able to flash the ESP by de-soldering it off of the assembly and using an arduino uno as serial passthrough.

And now I'm off to KiCad to make my own board that will work.

camilitox commented 5 years ago

@puckk Your tutorial was amazing, do you have some script to use de SD card simultaneously with the WiFi?

rl34075 commented 5 years ago

I'm working on it.... I know that is possible to use SD as a server file for ESP8266...so, you can upload files to the server (sd card in this case). You could exfiltrate data from target host to Server uploading to SD or use SD card as a exlpoit repository to use with server...

Leonardo La Rosa

Em qua, 15 de mai de 2019 às 12:58, camilitox notifications@github.com escreveu:

@puckk https://github.com/puckk Your tutorial was amazing, do you have some script to use de SD card simultaneously with the WiFi?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spacehuhn/wifi_ducky/issues/91?email_source=notifications&email_token=ABGRHCVI2A5VIHCNPJTWBALPVQXJLA5CNFSM4FAO6GYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVPD5LY#issuecomment-492715695, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGRHCR4VW3KU6L2K35VQR3PVQXJLANCNFSM4FAO6GYA .

TechieRuss commented 5 years ago

On the board that I got, the SD card is wired to the atmega32u4 not to the esp8266. this might make it more difficult to move files to it from the 8266.

rl34075 commented 5 years ago

I think that you can use arduino to connect everything together.

Leonardo La Rosa

Em qua, 15 de mai de 2019 às 17:04, TechieRuss notifications@github.com escreveu:

On the board that I got, the SD card is wired to the atmega32u4 not to the esp8266. this might make it more difficult to move files to it from the 8266.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spacehuhn/wifi_ducky/issues/91?email_source=notifications&email_token=ABGRHCTZFRPIFQOZ2B3Z3QDPVRUE5A5CNFSM4FAO6GYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVPZJQA#issuecomment-492803264, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGRHCWS6ELEOTF5NJFAQTLPVRUE5ANCNFSM4FAO6GYA .

camilitox commented 5 years ago

https://github.com/joelsernamoreno/badusb_sd_wifi?files=1 ... This can read scripts from sd ... But uses other language script

blackecho101 commented 5 years ago

We need to find a way to merge the SD capability of badusb_sd_wifi with the features and ducky script compatibility of this amazing project! I ordered my board from aliexpress and it arrived in 12 days! I hope there is more activity around this board soon!

kryptonut commented 4 years ago

It's a great little board. Question, does it just read raw duckyscript in the interpreter, or does it still need an inject.bin of sorts? Might see if I can cobble something together to get the SD card working too - no promises though, I'm not an actual developer.

rl34075 commented 4 years ago

Hi Glen,

You have to flash firmware to configure the board. After configure, you only need to upload the scripts from Web or to SD card.

Leonardo La Rosa

Em seg, 29 de jul de 2019 às 16:48, Glen Gibson notifications@github.com escreveu:

It's a great little board. Question, does it just read raw duckyscript in the interpreter, or does it still need an inject.bin of sorts? Might see if I can cobble something together to get the SD card working too - no promises though, I'm not an actual developer.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spacehuhn/wifi_ducky/issues/91?email_source=notifications&email_token=ABGRHCXITHYJSJW23UIDLQLQB5CQ5A5CNFSM4FAO6GYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3BZ3NQ#issuecomment-516136374, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGRHCVKUPENP65YXNQYZL3QB5CQ5ANCNFSM4FAO6GYA .