Skip to content

Commit

Permalink
Noice
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Baptiste Terrazzoni committed Feb 24, 2020
1 parent 99b00a8 commit a9f883e
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions level06/source.c
Original file line number Diff line number Diff line change
@@ -1,20 1,36 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/ptrace.h>

int auth(login_str ebp 0x8, Serial ebp 0xc)
{
int login_len; // EBP - 0xc

login_str[strcspn('\n', login_str)] = 0;
login_len = strnlen(login_str, 32);

if (login_len != 5) {
return 1;
}

if (ptrace(0, 0, 1, 0) == 0xffffffff) { // ???
puts("\e[32m.---------------------------.");
puts("\e[31m| !! TAMPERING DETECTED !! |");
puts("\e[32m.---------------------------.");
return 1;
}

int value; // EBP - 0x10
value = (int) (login_str[3]) ^ 0x1337 0x5eeded;

}

int main()
{
fgets(esp 0x2c, 32, stdin); Login

scanf(%u, esp 0x28); Serial

if (auth(Login, Serial))
if (!auth(Login, Serial))
system("/bin/sh");
}

auth(Login ebp 0x8, Serial ebp 0xc)
{
int temp;
Login[strcspn('\n', Login)] = '\0'; Replaces '\n' with '\0'
temp = strnlen(Login, 32);

}

0 comments on commit a9f883e

Please sign in to comment.