Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

没有 BUG 的教务系统 第一问 粗略脚本 #20

Open
1847905557 opened this issue Oct 22, 2019 · 2 comments
Open

没有 BUG 的教务系统 第一问 粗略脚本 #20

1847905557 opened this issue Oct 22, 2019 · 2 comments
Labels

Comments

@1847905557
Copy link

虽然的确简单,但是wp里一句话略过还是有点点草率
这里提供一个闭着眼睛两分钟敲出来的解题脚本的核心部分

    char temp_password[9];
    char Upassword[] = {68, 0, 2, 65, 67, 71, 16, 99, 0};
    temp_password[8] = '\x00';
    int i;
    for (i = 7; i >= 0; --i) {
        for(int ii = 48;ii <= 123;ii++) {
            temp_password[i] = ii;
            temp_password[i] =
                    ((temp_password[i] | temp_password[i + 1]) & ~(temp_password[i] & temp_password[i + 1]) | i) &
                    ~((temp_password[i] | temp_password[i + 1]) & ~(temp_password[i] & temp_password[i + 1]) & i);
            if (temp_password[i] == Upassword[i]) {
                temp_password[i] = ii;
                printf("%c", ii);
                break;
            }
        }
    }

那么它最主要地 有什么不好呢?
输出的结果是反着的

@zzh1996
Copy link
Member

zzh1996 commented Oct 22, 2019

import angr

proj = angr.Project("EasyCPP")
simgr = proj.factory.simgr()
simgr.explore(find=lambda s: b"Welcome! Admin!" in s.posix.dumps(1))
print(simgr.found[0].posix.dumps(0).decode())

输出:

admin
p455w0rd

@Roarcannotprogramming
Copy link
Member

Roarcannotprogramming commented Oct 22, 2019

官方提供的脚本在exp0.py中,并不是因为题目简单所以没有提供脚本。
感谢你提供的你的脚本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants