updates people updates
This commit is contained in:
1
training/htb/challenges/rev/encrypted_data.txt
Normal file
1
training/htb/challenges/rev/encrypted_data.txt
Normal file
@@ -0,0 +1 @@
|
||||
09071148207302682C6762023E367D1A1E351F072A1D3C0B712562577E30133B71072E
|
||||
BIN
training/htb/challenges/rev/ircware
Normal file
BIN
training/htb/challenges/rev/ircware
Normal file
Binary file not shown.
BIN
training/htb/challenges/rev/ircware.i64
Normal file
BIN
training/htb/challenges/rev/ircware.i64
Normal file
Binary file not shown.
BIN
training/htb/challenges/rev/solve
Executable file
BIN
training/htb/challenges/rev/solve
Executable file
Binary file not shown.
42
training/htb/challenges/rev/solve.c
Normal file
42
training/htb/challenges/rev/solve.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#include <stdio.h>
|
||||
|
||||
char rolling_xor(char *key, char* encrypted_data)
|
||||
{
|
||||
char* v0 = key;
|
||||
int v1 = 0;
|
||||
char *i = encrypted_data;
|
||||
char result;
|
||||
|
||||
for ( ; *i; ++i )
|
||||
{
|
||||
result = *v0;
|
||||
*i ^= *v0++;
|
||||
if ( ++v1 == 8 )
|
||||
{
|
||||
v0 = key;
|
||||
v1 = 0;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int main(){
|
||||
char encrypted_data[] =
|
||||
{
|
||||
0x09, 0x07, 0x11, 0x48, 0x20, 0x73, 0x02, 0x68, 0x2C, 0x67,
|
||||
0x62, 0x02, 0x3E, 0x36, 0x7D, 0x1A, 0x1E, 0x35, 0x1F, 0x07,
|
||||
0x2A, 0x1D, 0x3C, 0x0B, 0x71, 0x25, 0x62, 0x57, 0x7E, 0x30,
|
||||
0x13, 0x3B, 0x71, 0x07, 0x2E, 0x00
|
||||
};
|
||||
|
||||
char key[] =
|
||||
{
|
||||
0x52, 0x4A, 0x4A, 0x33, 0x44, 0x53, 0x43, 0x50, 0x00
|
||||
};
|
||||
|
||||
|
||||
rolling_xor(key, encrypted_data);
|
||||
|
||||
printf("decrypted: %s\n", encrypted_data);
|
||||
|
||||
}
|
||||
25
training/htb/challenges/rev/solve.py
Normal file
25
training/htb/challenges/rev/solve.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from pwn import xor
|
||||
|
||||
with open("./encrypted_data.txt", "r") as f:
|
||||
data = f.readline()
|
||||
|
||||
key = bytes.fromhex("524A4A3344534350")
|
||||
|
||||
print(len(key))
|
||||
|
||||
dec_key = []
|
||||
|
||||
for s in key:
|
||||
s -= 17
|
||||
if s < ord('A'):
|
||||
s += 26
|
||||
dec_key.append(s)
|
||||
|
||||
dec_key[3] = b"3"[0]
|
||||
|
||||
print("".join(chr(c) for c in dec_key))
|
||||
|
||||
data = bytes.fromhex(data)
|
||||
|
||||
print(xor(data, dec_key))
|
||||
|
||||
Reference in New Issue
Block a user