PGP Target Photographer

120 阅读1分钟

本文已参与「新人创作礼」活动,一起开启掘金创作之路

A few days long , I don't write something about OSCP test . So I decide to write two passage today about these days I do .

Enum

image-20220327093459653.png

Nmap showed the machine servered ssh , web , SMB and something else on 8000 .

80 port

image-20220327093837503.png

When I viewed index of the website , I found it just a html site , and there was not much point waiting me to test . So I used dirsearch , but also found nothing instead of many useless js file .

445 & 139 port

I found a new smb scaner enum4linux , and it could be used easily .

enum4linux 192.168.248.76

And I was told this smb server could be logged into by anonymity without password . Besides It gave me a smbshare path .

image-20220327093336713.png

So I used smbclient to login and tried to find some in it .

image-20220327095112570.png

There wae a mail bak in the share path . And I showed me some inportant informationes . Daisa , daisa@photographer.com and my babygirl :)

8000 port

image-20220327095428150.png

This was a Koken CMS . And i found there was a file upload exploit in searchsploit

image-20220327095609591.png

If I wanted to use it I had to found a log panel and logged in it .

So I used dirsearch again and found /admin path .

image-20220327100022956.png

Now let's start our harking .

Shell as www

Firstly , I used daisa@photographer.com:babygirl to log into the system and found the "import content" bottom mentioned in exp .

image-20220327100439524.png

I uploaded a php shell code as jpg and changed it back to php in burpsuite

image-20220327101233805.png

And I got the shell as www .

image-20220327102209799.png

Shell as root

As I searched suid process , I found php was gave suid so it's very easy to get the root shell .

image-20220327102550402.png

php -r "pcntl_exec('/bin/sh', ['-p']);"

And again I got the shell as root .

image-20220327102853084.png

After root

When I viewed 8000 port , here was more than 30 seconds to open one page because this site used google api to speed up the load speed . However , I could not visit google in China . If you have the same problem like me , I suggest you to use this justjavac/ReplaceGoogleCDN: 一个 Chrome 插件:将 Google CDN 替换为国内的。 (github.com)