I was wondering what are the risks of connect a Raspberry pi to a PC through the USB port?I could think of HID emulation and keystroke injection into the victims PC.Other than that what are the possible attacks?
closed as unclear what you're asking by Marcus Müller, Xander, S.L. Barth, Matthew, kasperd Dec 7 '16 at 22:11
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
The answer depends on what you mean by "connect through a USB port" A Raspberry Pi has two types of USB port: the data ports using full-sized USB headers, and the power port using a microUSB header.
If you are connecting the Pi's 5V power port to a PC for the purposes of powering the Pi, then you are safe because the microUSB's data pins are disconnected [source]. I suppose there's a risk of over-voltage and frying the Pi / PC, but that's hardly a security issue.
If you are connecting the data USB ports of the Pi to a PC - either with a male-male USB cable, or through a hub, then all bets are off. A malicious Pi could advertize itself to the PC however it wants, as a HID device, as a USB harddrive, printer, wtv, the PC won't be able to tell the difference.