Jump to content

Title: See how I get the server of BC station

Featured Replies

Posted

1. Information collection

Getting the target website shows that it is a very conventional BC site.

First, simple information collection can be carried out, and the two more important information of PHP version and Windows serving can be seen through the Wappalyzer plug-in.

图片 Command line nslookup+url to view ip, found no CDN

图片 Go to Love Station to take a look

图片 Well, Cambodia is OK

After knowing the IP address, the port scan is one wave (full port scan + service detection. This process is relatively long, you can do something else first)

图片

After scanning, try to connect to the remote desktop 3389 (because I already saw that it is a server that is Windows serving at the beginning)

图片 Tried twice, guessing that the port has been modified, or the login IP whitelist?

2. Backstage blast

Back to the web, add an admin after the url with the backhand

图片 The backend came out, this BC is a bit miserable, I randomly tested a few weak passwords, but it was fruitless

I found that there was no verification code to verify, and I caught the packet and exploded.

图片 It is enough to find some conventional weak passwords to blast them.

图片 password is released in seconds: 123456, I vomited, their operation and maintenance may be beaten to death

图片 图片

3. Find upload points

We will certainly not be satisfied if we take down the backend so simply.

I roughly browsed the various functions of the background, looked for places to use, and found an upload point in the system management office

图片 (Did my cousin send a receipt code to you? The opportunity to get rich is here!)

Write a sentence casually, change the suffix to .jpg and grab the packet and send it to Repeater for viewing

图片 prompts "not the real image type", change it to the php suffix in the package, prompting for illegal file type

图片 It feels like a whitelist + file header verification, try picture horse

图片 tried several waves, the whitelist was restricted very seriously, and it was not around.

It was suddenly in a deadlock, so it would be better to find another breakthrough

IV. Peak and loop turn

I thought about it carefully. It is Windows, and Windows' mainstream website building tools, pagodas, guard gods, phpstudy, and upupw. I saw that its php version was 5.2.17 before, and I happened to think of the two backdoors of phpstudy that broke out some time ago. The backdoors exist in the two versions of php-5.4.45 and php-5.2.17. Test it now

图片 图片 Accept-Encoding: gzip, deflate, delete the spaces in the middle of gzip and deflate in the request package

And add a sentence below: Accept-Charset:+ base64 encoding of the command executed

I was shocked. I really used phpstudy to build a website. The webmaster is too worried. The next thing will be much easier.

5. Ant Sword has no file shell connection

图片 remember to change the encoder to base64

Then base64 encoding a sentence and copy it to the back of Accept-Charset:

图片 Modify the request information in the ant sword, and modify the header head as shown below

图片 Test connection, successfully connected

图片 图片 Found out that it is SYSTEM permission directly, which is fun

6. Upload mimikatz to grab Hash

图片 Create a new directory and upload winrar.exe+mimikatz

图片Use the uploaded winrar to decompress, command: winrar.exe e x64.rar

图片 Run mimi.bat, let me talk about it here that it is best to add an exit after the image below, otherwise mimikatz will keep writing logs, causing the log file to grow larger and larger. I made such a mistake at that time.

图片 图片 Copy the generated mimikatz.log to the root directory of the website, and then go to view it

图片 Successfully captured the administrator's RDP password.

Looking back at the full port I scanned before, I also scanned it

图片 shows that there are three ports open in total, and generally, port 3389 is changed. After using nmap to scan and add the -sV parameter, the scanned rdp service will generally be displayed as ssl/unknown.

Try a remote desktop connection

图片 Hehehe, logged in successfully, took down the server, then lit a cigarette, packed all the evidence, took out the phone and called 110

7. Summary

When we get the webshell, if we want to obtain data or source code, we often use kitchen knife or ant sword to package it, but at this time, many problems often occur, such as failure in packaging, or incomplete packaging, etc.

At this time, if the other party is a Windows server, we can upload the locally installed winrar.exe in it.

图片 The dat folder under the compression disk and named bat.rarwinrar.exe a -ag -k -r -s -ibck c:/bak.rar c:/dat/

Compress multiple files winrar a -ag -ibck bak.rar filename1 filename2 filename.

Parameter description: a: backup all files; -ag: When creating a compressed file, attach the current date string in the format "YYYYMMDDHHMMSS" and the file name bakYYYYMMDDHHMMSS.rar; -k: locks the compressed file; -r: backup directory and subdirectories; -s: creates solid compressed file; -ibck: runs in the background;

filename1: The file name to be compressed can be multiple, or the wildcard file* can be used.

Reprinted in the original link address: https://mp.weixin.qq.com/s?__biz=Mzg2NDYwMDA1NA==mid=2247485789idx=2sn=a1a3c9fc97eeab0b5e5bd3d311e3fae6chksm=ce67a3c4f9102ad21ce5c895d364b4d094391d2369edfc3afce63ed0b155f8db1c86fa6924f1scene=21#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Important Information

HackTeam Cookie PolicyWe have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.