-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathKeyboard CTF script
60 lines (57 loc) · 1.05 KB
/
Keyboard CTF script
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
#!/usr/bin/python
mappings = {
0x04:"A",
0x05:"B",
0x06:"C",
0x07:"D",
0x08:"E",
0x09:"F",
0x0A:"G",
0x0B:"H",
0x0C:"I",
0x0D:"J",
0x0E:"K",
0x0F:"L",
0x10:"M",
0x11:"N",
0x12:"O",
0x13:"P",
0x14:"Q",
0x15:"R",
0x16:"S",
0x17:"T",
0x18:"U",
0x19:"V",
0x1A:"W",
0x1B:"X",
0x1C:"Y",
0x1D:"Z",
0x1E:"1",
0x1F:"2",
0x20:"3",
0x21:"4",
0x22:"5",
0x23:"6",
0x24:"7",
0x25:"8",
0x26:"9",
0x27:"0",
0x28:"\n",
0x2C:" ",
0x2D:"-",
0x2E:"=",
0x2F:"[",
0x30:"]"
}
nums = []
keys = open('data.txt')
for line in keys:
nums.append(int(line.strip(),16))
keys.close()
output = ""
for n in nums:
if n in mappings:
output += mappings[n]
else:
output += 'x'
print 'output :' + output