Air-Gap

How to make a mouse jiggler with Digispark

Home »  General »  How to make a mouse jiggler with Digispark

How to make a mouse jiggler with Digispark

On April 30, 2019, Posted by , In General,Tips and Tricks, By ,, , With 9 Comments

Mouse jigglers are a useful tool in the IT field to keep a computer active for a wide range of purposes from stopping a screensaver activating in a presentation to preventing a computer shutting down for a forensic investigator.

There are two main categories of jigglers:

  • Software Jigglers: A computer program that is installed on the host which automatically moves the cursor at a set interval.
    Pro’s: Cheap or Free, easily configurable, no extra circuitry
    Cons: User may not be authorised to install software, easy to detect by IT department
  • Hardware jigglers: A device which tricks the operating system into thinking its a mouse.
    An onboard micro-controller generates random or predefined movements
    Pro’s: Plug & Play, No configuration, hard to detect, reliable
    Con’s: Costs money, harder to reprogram

In this article we will be using a Digispark which is an affordable development board powered by a ATtiny85 micro-controller running at 16MHZ with 6K usable flash which can communicate with a host over USB. These boards are incredibly capable and can be used for a wide range of tasks including injecting keystrokes and mouse movements.

 

When you get your Digispark it will look similar to the picture, for this project we will not be using header pins and we will be programming the device through USB.

      1. The first step of programming the Digispark is downloading the latest Arduino programming IDE.
        https://www.arduino.cc/en/Main/Software
        arduino download page
      2. Next is downloading and installing the Digispark drivers. You may need to accept multiple notifications through the install process.
        https://github.com/digistump/DigistumpArduino/releases
      3. Once both the Arduino IDE and Digispark drivers have been installed, add the digispark JSON configuration file to the IDE. This is done by opening the Arduino IDE, clicking on ‘File, Preferences’ and adding the following URL into the ‘Additional Boards Manager URL’s’ box, then click ‘OK’.
        https://raw.githubusercontent.com/digistump/arduino-boards-index/master/package_digistump_index.json

      4. Once installed, go-to Tools –> Board and select “Board Manager
      5. In the top left hand corner change the Type to “Contributed” and click the install button on the “Digistump AVR Boards by Digistump package”. This will allow the Arduino IDE to program the Digispark controllers.
      6. Once installed, go-to Tools –> Board and select “Digispark – Default 16.5mhz”. This set’s the IDE to compile the code for the Digispark board.
      7. Next go-to, Tools –>Programmer and set it as “USBtinyISP”
      8. We have created an opensource simple Mouse Jiggler sketch (program) for the Digispark v3 which moves the cursor every 10-30 seconds in a square pattern. Download and open it in Arduino IDE.
        Download: MouseJiggler.ino
      9. Click on the “Upload” button to compile the sketch and upload it to the Digispark.
      10. If successful, you should now see the Digispark flash every 10-30 seconds to indicate a ‘mouse jiggle’. The mouse movement should be near undetectable.

 

We hope you you enjoyed this post. If you did please leave us a comment below.

 

 

9 Comments so far:

  1. Mitch says:

    Hi James,

    Interesting post! Do you know whether the mouse movement/mouse clicks generated by the Digispark count as SendInput?

    • James says:

      Interesting question Mitch and one I’ll explore further,
      Being a hardware device and essentially a physical mouse/keyboard which the the mouse movements (and keystrokes) are generated from makes it a very low level comparable to SendInput.
      This makes it incredibly hard to detect compared to a emulated software input from a security perspective and like SendInput may requires the window be focused.

      Whether it ‘counts’ is entirely down to how advanced the application is.

      Cheers
      -James

  2. Marcus says:

    Hey James,
    This does not work on my laptop. Programming completed successfully, and I see the light blinking every 30 seconds, but it is not keeping the computer active. What command could I use to have it press say f15 (or some other key not typically physically found on a keyboard)? I am hoping that will keep it from going to sleep.

    • James says:

      Hi Marcus,
      Good job on getting the Digispark programmed.

      Often this symptom is caused by the Digispark getting power, but the device not detecting in Windows usually due to the two inner USB data pins not correctly making contact with the laptops USB connector due to them being shorter.
      Bizzare if you programmed it on the same computer, but worth checking in Device Manager to see if there is actually is a second HID Mouse connected.
      If its not here, consider testing it on a second computer or different USB slot.

      To send keystrokes, such as Scroll-lock you will need to consider using ‘digikeyboard.h’.
      I’ll write you out a full sourcecode shortly.

  3. MARCUS says:

    Thanks, the instructions were great and very easy to follow, so the accolades belong to you. I did not program on the same computer, I was hoping I could use it on my work laptop to keep the screen alive, but I suspect its somehow blocked. It did work on the same computer I used to program. I would still be interested in trying the digkeyboard.h command to see if that changes anything.

    • James says:

      Thank you for your feedback, glad you found them useful.
      I’d strongly recommend you check device manager before going furthur down the rabbit hole, if there is no mouse there, sending keyboard presses won’t likely make a difference.

      Try plugging it in through a USB hub into the laptop and not into the laptop itself as my money is it being a physical problem which is just a matter of extending the two inner USB data line traces on the PCB.

  4. MARCUS says:

    Guess what? You nailed it, plugged it into a hub and it works. Dangit! I will try the docking station next, otherwise I will have to just keep using the hub. Would a USB extension cable possibly do the same thing?

  5. Marcus says:

    Using a USB extension cable apparently did the trick. Thanks for the excellent write up AND support.

  6. George says:

    Great write up! Works like a charm!

Leave a Reply

Your email address will not be published. Required fields are marked *