angry (rev)

As the challenge name suggests, we should be using angr to solve the challenge. The main code is as follows:

undefined8 main(void)
{
  int iVar1;
  void *input;
  
  input = malloc(1);
  process(input,"Give me a password : ",0x28);
  iVar1 = check1(input); // I renamed this function
  if (iVar1 == 0) {
    puts("Bruh : (");
  }
  else {
    iVar1 = check2(input); // I renamed this function
    if (iVar1 == 0) {
      puts("Bruh : (");
    }
    else {
      puts("Congratulations !");
    }
  }
  return 0;
}

process() essentially prompts for the input and saves it into the address of input.

Then, the input is encrypted using check1. check1 is given below.

It verifies that the input length is 37 and performs a series of checks on the characters of the input. If we pass these checks we move on to enc2:

Again, we are performing more (albeit straightforward) checks on the input.

Using claripy, we specify our flag to be a bitvector with 37 characters. Using angr, we specify the base address of the binary to be 0, and we want to find the address 0x1286 which is the address of puts("Congratulations !"), and we avoid the addresses 0x1848 and 0x1837 which are the addresses of puts("Bruh : ( "). We then get the simulation manager to explore the program and find the flag.

Last updated