Hello World \o/
  • 👾ENCONTRASTE MIS WRITEUPS
  • 🟣 MAQUINAS VULNERADAS
    • Vulnhub
      • Darkhole: 2
      • Symfonos 1
      • Symfonos 2
      • ICA: 1
      • Corrosion 2
      • Venom 1
      • Corrosion 1
    • HackTheBox
      • Return
      • Horizontall
      • Validation
      • Love
      • Nodeblog
      • NunChucks
      • Lame
      • Legacy
      • Knife
    • PortSwigger
      • Blind Sqli
  • 🟣 CTFS
    • Bandit
    • Baby Encription
    • Primed for Action
  • 🟣 BUG BOUNTIES
    • Open Redirect
  • 🟣 SCRIPTS
    • I Found You
  • 🟣 PROYECTOS
    • Landing Page
    • Face Tracker
  • 🟣 SOBRE MI
    • Contactame
Powered by GitBook
On this page
  1. 🟣 CTFS

Baby Encription

PreviousBanditNextPrimed for Action

Last updated 12 days ago

Platform: HTB.

Mission: Desencripte The especial message.

  • Unzip the carpet, you will have 2 files one python with the logic to encript the flag and the other with the flag encripted. descomprime la carpeta, encontraras dos archivos 1 sera el codigo python que tiene la logica de la encriptacion de la flag y la otra sera la flag encriptada.

La solución seria, cambiar la ecuacion para que la flag se otorgue en texto leible. the solution is change the ecuation so you can have the flag desencripte.

// 
fd = open(‘./msg.enc’,’r’)

secret = fd.read()
ct = bytes.fromhex(secret)

decrypted_str = “”

for char in ct:
for brute_val in range(33, 126):
if ((123 * brute_val + 18) % 256) == char:
decrypted_str += chr(brute_val)
break

print(decrypted_str)

Execute the script:

// 
HTB{l00k_47_y0u_r3v3rs1ng_3qu4710n5_c0ngr475}

Y tendriamos la flag, and we get the flag.

The content of both files.