首页 > 其他分享 >Reverse|Buuctf reverse1

Reverse|Buuctf reverse1

时间:2023-05-06 14:37:00浏览次数:38  
标签:sub Buuctf Reverse 48 Str2 char flag 111 reverse1

查看程序信息

Detect It Easy查看程序信息,发现是64位应用且未加壳

反编译文件

使用IDA打开,shift+f12检索程序里的字符串,发现this is the right flag!,双击查看,发现被main_0函数引用

双击main_0函数查看

F5查看伪代码

int __cdecl main_0(int argc, const char **argv, const char **envp)
{
  char *v3; // rdi
  __int64 i; // rcx
  size_t v5; // rax
  char v7; // [rsp+0h] [rbp-20h] BYREF
  int j; // [rsp+24h] [rbp+4h]
  char Str1[224]; // [rsp+48h] [rbp+28h] BYREF
  __int64 v10; // [rsp+128h] [rbp+108h]

  v3 = &v7;
  for ( i = 82i64; i; --i )
  {
    *(_DWORD *)v3 = -858993460;
    v3 += 4;
  }
  for ( j = 0; ; ++j )
  {
    v10 = j;
    if ( j > j_strlen(Str2) )
      break;
    if ( Str2[j] == 111 )
      Str2[j] = 48;
  }
  sub_1400111D1("input the flag:");
  sub_14001128F("%20s", Str1);
  v5 = j_strlen(Str2);
  if ( !strncmp(Str1, Str2, v5) )
    sub_1400111D1("this is the right flag!\n");
  else
    sub_1400111D1("wrong flag\n");
  return 0;
}

通过 if ( !strncmp(Str1, Str2, v5) ),可以发现当输入的字符str1与预定的字符str2相等就为正确的flag
双击str2发现str2为{hello_world},所以flag为{hello_world},但是输入提示错误

再查看伪代码发现以下代码,这里将str2中的111替换为了48,这里看不懂111和48是什么

if ( Str2[j] == 111 )
      Str2[j] = 48;

这是111和48为int,是asicc码,使用快捷键R转换一下

可以看出这里是将o替换为了0,所以可以得出flag

flag{hell0_w0rld}

标签:sub,Buuctf,Reverse,48,Str2,char,flag,111,reverse1
From: https://www.cnblogs.com/scarecr0w7/p/17377206.html

相关文章

  • Reverse|[GXYCTF2019]luck_guy
    ida64打开文件,搜索字符串进入pleaseinputaluckynumber伪代码输入数字进入patch_me(v4);,输入数字为偶数进入get_flag()函数unsigned__int64get_flag(){unsignedintv0;//eaxcharv1;//alsignedinti;//[rsp+4h][rbp-3Ch]signedintj;//[rsp......
  • Web|Buuctf-[NPUCTF2020]ezinclude
    查看源码提示md5($secret.$name)===$passcookie中存在hash,hash随着name的变化而变化hash填入pass参数请求跳转到404页面使用burpsuite发包,提示存在flflflflag.php页面flag不在此页面,并且页面存在文件包含漏洞读取flflflflag.php页面源码<html><head><scriptlangua......
  • Web|Buuctf [NCTF2019]SQLi
    直接给出了查询语句select*fromuserswhereusername=''andpasswd=''构造语句查询,发现有过滤fuzz一下,很多参数都被过滤robots协议下发现hint.txt文件hint.txt文件,有被过滤的参数,但是没有过滤"、|和\,并且提示只要密码与admin的密码相同就可以获得flag解题思路无......
  • Reverse|[ACTF新生赛2020]easyre
    DiE查询发现是UPX加壳,使用工具拆壳./upx-dfile.exe32位程序使用ida32打开找到关键代码int__cdeclmain(intargc,constchar**argv,constchar**envp){charv4;//[esp+12h][ebp-2Eh]charv5;//[esp+13h][ebp-2Dh]charv6;//[esp+14h][ebp-2Ch]c......
  • Reverse|[GWCTF 2019]pyre
    pyc文件反编译uncompyle6-opcat.pyattachment.pycpcat.py#uncompyle6version3.8.0#Pythonbytecode2.7(62211)#Decompiledfrom:Python3.10.6(main,Aug302022,04:58:14)[Clang13.1.6(clang-1316.0.21.2.5)]#Embeddedfilename:encode.py#Compiled......
  • Reverse|Buuctf 简单注册器
    反编译apk文件,搜索flag找到关键代码publicvoidonClick(Viewparam1View){byteb=1;Stringstr=editview.getText().toString();if(str.length()!=32||str.charAt(31)!='a'||str.charAt(1)!='b'||str.ch......
  • Misc|Buuctf 喵喵喵
    查看exif信息无内容,binwalk查看拼接文件也无内容,使用zsteg有内容,说明有lsb隐写内容,使用StegSolve查看发现RGB0通道异常使用DataExtract模式查看,发现存在LSB隐写,隐写有一张图片,另存为图片但是无法打开使用010editor打开,发现文件头不正确,删除多余文件头,打开为半张二维码使用......
  • C++黑马程序员——P251-254. 常用排序算法 sort,random_shuffle,merge,reverse
    P251.常用排序算法——sortP252....——random_shuffleP253....——mergeP254....——reverseP251.sort  1#include<iostream>2#include<vector>3#include<algorithm>4#include<functional>//用greater5usingnamespacest......
  • [网络安全]BurpSuite爆破实战解题详析之BUUCTF Brute 1
    免责声明:本文仅分享AntSword渗透相关知识,不承担任何法律责任。请读者自行安装BurpSuite,本文不再赘述。在用户名和密码都未知的情况下,进行用户名、密码的组合爆破,效率极低。先爆破用户名,再利用得到的用户名爆破密码,将提高爆破速度。BUUCTFBrute1题目操作Burp抓包单独......
  • [Javascript] Avoid mutation, Array.prototype.toReversed() vs reverse()
    reverse()mutatestheoriginalarray,returnthereferencepointtotheoriginalarray.The toReversed() methodof Array instancesisthe copying counterpartofthe reverse() method.Itreturnsanewarraywiththeelementsinreversedorder.constite......