Unduh file chipertext dan convert.py dari pico terlebih dahulu di kalilinux

Buka terminal dan buat file python dengan perintah

Touch decode.py

Salin codingan ini

#!/usr/bin/python

import sys

ciphertext = ‘DLSeGAGDgBNJDQJDCFSFnRBIDjgHoDFCFtHDgJpiHtGDmMAQFnRBJKkBAsTMrsPSDDnEFCFtIbEDtDCIbFCFtHTJDKerFldbFObFCFtLBFkBAAAPFnRBJGEkerFlcPgKkImHnIlATJDKbTbFOkdNnsgbnJRMFnRBN>

lookup1 = “\n \”#()*+/1:=[]abcdefghijklmnopqrstuvwxyz”

lookup2 = “ABCDEFGHIJKLMNOPQRSTabcdefghijklmnopqrst”

out = “”

prev = 0

for char in ciphertext:

  index_2 = lookup2.index(char)

  index_1 = (index_2 + prev) % 40

  out += lookup1[index_1]

  prev = index_1

sys.stdout.write(out)

Keterangan codingan diatas merupakan modifikasi dari file convert.py yang dimana buang fileinput lalu ubah variabel chars menjadi chipertext dengan isi variabel diambil dari file chipertext

codingan yang disalin dipaste di file yang telah dibuat

Jalankan file python dengan perintah

python decode.py

  • Simpan hasil run decode.py ke file stage.py dengan perintah berikut

python decode.py > stage.py

Gunakan perintah berikut untuk mendapatkan flag

printf “picoCTF{%s}” $(python2 ./stage.py < stage.py | tr -d ‘\n’)

picoCTF{adlibs}      


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *