Weekly Shaarli
Week 21 (May 24, 2021)
Volatility is no longer packaged with Kali since 2020.4 release but can be manually installed.
sudo apt-get install pcregrep libpcre++-dev python-dev
git clone https://github.com/gdabah/distorm.git
cd distorm3
sudo python setup.py install
sudo apt-get install yara -y
wget https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.1.tar.gz
tar -xvzf pycrypto-2.6.1.tar.gz
cd pycrypto-2.6.1
sudo python setup.py install
wget https://github.com/volatilityfoundation/volatility/archive/refs/tags/2.6.1.tar.gz
tar -xvzf 2.6.1.tar.gz
cd volatility-2.6.1
sudo python setup.py install
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt install gcc-multilib g++-multilib # for compiling
Some web challenges require executing /readflag
to get the flag. This executable will ask the user to compute some simple math. The timeout is very short, so the intended way to solve it is to write a script. However, there are better ways to solve it:
Solution 1: Trap the SIGALRM signal
$ trap "" 14 && /readflag
Solve the easy challenge first (((((-623343)+(913340))+(-511878))+(791102))-(956792))
input your answer: -387571
ok! here is your flag!!
Solution 2: mkfifo trick
$ mkfifo pipe
$ cat pipe | ./readflag |(read l;read l;echo "$(($l))" > pipe;cat)
input your answer:
ok! here is your flag!!
Ref: https://balsn.tw/ctf_writeup/20190427-*ctf/#solve_readflag-(not-a-challenge)