Description
For this challenge, we need to reverse a briefly obfuscated python script to find an input value that will validate some conditions to get the flag.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | from binascii import unhexlify as sOup
from operator import attrgetter as souP
ME_FLAGE = 'censored'
SoUp = input
soUP = hex
sOUp = print
sOuP = ord
SOuP = open
def SoUP(sOUP):
soup = 0
while sOUP ! = 0 :
soup = (soup * 10 ) + (sOUP % 10 )
sOUP / / = 10
return soup
def SOup(sOUP):
soup = 0
for soUp in sOUP:
soup * = 10
soup + = sOuP(soUp) - sOuP( '0' )
return soup
def SOUP():
Soup = SoUp()[: 7 ]
print (Soup)
if not souP( 'isdigit' )(Soup)():
sOUp( "that's not a number lol" )
return
soup = SoUP(SOup(Soup))
SouP = souP( 'zfill' )(soUP(soup)[ 2 :])( 8 )[ - 8 :]
if sOup(SouP) = = souP( 'encode' )( 's0up' )():
sOUp( "oh yay it's a flag!" , ME_FLAGE)
else :
sOUp( 'oh noes rip u' )
if __name__ = = '__main__' :
SOUP()
|
Continue reading [EasyCTF 2018] [Reverse 150 – Soupstitution Cipher] Write Up →