Repository navigation
Expand file tree
/
Copy pathcode.py
More file actions
53 lines (48 loc) · 1.42 KB
/
Copy pathcode.py
File metadata and controls
53 lines (48 loc) · 1.42 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
### LIBRARIES ###
import usb_hid
import board
import time
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
### VARIABLES ###
startButton = digitalio.DigitalInOut(board.GP9)
readyLED = digitalio.DigitalInOut(board.GP7)
runningLED = digitalio.DigitalInOut(board.GP4)
readyLED.direction = digitalio.Direction.OUTPUT
runningLED.direction = digitalio.Direction.OUTPUT
startButton.switch_to_input(pull = digitalio.Pull.UP)
filePath = "./wordlist.txt"
kbd = Keyboard(usb_hid.devices)
layout = KeyboardLayoutUS(kbd)
### FUNCTIONS ###
def typeCredentials(login, password):
layout.write(login)
kbd.send(Keycode.TAB)
layout.write(password)
kbd.send(Keycode.TAB)
kbd.send(Keycode.ENTER)
time.sleep(1)
kbd.send(Keycode.TAB)
kbd.send(Keycode.ENTER)
kbd.send(Keycode.TAB)
### MAIN LOOOP ###
readyLED.value = True
runningLED.value = False
time.sleep(20)
while True:
if startButton.value == False: # If the startButton is pressed
try:
with open(filePath, "r") as file:
readyLED.value = False
runningLED.value = True
for line in file:
words = line.strip().split(',')
login = words[0]
password = words[1]
typeCredentials(login, password)
time.sleep(1)
readyLED.value = True
runningLED.value = False
except: print("[-] Error")