Go Down

Topic: Can I impersonate devices other than keyboard/mouse using Arduino Leonardo? (Read 1 time) previous topic - next topic



I'm searching for a suitable card for my college project in network security,
and I would like to now whether it is possible to impersonate a USB device of my choice, other than a keyboard or mouse (a printer for instance), using the Arduino Leonardo card?
I looked at the source code from github, but couldn't figure out whether the card can accept self-written device classes, that are not the keyboard/mouse native classes which I saw in the source code, and if so, what are the unique parameters I need to provide in order to distinguish between the various usb devices.

Thanks in advance,


It's certainly possible to emulate most sorts of USB device. You would have to read about and understand USB protocol to work out how to emulate a particular one. Sorry I can't be more helpful, I've never done it myself.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.


maxmor89, like you, I'm waiting for someone to write code for other USB devices.
As far as I know, anything can be emulated, but writing the code is too complicated for me.

What kind of devices did you think about ?

For example an usb flash drive is not very usefull. The EEPROM is very small, perhaps too small for a FAT file system. Using an SD shield with SD card is of little use, since the SD card itself can be removed and placed in a PC.

A game console already exists : http://arduino.cc/en/Main/ArduinoBoardEsplora
But I looks as if it emulates a keyboard and a mouse, and not a game console.

An audio in and out could be useful in a few situations.


I thought about a printer, or some similar device. I'm doing a project in network security, so I don't need the card to act as a REAL printer of course, but only the computer to recognize it as a printer, and load suitable drivers. After achieving this goal, I can continue to more complicated tasks with the "Fake printer".

I know everything can be emulted in theory, but I can't figure out whether there is an easy way to emulate devices other which implement protocol other than Human Interface Device.

Still hope someone here tried stuff in this direction.

Paul Beaudet

This an interesting question and I would go further to ask how difficult it would be to emulate multiple devices
lets say a keyboard and something that would be able to receive info i.e. "sense" whats going on the host computer.

maybe a scrip to give the arduino cues, like "hey the browser is open you can run macro1"
or give access to the clipboard, "highlight password, copy... thanks bud, nice password"

I've got a feeling that this is probably going down the rabbit hole in terms of feasibility
probably take a lot of code

Paul Beaudet

oh... wait you could just swich back and forth between serial and keyboard for what I suggested
a lot move feasible, converting ascii sucks, but cues would be easy with a script 
forgive me for being so noobish


You could take a look at the V-USB library. This is an USB library for normal ATmega chips without a builtin USB controller. Everything should also be possible with the Leonardo.


I'm attempting to do this w/ a Leonardo - there are two things you need to address:

1 - altering the values in the bootloader that identify it as a Leonardo, i.e. the Vendor ID and Product ID and some of the other info that goes along with this - in other words changing these values in the bootloader source code, recompiling and uploading to the Leonardo (this requires an programmer or another Arduino board)

2 - updating the code in the software that gets loaded when you load a new sketch, also to reflect the kind of device that you want it to appear as.

the code changes aren't too difficult, right now I'm stuck getting my rebuilt bootloader to work, but going to tackle it this weekend again

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131