666  2019_UNCTF

main

int __cdecl main(int argc, const char **argv, const char **envp)
{
char myen; // [rsp+0h] [rbp-1E0h]
char myinput; // [rsp+F0h] [rbp-F0h] memset(&myen, 0, 0x1EuLL);
printf("Please Input Key: ", 0LL);
__isoc99_scanf("%s", &myinput);
encode(&myinput, &myen);
if ( strlen(&myinput) == key )
{
if ( !strcmp(&myen, enflag) )
puts("You are Right");
else
puts("flag{This_1s_f4cker_flag}");
}
return 0;
}

关键函数

int __fastcall encode(const char *myinput, char *myen)
{
char v3[32]; // [rsp+10h] [rbp-70h]
char v4[32]; // [rsp+30h] [rbp-50h]
char v5[40]; // [rsp+50h] [rbp-30h]
int v6; // [rsp+78h] [rbp-8h]
int i; // [rsp+7Ch] [rbp-4h] i = 0;
v6 = 0;
if ( strlen(myinput) != key ) // 18位
return puts("Your Length is Wrong");
for ( i = 0; i < key; i += 3 )
{
v5[i] = key ^ (myinput[i] + 6);
v4[i + 1] = (myinput[i + 1] - 6) ^ key;
v3[i + 2] = myinput[i + 2] ^ 6 ^ key;
myen[i] = v5[i];
myen[i + 1] = v4[i + 1];
myen[i + 2] = v3[i + 2];
}
return (signed int)myen;
}

wp:

#!/usr/bin/python
enflag=[105, 122, 119, 104, 114, 111, 122, 34, 34, 119,
34, 118, 46, 75, 34, 46, 78, 105, 0]
flag=''
for i in range(0,18,3):
flag+=chr((18^enflag[i])-6)
flag+=chr((18^enflag[i+1])+6)
flag+=chr(18^enflag[i+2]^6)
print(flag)

unctf{b66_6b6_66b}

攻防世界 reverse 666的更多相关文章

  1. 攻防世界 reverse 进阶 10 Reverse Box

    攻防世界中此题信息未给全,题目来源为[TWCTF-2016:Reverse] Reverse Box 网上有很多wp是使用gdb脚本,这里找到一个本地还原关键算法,然后再爆破的 https://www ...

  2. 攻防世界 reverse evil

    这是2017 ddctf的一道逆向题, 挑战:<恶意软件分析> 赛题背景: 员工小A收到了一封邮件,带一个文档附件,小A随手打开了附件.随后IT部门发现小A的电脑发出了异常网络访问请求,进 ...

  3. 攻防世界 reverse tt3441810

    tt3441810 tinyctf-2014 附件给了一堆数据,将十六进制数据部分提取出来, flag应该隐藏在里面,(这算啥子re,) 保留可显示字符,然后去除填充字符(找规律 0.0) 处理脚本: ...

  4. 攻防世界 reverse 进阶 APK-逆向2

    APK-逆向2 Hack-you-2014 (看名以为是安卓逆向呢0.0,搞错了吧) 程序是.net写的,直接祭出神器dnSpy 1 using System; 2 using System.Diag ...

  5. 攻防世界 reverse Windows_Reverse2

    Windows_Reverse2   2019_DDCTF 查壳: 寻找oep-->dump-->iat修复   便可成功脱壳 int __cdecl main(int argc, con ...

  6. 攻防世界 reverse BabyXor

    BabyXor     2019_UNCTF 查壳 脱壳 dump 脱壳后 IDA静态分析 int main_0() { void *v0; // eax int v1; // ST5C_4 char ...

  7. 攻防世界 reverse reverse-for-the-holy-grail-350

    reverse-for-the-holy-grail-350   tu-ctf-2016 程序流程很简单,就一个检验函数: 1 __int64 __fastcall stringMod(__int64 ...

  8. 攻防世界 reverse parallel-comparator-200

    parallel-comparator-200 school-ctf-winter-2015 https://github.com/ctfs/write-ups-2015/tree/master/sc ...

  9. 攻防世界 reverse 进阶 8-The_Maya_Society Hack.lu-2017

    8.The_Maya_Society Hack.lu-2017 在linux下将时间调整为2012-12-21,运行即可得到flag. 下面进行分析 1 signed __int64 __fastca ...

随机推荐

  1. value-key

    value-key object 如果 Select 的绑定值为对象类型,请务必指定 value-key 作为它的唯一性标识. value-key 作为 value 唯一标识的键名,绑定值为对象类型时 ...

  2. Electron Security All In One

    Electron Security All In One https://www.electronjs.org/docs/tutorial/security CSP Content-Security- ...

  3. reStructuredText(.rst) && read the docs

    Read the Docs   &&  reStructuredText (.rst)  && markdown 1. github master 分支,创建 docs ...

  4. TypeScript 面试题汇总(2020 版)

    TypeScript 面试题汇总(2020 版) TypeScript 3.9 https://www.typescriptlang.org/zh/ TypeScript 4.0 RC https:/ ...

  5. iOS effect & swiper delete components

    iOS effect & swiper delete components mint-ui & cell-swipe https://elemefe.github.io/mint-ui ...

  6. js binary search algorithm

    js binary search algorithm js 二分查找算法 二分查找, 前置条件 存储在数组中 有序排列 理想条件: 数组是递增排列,数组中的元素互不相同; 重排 & 去重 顺序 ...

  7. Flutter & UI system & GUI & API & SDK

    Flutter & UI system & GUI & API & SDK https://book.flutterchina.club/chapter14/flutt ...

  8. Taro 版本

    Taro 版本 https://taro-docs.jd.com/taro/versions.html 1.x 1.3.34 https://taro-docs.jd.com/taro/docs/1. ...

  9. js 使用socket-io发送文件

    更多 前端 import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'; import { MediaDevice ...

  10. 「NGK每日快讯」2021.2.7日NGK公链第96期官方快讯!