MasterWard Profile
  • Introduction
  • Media Links
  • Resume
  • HackThebox Notes
    • RedPanda
    • Metatwo
  • CTF Contest Writeups
    • 2017
      • Takoma Park CTF
      • TUCTF 2017
      • HITCON CTF 2017 Quals
      • CSAW CTF Qualification Round 2017
      • SEC-T CTF
      • Backdoor CTF 2017
      • Hack Dat Kiwi 2017
      • Kaspersky 2017
      • Hack.lu 2017
      • HackCon 2017
      • Defcamp 2017
      • Square CTF 2017
      • Mitre 2017
      • EKOPARTY CTF 2017
    • 2018
      • SEC-T CTF
      • Hackcon 2018
      • EasyCTF IV 2018
      • DefCamp CTF Qualifiers
      • PACTF 2018
      • CSAW CTF Qualifiers 2018
      • PicoCTF 2018
    • 2019
      • Newark Academy CTF 2019
      • Crypto CTF 2019
      • PicoCTF 2019
        • General Skills
        • Binary Exploitations
        • Forensics
        • Reverse Engineering
        • Cryptography
        • Web Exploitation
      • TAMUctf 19
    • 2021
      • picoCTF 2021
        • General Skills
        • Binary Exploitation
        • Forensics
        • Reverse Engineering
        • Cryptography
        • Web Exploitation
      • HackiHoli
      • S.H.E.L.L CTF
      • DawgCTF 2021
      • TCTF 2021
      • RedPwnCTF 2021
      • IJCTF 2021
      • UIUCTF 2021
      • Really Awesome CTF 2021
      • TMUCTF 2021
      • CSAW Qualifiers 2021
      • Pbjar CTF 2021
      • Deadface CTF 2021
    • 2022
      • NahamCon CTF 2022
      • BYUCTF 2022
      • DEF CON Qualifiers 2022
    • Useful Code
  • Software
    • Video Standardization and Compression
    • TOBIAS
    • Tracking Phone
    • Image Compression
    • Do Not Call Database
    • Color Blind Simulator
    • Gmail Unsubscriber
    • MP4 to GIF Converter
    • Optical Character Reading
    • Soft Jobs
    • OBD Project
    • Online Movie Finder
    • Work In Progress
      • Incremental Backup
      • Web Scraper - Wallpaper Edition
      • Web Blocker
      • File Manipulator
      • AppFiller
      • Cyber Security Projects
      • Bsaber AI
    • Ideas
      • CAN Programming
      • Malicious Programs
      • Remove Yourself from the Internet
      • DNA Classic
      • Auto Clicker
      • Adding Depth to a Video
      • Collage Mosaic Generator
      • Game Destroyer
      • Hearing aid Technology
      • Sign Language Recognition
      • Text Summarizer
      • Video to audio to text
      • Video Object Detection
      • VR demonstration
      • More Ideas to Elaborate on
    • Failure
      • Police Camera Radar
      • Already Created
      • Google Maps Game
      • Car price prediction
      • Bullshit Detector
      • Automated Code writter
      • Career Prediction
      • Samsung Remote Control Hack
      • Invalid Finder
      • PiHole Regex Filter
      • Group Archiver
  • Additional Articles
    • Cleaning Up a Computer Tricks
    • Getting started in Cyber Security
    • Speeding Up Your Internet
    • College Experience
    • Currently Writting
      • Reverse Engineering Notes
      • Bug Bounty Guide and Examples
      • OSCP help
      • Job Experience
      • Professional Job-Hunting Experience
Powered by GitBook
On this page
  • Sanity [100 pts] - Reverse Engineering
  • Link to Solutions

Was this helpful?

  1. CTF Contest Writeups
  2. 2021

IJCTF 2021

PreviousRedPwnCTF 2021NextUIUCTF 2021

Last updated 3 years ago

Was this helpful?

Sanity [100 pts] - Reverse Engineering

Description

Just testing your sanity

Solution

This problem actually drove me insane at first. Like anyone else I submitted the flag. Then again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again, and again. Then bam my dumb ass realized the variable key exists and that can't be nothing right.

Key = 00 00 00 00 00 00 0a 06 18 2f 08 0c 3b 2c 0f 01 1d 2b 1f 3e 0f 004 3a 05 04 2d 39 06 06 00 10 08 05 01 11 4c 00 00 00 00 Flag = IJCTF{simple_sanity_check_for_babies}

Code (Pay attention to line 26)

undefined8 main(void) {
  undefined *__s2;
  int iVar1;
  ulong uVar2;
  size_t sVar3;
  ulong uVar4;
  size_t asStack192 [3];
  undefined local_a8 [103];
  byte local_41;
  undefined *local_40;
  long local_38;
  
  asStack192[0] = 0x10118c;
  asStack192[1] = strlen(flag);
  local_38 = asStack192[1] - 1;
  asStack192[2] = 0;
  uVar2 = (asStack192[1] + 0xf) / 0x10;
  local_40 = (undefined *)(asStack192[1] + uVar2 * 0x1ffffffffffffffe);
  int local_2c = 0;
  while( true ) {
    uVar4 = SEXT48(local_2c);
    asStack192[uVar2 * 0x1ffffffffffffffe] = 0x101238;
    sVar3 = strlen(flag,*(undefined *)(asStack192 + uVar2 * 0x1ffffffffffffffe));
    if (sVar3 <= uVar4) break;
    local_41 = key[local_2c] ^ flag[local_2c];
    local_40[local_2c] = key[local_2c] ^ flag[local_2c];
    local_2c = local_2c + 1;
  }
  asStack192[uVar2 * 0x1ffffffffffffffe] = 0x101249;
  puts("Whats the flag?",*(undefined *)(asStack192 + uVar2 * 0x1ffffffffffffffe));
  asStack192[uVar2 * 0x1ffffffffffffffe] = 0x101264;
  __isoc99_scanf(&DAT_00102066,local_a8);
  __s2 = local_40;
  asStack192[uVar2 * 0x1ffffffffffffffe] = 0x10127a;
  iVar1 = strcmp(local_a8,__s2,*(undefined *)(asStack192 + uVar2 * 0x1ffffffffffffffe));
  if (iVar1 == 0) {
    asStack192[uVar2 * 0x1ffffffffffffffe] = 0x10128a;
    puts("Correct!",*(undefined *)(asStack192 + uVar2 * 0x1ffffffffffffffe));
  }
  else {
    asStack192[uVar2 * 0x1ffffffffffffffe] = 0x101298;
    puts("Wrong!",*(undefined *)(asStack192 + uVar2 * 0x1ffffffffffffffe));
  }
  return 0;
}

Line 26 was my key that we would xor the two and my code to do this was quite simple

key = "00 00 00 00 00 00 0a 06 18 2f 08 0c 3b 2c 0f 01 1d 2b 1f 3e 0f 004 3a 05 04 2d 39 06 06 00 10 08 05 01 11 4c 00 00 00 00".split(" ")
flag = "IJCTF{simple_sanity_check_for_babies}"
new_flag = ""
for i in range(0, len(flag)):
    tmp = ord(flag[i]) ^ int(key[i],16)
    new_flag += chr(tmp)
print(new_flag)

Flag: IJCTF{you_did_not_fall_for_it_right?}

Link to Solutions

I did not write them but most are not posted on CTF time so decided to add the links for future reference.

​

https://github.com/1GN1tE/CTF_Writeups/tree/main/Writeups/IJCTFgithub.com
writeUps/IJCTF2021 at master · Pycatchown/writeUpsGitHub
write-ups/IJCTF.2021/pwn at main · nobodyisnobody/write-upsGitHub
Logo
Logo
IJCTF 2021Utaha's CTF Note
Logo