<?php
#flag in http://192.168.7.68/flag
if(isset($_GET['url'])){
$url = $_GET['url'];
$protocol = substr($url, 0,7);
if($protocol!='http://'){
die('仅限http协议访问');
}
if(preg_match('/\.|\;|\||\<|\>|\*|\%|\^|\(|\)|\#|\@|\!|\`|\~|\+|\'|\"|\.|\,|\?|\[|\]|\{|\}|\!|\&|\$|0/', $url)){
die('仅限域名地址访问');
}
system('curl '.$url);
}
分析代码得知:
⚪必须以get形式传入$url
⚪$url的前七位必须是http://
⚪$url的值必须是http://192.168.7.68/flag
想到可以对ip进行进制转换:

: (非常不凑巧preg_match过滤了0。
后来查找资料学到了一个知识点,“.”可以用“。”进行代替:
http://192。168。7。68/flag
⚪参考: