I am working on a project which consists primly on detect a usb intrusion and execute some code. So first i need to know how to detect this usb insertion using python 3.6. Thank you
Asked
Active
Viewed 86 times
0
-
so you want to do it with our hands or you already tried something? – Maciej S. Apr 14 '19 at 23:30
-
with my hand, because i've already looked for something but nothing was convincing me enough – Sofiane Senoune Apr 15 '19 at 06:58
-
nothing was convincing... and have you tried to develop something or only looking for ready to use solution? – Maciej S. Apr 15 '19 at 09:15
-
Yea i went on testing if the command witch consist of copying returns true that means that tje usb key was here and other wise not insrted the problem is when your thing deploying the app on your LAN not evry station have there flopy disk named F:\ i want an advice ,orientation maybe to know how to exploit the event that the win system exploits to inform the user that usb key is inserted. – Sofiane Senoune Apr 15 '19 at 09:22
1 Answers
0
Perhaps something like this: https://github.com/Ming-Shu/How-to-detect-USB-plug-in-on-Windows-using-Python and already answered here for python specific: How to detect a new usb device is connected on python
On Linux, you would want to be monitoring the mount or devices partitions.

jklmnop
- 86
- 2
-
Thank you it's made for python2. With some syntax fixes it works on python3.6. Add vrackets for prints and change uppercase to ascii.uppercase . thanks – Sofiane Senoune May 15 '19 at 17:33