在一个大佬的突然丢了个题过来,于是去玩了玩rce的两道题

 大佬的博客跳转链接在此-》》》大佬召唤机

CTFHub web技能树之RCE初步  命令注入+过滤cat

 

 

 

一上来就是源码出现,上面有个ping的地方

 

<?php

$res = FALSE;

if (isset($_GET['ip']) && $_GET['ip']) {
    $cmd = "ping -c 4 {$_GET['ip']}";
    exec($cmd, $res);
}

?>

<!DOCTYPE html>
<html>
<head>
    <title>CTFHub 命令注入-无过滤</title>
</head>
<body>

<h1>CTFHub 命令注入-无过滤</h1>

<form action="#" method="GET">
    <label for="ip">IP : </label><br>
    <input type="text" id="ip" name="ip">
    <input type="submit" value="Ping">
</form>

<hr>

<pre>
<?php
if ($res) {
    print_r($res);
}
?>
</pre>

<?php
show_source(__FILE__);
?>

</body>
</html>
View Code

相关文章: