-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlevel06.c
66 lines (58 loc) · 1.83 KB
/
level06.c
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <sys/ptrace.h>
int32_t auth (char *str, uint32_t serial)
{
uint32_t local_var__c;
uint32_t local_var__10;
uint32_t local_var__14 = 0;
str[strcspn(str, "\n")] = 0;
local_var__c = strnlen(str, 0x20);
if (local_var__c <= 5)
return (1);
if (ptrace(0, 1, 0, 0) == -1)
{
puts("\033[32m.---------------------------.");
puts("\033[31m| !! TAMPERING DETECTED !! |");
puts("\033[32m'---------------------------'");
return (1);
}
local_var__10 = ((str[0x3] ^ 0x1337) + 0x5eeded);
while(local_var__14 < local_var__c)
{
if (str[local_var__14] == ' ')
return (1);
local_var__10 = (str[local_var__14] ^ local_var__10) - (((((str[local_var__14] ^ local_var__10) * 0x88233b2b) - (str[local_var__14] ^ local_var__10)) << 1 ) + ((str[local_var__14] ^ local_var__10) * 0x88233b2b) << 0xa) * 0x539;
local_var__14++;
}
if (local_var__10 == serial)
return (0);
return (1);
}
int32_t main (__attribute__((unused))int32_t argc, __attribute__((unused))char **argv)
{
char local_var_2c[0x20];
uint32_t local_var_28;
puts("***********************************");
puts("*\t\tlevel06\t\t *");
puts("***********************************");
printf("-> Enter Login: ");
fgets(local_var_2c, 0x20, stdin);
puts("***********************************");
puts("***** NEW ACCOUNT DETECTED ********");
puts("***********************************");
printf("-> Enter Serial: ");
scanf("%u", &local_var_28);
if (auth(local_var_2c, local_var_28) == 0)
{
puts("Authenticated!");
system("/bin/sh");
return (0);
}
return (1);
}
/**
* Source code file has been recreated from assembly by myself.
*/