2023-09-10

web2

image.png

GFSJ0627积分 2金币 2

91最佳Writeup由 Robert_Wei 提供

收藏

反馈

难度:2

方向:Web

题解数:108

解出人数:10185

题目来源: CTF

题目描述:

解密

题目场景:

http://61.147.171.105:56591

100%

倒计时: 35918

<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n24" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; margin-top: 0px; margin-bottom: 20px; font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; white-space: normal; background-color: rgb(51, 51, 51); position: relative !important; padding: 10px 10px 10px 30px; width: inherit; caret-color: rgb(184, 191, 198); color: rgb(184, 191, 198); font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><?php
$miwen="a1zLbgQsCESEIqRLwuQAyMwLyq2L5VwBxqGA3RQAyumZ0tmMvSGM2ZwB4tws";

function encode(str){_o=strrev(str); // echo_o;

for(_0=0;_0<strlen(_o);_0++){

_c=substr(o,_0,1);_=ord(_c)+1;c=chr(__);=_.c;
}
return str_rot13(strrev(base64_encode($
)));
}

highlight_file(FILE);
/*
逆向加密算法,解密$miwen就是flag
*/
?> </pre>

get the flag

`

<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="php" cid="n37" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; margin-top: 0px; margin-bottom: 20px; font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; white-space: normal; background-color: rgb(51, 51, 51); position: relative !important; padding: 10px 10px 10px 30px; width: inherit; caret-color: rgb(184, 191, 198); color: rgb(184, 191, 198); font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><?php
miwen="a1zLbgQsCESEIqRLwuQAyMwLyq2L5VwBxqGA3RQAyumZ0tmMvSGM2ZwB4tws"; echomiwen;
function encode(str){_o=strrev(str); echo_o;

for(_0=0;_0<strlen(_o);_0++){

_c=substr(o,_0,1);_=ord(_c)+1;c=chr(__);=_.c;
}
return str_rot13(strrev(base64_encode($
)));
}

//highlight_file(FILE);
/*
逆向加密算法,解密miwen就是flag */ echo "\n"; echo "test:"; echo encode("123");str = "Uryyb Jbeyq!";
str_rot13 = str_rot13(str);
echo "\n";
echo $str_rot13; // 输出 "Hello World!"

echo "\n";
echo str_rot13(miwen); echo "\n"; echo strrev(str_rot13(miwen));
echo "\n";
echo base64_decode( strrev(str_rot13($miwen)) );

_o=base64_decode( strrev(str_rot13(miwen)) );

for(_0=0;_0<strlen(_o);_0++){

_c=substr(o,_0,1);_=ord(_c)-1;c=chr(__);=_._c;
}

echo "\n";
echo _; echo "\n"; echo strrev(_);

?> </pre>

`

using vscode

<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="" cid="n43" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; margin-top: 0px; margin-bottom: 20px; font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; white-space: normal; background-color: rgb(51, 51, 51); position: relative !important; padding: 10px 10px 10px 30px; width: inherit; caret-color: rgb(184, 191, 198); color: rgb(184, 191, 198); font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">a1zLbgQsCESEIqRLwuQAyMwLyq2L5VwBxqGA3RQAyumZ0tmMvSGM2ZwB4tws
test:321lZQA
Hello World!
n1mYotDfPRFRVdEYjhDNlZjYld2Y5IjOkdTN3EDNlhzM0gzZiFTZ2MjO4gjf
fjg4OjM2ZTFiZzg0MzhlNDE3NTdkOjI5Y2dlYjZlNDhjYEdVRFRPfDtoYm1n
~88:36e1bg8438e41757d:29cgeb6e48c`GUDTO|;hbmg
}77925d0af7327d30646c918bfda5d37b_FTCSN{:galf
flag:{NSCTF_b73d5adfb819c64603d7237fa0d52977}

</pre>

[图片上传失败...(image-ef16d0-1694359898826)]

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 本文内容较长,如有被截断或缺失,请参考原文:PHP函数参考24-常用字符串函数 - 9ong[http://www...
    思考的山羊阅读 2,958评论 0 0
  • php usleep() 函数延迟代码执行若干微秒。 unpack() 函数从二进制字符串对数据进行解包。 uni...
    思梦PHP阅读 6,187评论 1 24
  • 这周还是看web题,打开这道题,界面如下 有界面可知道这是个php自定义加密函数,只要写出相应的解密算法就行。简单...
    UponThe11Air阅读 2,481评论 0 0
  • addcslashes()返回在指定的字符前添加反斜杠的字符串。 addslashes()返回在预定义的字符前添加...
    R满目山河阅读 1,778评论 0 1
  • 总结了一些开发中常用的函数: usleep() //函数延迟代码执行若干微秒。 unpack() //函数从二进制...
    ADL2022阅读 3,375评论 0 3

友情链接更多精彩内容