Recently two researchers have successfully been able to use the USB port in order to attempt a hack. Angelos Stavrou and Zhaohui Wang have created a tool that can change the functionality of the USB driver so that it can be used to hack a smartphone when someone connects it to the PC USB port for charging or browsing.
The hacking tool identifies the Operating System running on the smartphone. It usually displays an information message that the system has detected a new human interface device. This information message appears in Windows and Mac while Linux doesn’t display any information message so the Linux user doesn’t even know what has happened to them. Then the tool adds the keyboard and mouse functionality to the connection so that the hacker can easily control the hacked device using the commands given through the mouse and the keyboard.
This hacking tool has virus like properties and can spread easily from system to system. If one smartphone is infected, whenever that smartphone is connected to any system, that system gets infected. It’s very hard for the antivirus to detect the suspicious activities of this hacking tool.
While this is only a demonstration that the USB traffic can be used for hacking, there is very little that a user can do about this at the moment. The Operating System should be able to tell the user what exact communication is happening through the USB ports.
[Source]