Coder Social home page Coder Social logo

htb_passage's Introduction

HTB_Passage

Hello everyone, here we will consider the solution of the Passage machine, which can be found on the special platform Hack The Box. Well, below is a description of the machine itself and its specific parameters, including the ip-address.

Screenshot_1

Machine solution (GET USER)

Progress:

  1. First you need to take a user. More precisely, log into the servers under the login of an existing user, thereby gaining access to some services.
  2. First, we connect openvpn in my case it is
      $ sudo openvpn <your creds>.ovpn
  1. We have an existing ip address 10.10.10.206, go to it and see a regular news site

unnamed

  1. I make a header (the header includes viewing directories through dirsearch and viewing open ports using nmap), the search results are small, but at least something:
    • ssh port 22 is open
    • there is port 80 http where the site is located
    • dirsearch gave nothing
  2. I start looking at what is interesting on the site, and I see that there is a news service with a flat file system CuteNews, well, then on a whim I decide to drive CuteNews into the directory of the site, voila, we have an entrance and registration for this service

unnamed1

  1. At first I spent a lot of time on brute-force login and password, but in the end I decided to just register, then I go into personal settings and see that there is a file upload, which is very often a big vulnerability ... well, here we have, as it were, php, which means ideas here you can throw php code ...
  2. In general, I wrote a one-line php code that sets a request for a shell command:

unnamed2

  1. Next, I upload this php code to uploads, and look for myself, after which I write a command for the shell

unnamed3 unnamed4

  1. Ok, I was able to see with the bash command who I am and ls files, so logically I can do a reverse shell, do ... We get access to the server in 2 steps:

unnamed5

Step 1

unnamed6

Step 2

As a result, we throw the reverse shell, now we are on the server side, congratulations, but this is just the beginning.

  1. And so we are on the server, but as web-data, we are still nobody, but this will change soon, then the routine work begins, browsing directories and looking for something interesting ....

unnamed7

After 2.5 hours, I came across the www directory:

unnamed8

After going through some files, I came to the b0.php file

unnamed9

Looking at the structure of the cipher, I immediately realized that it was base64, as a result of which I used the site decoder ...

unnamed10

There is a hash password inside, there is even this written there, I also google the hash decode site and this result comes out ...

unnamed11

Login: paul

Password: atlanta1

  1. It remains only to log in as a user

unnamed12

We are in the system!

Machine solution (GET ROOT)

Progress:

  1. I start to browse the paul directory, very quickly find the right .shh directory with the command to show hidden files and directories ...

unnamed13

Lo and behold, this folder has id_rsa with which I can connect to another user - nadav

unnamed14

now I'm logged in as another user, let's see what we find here ...

  1. After several hours of searching directories for information, I still decided to look at the process history using the ps auwx command

unnamed15

Next, I search for interesting completed processes from root, I found a strange process

unnamed16

usb-creator-helper, I go to google and find the first article I see on privilege escalation with usb-creator link:

  1. After reading the articles, I understood the general principle of the vulnerability and was able to exploit it using a ready-made example from the article ...

Further, it was simply possible to use root id_rsa to connect to root using ssh. A couple of clicks and we are in the system as root.

unnamed17

Here is our flag comrades!

htb_passage's People

Contributors

sakyra01 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.