-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.py
More file actions
89 lines (79 loc) · 3.01 KB
/
code.py
File metadata and controls
89 lines (79 loc) · 3.01 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
print(f"\n[*] Importing Main Modules...")
import time
start_time = time.monotonic()
import os
import sys
import board
import digitalio
from digitalio import DigitalInOut, Direction, Pull
from modules.rubberducky import rubberducky
from modules.hashtest import hashtest
end_time = time.monotonic()
execution_time = (end_time - start_time) * 1000
num_modules = len(sys.modules)
print(f"[*] Imported {num_modules} Main Modules [{execution_time}ms]")
start_time = time.monotonic()
led_pin = board.LED
led = digitalio.DigitalInOut(led_pin)
led.direction = digitalio.Direction.OUTPUT
end_time = time.monotonic()
execution_time = (end_time - start_time) * 1000
print(f"[*] Setup LED [{execution_time}ms]")
start_time = time.monotonic()
button = DigitalInOut(board.BUTTON)
button.direction = Direction.INPUT
button.pull = Pull.UP
end_time = time.monotonic()
execution_time = (end_time - start_time) * 1000
print(f"[*] Setup BUTTON [{execution_time}ms]")
print("[*] Awaiting Button Press...")
while True:
if not button.value:
time.sleep(0.1)
if not button.value:
start_time = time.monotonic()
print("[*] Started Session")
led.value = True
while True:
time.sleep(2)
led.value = True
if not button.value:
print("[*] Awaiting Button Press...")
while True:
if not button.value:
time.sleep(0.1)
if not button.value:
start_time = time.monotonic()
hashtest(100)
end_time = time.monotonic()
execution_time = (end_time - start_time) * 1000
while not button.value:
pass
break
time.sleep(0.01)
break
time.sleep(1)
led.value = False
if not button.value:
print("[*] Awaiting Button Press...")
while True:
if not button.value:
time.sleep(0.1)
if not button.value:
start_time = time.monotonic()
rubberducky("files/payload.txt")
end_time = time.monotonic()
execution_time = (end_time - start_time) * 1000
while not button.value:
pass
break
time.sleep(0.01)
break
led.value = False
end_time = time.monotonic()
execution_time = (end_time - start_time) * 1000
print(f"[*] Breaking Session [{execution_time}ms]")
while not button.value:
pass
time.sleep(0.01)
# type: ignore