Last active
December 22, 2016 13:52
-
-
Save suryadana/d2423af5412fc08d8e47da57a093b3ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, re | |
def main(): | |
filename = sys.argv[1] | |
chipers_gksk = open(filename, "r").read() | |
split_gksk = filename.split(".") | |
the_real_flag = "" | |
chiper = chipers_gksk | |
while True: | |
if "gksk" not in split_gksk: | |
break | |
chiper.replace("=== OWNED_BY_SIMPLEX ===\n", "").replace("\n=== END_OF_SIMPLEX ===\n", "") | |
tmp_chiper = "" | |
for c in chiper: | |
s = ord(c) | |
for i in range(0, 5): | |
s = ( s - 0x69) & 0xff | |
tmp_chiper += chr(s) | |
chiper = tmp_chiper | |
split_gksk.pop() | |
regx = re.search(r'GKSK{([a-zA-Z_]+)}', chiper) | |
print "Flag is : ", regx.group(0) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment