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 16 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.

 

 

16 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!

  7. Anthony says:

    Cheapest way of building a MouseJiggler..

    Thanks guys

  8. Frank says:

    Amazingly good writeup. Well done!

  9. Joao Branco says:

    This is cool. Followed the instructions and it works!!!

    (had to use an USB cable extender to program though) – Thanks @Marcus for the hint

  10. Santiago says:

    Hi James,

    Thanks for your contribution!

    I am truly new to Arduino IDE (I am from the old school of microcontrollers like the MC68HC705J1A) and the following issue came up for me:
    When you mention step 7, select USBtinyISP, in my case only the “micronucleus” programmer appears.
    Am I doing something wrong? How do I add more programmers?

    Thanks in advance,

  11. Dave says:

    Hi James- thanks for the excellent tutorial; I’ve been an arduino tinkerer for a while, but always had difficulty with the Digispark. It’s also nice to have something useful to do with it, but I have a new issue I’m wondering if anyone can help solve- I was able to get it to work fine on my home PC, but like a prior commenter, had issues on my work PC, where I want to use this. I tried the hub trick mentioned in that thread, and yes, that fixed it too, for a bit- then I noticed that it goes from an HID-Compliant mouse to Unknown USB Device in Device manager, and stops working. Device manager says, “Windows as stopped this device because it has reported problems (Code 43). A request for the USB Device Descriptor failed.”

    I’m googling this too, but having limited luck, any one have any suggestions?

  12. Dave says:

    Dave again, possible to update my last comment? I switched to a different hub, and that has addressed the Error 43 issue- . Thanks again! After a Win11 upgrade my work PC would not wake from sleep, and IT couldn’t fix it.

    • James says:

      Glad to hear you got it sorted.
      The Area 43 is an annoying quirk of the digispark hardware.
      We’ve seen many issues with Win11 upgrades and isolated it down to bad drivers/bios after weeks of troubleshooting different ‘fixes’. Frustrating!
      Hope this device gives you sanity, Cheers

Leave a Reply to James Cancel reply

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