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.

rl34075 commented 4 years ago

I think it's possible... You can use SD card as a script library...

Leonardo La Rosa

Em qua, 5 de jun de 2019 às 19:22, blackecho101 notifications@github.com escreveu:

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!

— 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=ABGRHCWC3LBQPGFT6GFH4G3PZA4DBA5CNFSM4FAO6GYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXBF7LA#issuecomment-499277740, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGRHCSL6MTCGMK6UCNHYSLPZA4DBANCNFSM4FAO6GYA .

rl34075 commented 4 years ago

Hi AieCaPique,

I've changed the scripts to use pt-BR keyboards... you can google for keyboard mapping in arduino and change it to satsfy your needs.

Leonardo La Rosa

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 .

kryptonut commented 4 years ago

Mine is flashed, and I can upload scripts, run live scripts, etc.

I've had no success putting scripts on the SD card and from what I've seen in the code, there's no reference to any sort of SD libraries or SD card handling.

rl34075 commented 4 years ago

Hello Glen,

Take a look at this links...I think they can help you:

https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino https://www.hackster.io/draw2dtouch/nodemcu-webserver-with-sd-card-support-169adc

Leonardo La Rosa

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

Mine is flashed, and I can upload scripts, run live scripts, etc.

I've had no success putting scripts on the SD card and from what I've seen in the code, there's no reference to any sort of SD libraries or SD card handling.

— 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=ABGRHCSPGO43PB2SFKAX243QB5UZZA5CNFSM4FAO6GYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3CFZOA#issuecomment-516185272, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGRHCSZV633HWFDZTWY3BDQB5UZZANCNFSM4FAO6GYA .

vtontodonato-c commented 4 years ago

I need to flash esp8266 on the CJMCU-3212 via OTA or access the esp8266 via ARDUINO IDE to develop my own software NOT duck.

Is anybody trying something as this?

Can I flash my arduino code directly?

thanks

chepo92 commented 4 years ago

As I said before the SD is wired to the Atmega, so you upload scripts to esp8266 then send them via serial to Atmega then it has to write to sd

neoskyriper commented 4 years ago

Pour ma part je n'arrive plus a le flasher avec un .bin avec nodemcu-flasher-master ESP8266Flasher.exe je suis désespéré je ne sais plus quoi faire si vous avez une solution s'il vous plait merci

sebastienPoussard commented 4 years ago

adter a few months, i suceeded to make it work, it seems I needed to to it with Windows. With my Linux laptop it didn't worked. Anyway, I'm now facing a new issue, when i type text in the web server, it is mappy to different code on the remote host (azerty) @AieCaPique any ideas ?

cnu77 commented 4 years ago

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

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

I tried, but not working.

I tried 3 different ways, ending in the same loop. Tried joining the 2 pins as shown in your pic, same issues.

  1. esptool.py --> serial.serialutil.SerialTimeoutException: Write timeout
  2. Arduino IDE --> serial.serialutil.SerialTimeoutException: Write timeout the selected serial port serial.serialutil.SerialTimeoutException: Write timeout does not exist or your board is not connected
  3. NodeMCU Flash --> Waiting MAC

I am not sure, if...

  1. GPIO0 is grounded or not (Or, by default, it is grounded)
  2. Do I need to flash ESP8266 with firmware? Is it a 'must'?

Any suggestions, please?

Xentraxx commented 4 years ago

I got WiFiDucky working but as I'd like to use different keyboard mappings I'd like to use the successor WiFiDuck as it supports different keyboard types. @rl34075 You mentioned that you changed the script to use the pt-BR keyboard. Could you explain or provide a resource on how to use a qwertz keyboard with WiFiDucky for example?

cnu77 commented 4 years ago

Now, I tried this video https://www.youtube.com/watch?v=G-Z2rf_AN-c

I followed the steps.

Flash ATMEGA32U4, using Step1.ino file Flash ESP8266 using esp8266_flasher.exe and esp8266_wifi_duck_4mb.bin as bin file. Held a jumper cable to the 2 circles, pushed it to USB. Connected to the USB. Did not take the cable out. Click on Download on the flasher and uploaded and finally said 'leaving...' Now, I can connect to the WiFi Duck with password quackquack.

But, I cannot run the script. Nothing happens.

When I checked in the Serial monitor, I saw some wierd characters.

So, in the Step1.ino I changed the baud rate as below:

Serial.begin(115200) --> Junk Serial.begin(57600) --> Print the commands in Serial Monitor, but nothing gets executed Serial.begin(9600) --> Nothing happens

Any idea?

Also, even the baud rate is 57600, I can see the output in serial monitor, only when I select 115200 baud. Why is it so?

cnu77 commented 4 years ago

Sorry, its fine now. This is what happens with you do not have any idea about what you are doing.

After spending some time in going through the files that I have, I compared the .ino files I uploaded into ATMEGA32U4 with the actual script from the site, I found that what I uploaded is just a sample script which just prints whatever you send from 192.168.4.1.

Now, I uploaded the correct script and working like a charm.

ghost commented 4 years ago

Has anybody been able to get everything working?

samr28 commented 4 years ago

Has anybody been able to get everything working?

Yep, check out the guide puckk made https://github.com/puckk/CJMCU-3212

fluxxion82 commented 3 years ago

Has anyone been able to flash the esp8266 via esptool on a mac? The only time I can get it to write anything to the chip is right after pressing the reset button, but as soon as it's done resetting, the esptool quits. I have a lone esp8266 chip that I can write to, but I can't seem to get things to work on this cjmcu board. I found one repo where they were using a modified esptool it looked like, but I couldn't get that to work either. I don't really want to find a windows machine to use the nodemcu flassher tool. -EDIT I rewatched puckk's tutorial and he mentions the issues with the esptool and some of the things said in this thread. I'm curious what nodemcu flasher is doing, because it's still using the programmer code of sending the serial data from the arduino uart to the esp uart that we have to install first. And what is this reset button doing that's allowing the esptool to successfully send data? Can we prolong this state somehow, maybe? I checked all of the voltages at each pin to check that they matched my lone esp8266 chip and everything looked correct. Then I tried to flash the fw directly to the esp in the exact same way I do the lone chip, but that still didn't work. I can see the esp's led flash when using the esptool, but I don't see it flash with the nodemcu flash tool. Anyways, would love to be able to use the esptool if anyone has figured it out.

chepo92 commented 3 years ago

Has anyone been able to flash the esp8266 via esptool on a mac? The only time I can get it to write anything to the chip is right after pressing the reset button, but as soon as it's done resetting, the esptool quits. I have a lone esp8266 chip that I can write to, but I can't seem to get things to work on this cjmcu board. I found one repo where they were using a modified esptool it looked like, but I couldn't get that to work either. I don't really want to find a windows machine to use the nodemcu flassher tool. -EDIT I rewatched puckk's tutorial and he mentions the issues with the esptool and some of the things said in this thread. I'm curious what nodemcu flasher is doing, because it's still using the programmer code of sending the serial data from the arduino uart to the esp uart that we have to install first. And what is this reset button doing that's allowing the esptool to successfully send data? Can we prolong this state somehow, maybe? I checked all of the voltages at each pin to check that they matched my lone esp8266 chip and everything looked correct. Then I tried to flash the fw directly to the esp in the exact same way I do the lone chip, but that still didn't work. I can see the esp's led flash when using the esptool, but I don't see it flash with the nodemcu flash tool. Anyways, would love to be able to use the esptool if anyone has figured it out.

Did you enable verbose mode to check when it is failing? Have you tried other programmers/gui?

fluxxion82 commented 3 years ago

Has anyone been able to flash the esp8266 via esptool on a mac?

Did you enable verbose mode to check when it is failing? Have you tried other programmers/gui?

I did turn on the trace mode before. I was mistaken - after relooking at the output, it looks like there were some failures when it was trying to write during the reset time. It writes some bytes, reads a byte, which is then declared invalid data. So there does seem to be some communication happening. When it was trying to update the esp8266 without hitting the reset button, the data would attempt to be written, but then timeout while waiting for a packet header.

I did get to a windows box and was able to flash the esp with nodemcu, so I'm able to make some movement working with the device. It would definitely be more ideal if I could get esptool to work so I don't have to jump around workstations.

I skimmed over the nodemcu code and started to get an understanding of how they put it together, but I need to sit down and really peruse through it and figure out what they're doing right. I couldn't even get the esp to flash by directing wiring up to the chip and using esptool, which I thought was strange.

chepo92 commented 3 years ago

@fluxxion82 Just twice checking: did you upload the sketch to the avr chip? (step1) if you open a COM terminal, do you see the message of the bootloader from the ESP when reset?

fluxxion82 commented 3 years ago

@fluxxion82 Just twice checking: did you upload the sketch to the avr chip? (step1)

yes.

if you open a COM terminal, do you see the message of the bootloader from the ESP when reset?

no, I don't think I'm seeing anything from the ESP bootloader when reset. I've been referring to the output from the esptool via the --trace option, from which I can see the data being written and read (the ack or whatever that is being read is invalid). I hooked up wires to the cjmcu uart pins and could see the hex output of the data written that also shows up in the esptool trace, and don't see anything if I reset the cjmcu board.

FrankLaterza commented 3 years ago

Okay, I read everything, but I haven't seen anyone get the ESP-8266 wifi code to upload using the Arduino IDE. I want to do a project similar to Mr. puckk, but I don't want to export as binary then flash it with ESP8266 flasher every time I want to make a change. Has anyone been able to do this or is there a programmer I need to use?

Makswell77713 commented 9 months ago

Hello, everyone! Has anyone fixed the issue with CJMCU-3212? To flash it, I used this guide - https://github.com/puckk/CJMCU-3212. After shorting the contacts with a jumper and connecting it to my MacBook, the blue light stopped flashing. I then tried to flash it using the command 'esptool.py --trace --baud 115200 --port /dev/cu.usbmodem2101 write_flash 0x00000 /Users/apple/Projects/esp8266_wifi_duck_4mb.bin --flash_size 4MB --flash_mode dio --flash_freq 40m' and received this error.

TRACE +0.000 Write 46 bytes: c000082400000000 0007071220555555 | ...$........ UUU 5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU 5555555555555555 5555555555c0 | UUUUUUUUUUUUU. TRACE +0.104 No serial data received. .TRACE +0.052 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.100 No serial data received. .TRACE +0.052 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.102 No serial data received. .

A fatal error occurred: Failed to connect to Espressif device: No serial data received.