-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMalwareTech-shellcode1.py
More file actions
30 lines (23 loc) · 949 Bytes
/
MalwareTech-shellcode1.py
File metadata and controls
30 lines (23 loc) · 949 Bytes
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
#MalwareTech Challenge: shellcode1 (solver)
#link: https://www.malwaretech.com/challenges-shellcode1
# -- sad0p
def rotate_left(input_byte, count):
input_byte = bin(input_byte).lstrip('0b')
while(len(input_byte) < 8):
input_byte = '0' + input_byte
#00110_010 => 010_00110
input_byte = input_byte[count - 8:] + input_byte[:count]
return int(input_byte, 2)
def main():
mb_flag = [0x32, 0x62, 0x0A, 0x3A, 0xDB, 0x9A, 0x42, 0x2A, 0x62, 0x62, 0x1A, \
0x7A, 0x22, 0x2A, 0x69, 0x4A, 0x9A, 0x72, 0xA2, 0x69, 0x52, 0xAA, \
0x9A, 0xA2, 0x69, 0x32, 0x7A, 0x92, 0x69, 0x2A, 0xC2, 0x82, 0x62, \
0x7A, 0x4A, 0xA2, 0x9A, 0xEB]
count = 0;
while(count < len(mb_flag)):
mb_flag[count] = rotate_left(mb_flag[count], 5)
count = count + 1
for c in mb_flag:
print(chr(c), end='')
if __name__ == '__main__':
main()