Skip to Content

Synopsis


Security through Induced Boredom is a personal favourite approach of mine. Not as exciting as something like The Fray, but I love making it as tedious as possible to see my secrets, so you can only get one character at a time!

Platform

Hackthebox


Level

Very Easy

Tools


  • Bash
  • Netcat

Questions


When spawning the docker, it gave you an IP address and a port number.

I then used netcat to connect:

nc <ip_address> <port>

When connected, there was a message stating "Which character (index) of the flag do you want? Enter an index: ". I entered 0 - 5. It seems that it is printing individual characters which seems to be the flag.

Now I don't know how many characters this flag is so I created an output file to log all the entries. I entered 0 - 50. The out put file looked incomplete which then lead me to input 0 - 110.

nc <ip_address> <port> > character.txt

The flag is there and I could just type it in letter by letter, but I'm lazy. I rather just copy and paste the entire flag on a single line. Let's use bash to output the flag in one single line so I can copy and past it. 

rev character.txt| cut -c1 | paste -sd '' > character1.txt 

rev character.txt: This reverses the text in the file. This means everything in the last column is now in the first column

cut -c1: This will cut out column 1 of the file

paste -sd '': Paste command merges the lines together. -s will serialize it into one line and -d '' means no delimiter (no spaces).

> character1.txt: This will output the results into a new file called character1.txt


Here are the final results and the FLAG!

What I Learned


  • Learned to use the rev command

  • Did not write a script for this. Maybe there was an easier/faster way to get this flag. I felt like the longest part was entering in 0 - 110, but I was typing it really fast. It didn't feel that long.

  • I will look into how others obtained this flag.

    • I could have used seq command. That would have saved me time from manually inputting 100+ numbers LOLLL.

    • seq 0 110 | nc <ip_address> <port> > character.txt
  • Learn something new everyday!!!