zoukankan      html  css  js  c++  java
  • 攻防世界-ey-or

    记录一下特征吧

    Elymas语言编写。谁会啊、、、、、

    strings命令;

    编译后:

      

    secret = [ ???? ]
    f = [ ???? ]
    l = len(secret)
    buffer = []
    i = 0
    j = 0
    print "Enter Password line by line"
    for line in sys.stdin.readlines():
        j = read_int(line)
        buffer = buffer + [j]
        if secret[i] != j:
            sys.exit(1)
        i += 1
        if i == l:
            print to_string(map(lambda x,y: x^y, buffer, f))
            sys.exit(0)
    python脚本:
    import sys
    import subprocess
    
    ans = []
    while True:
        for j in range(256):
            if j % 16 == 15:
                print j
            p = subprocess.Popen("./ey_or.elf", stdin=subprocess.PIPE, stdout=subprocess.PIPE)
            for x in ans:
                p.stdin.write(str(x) + '
    ')
            p.stdin.write(str(j) + '
    ')
            p.stdin.close()
            ret = p.wait()
            if ret != 1:
                ans.append(j)
                print ans
                break

    import sys
    import subprocess

    s = [36, 30, 156, 30, 43, 6, 116, 22, 211, 66, 151, 89, 36, 82, 254, 81, 182, 134, 24, 90, 119, 6, 88, 137, 64, 197, 251, 15, 116, 220, 161, 94, 154, 252, 139, 11, 41, 215, 27, 158, 143, 140, 54, 189, 146, 48, 167, 56, 84, 226, 15, 188, 126, 24]

    ans = []


    p = subprocess.Popen("./ey_or.elf", stdin=subprocess.PIPE, stdout=subprocess.PIPE)
    for x in s:
    p.stdin.write(str(x) + ' ')
    p.stdin.close()
    print p.stdout.read()



    得到flag。
     
  • 相关阅读:
    动手动脑3
    AWK编程与应用
    BASH内置变量的使用
    服务器交互脚本expect
    编程对话框的界面程序
    每日打卡
    AppiumLibrary中文翻译
    Bootstrap4简单使用
    Python基础06-类与对象
    BDD模式-Python behave的简单使用
  • 原文地址:https://www.cnblogs.com/whitehawk/p/11628025.html
Copyright © 2011-2022 走看看