English 中文(简体)
PHP和Appthru的外在功能?
原标题:exec function in PHP and passthru?

Hello I对PHP外围(PHP)和Appthru(PHP)。

1)
I never used exec() in PHP but I have seen it is sometimes used with imagemagick. I am now curious, what is some other common uses where exec is good in a web application?

2)
About 6 years ago when I first started playing around with PHP I did not really know anything, just very basic stuff and I had a site that got compromised and someone setup there own PHP file that was using the passthru() function to pass a bunch of traffic throught my site to download free music or video and I got hit with a 4,000$ bandwidth charge from my host! 6 years later, I know soo much more about how to use PHP but I still don t know how this ever happened to me before. How can someone beable to add a file to my server through bad code?

最佳回答

1)如果你:

A) 在服务器上操作一个程序/实用性,而站点确实拥有相应的指挥。 例如,刺).是一种通用的用途,通过外部呼吁(所有类型的媒体转换)。

B) 推进另一个非常强大的进程——你可以阻止或阻止东塔戈。 有时,你nt着一只nt子,或者类似,还有正确的花招,不阻塞。

另外一个例子是,我必须处理2.0号特别提款协议——我必须放弃我为处理这些转变而投入的小型java服务。 非常好。 PHP不支持XSLT 2.0转化。

2] Damn that s a shame. Well, lots of ways. Theres a family of vulnerability called, "remote file include vulns", that basically allow an attacker to include arbitrary source and thus execute it on your server. Take a look at: http://lwn.net/Articles/203904/

此外,如上所述,你也做了一些工作(简化了手续):

exec("someUnixUtility -f $_GET[ arg1 ]"); 

更有甚者,想象袭击者做的是,url.come?arg1=“blah;rm-rf/”,你的法典将基本oil到:

exec("someUnixUtility -f blah; rm -rf /");

哪怕是,你会单独指挥。 那么,这会造成许多损失。

Same with a file upload, imagine you strip the last four chars (.ext), to find the extension. Well, what about something like this "exploit.php.gif", then you strip the extension, so you have exploit.php and you move it into your /users/imgs/ folder. Well, all the attacker has to do now is browse to users/imgs/exploit.php and they can run any code they want. You ve been owned at that point.

问题回答

exec(>允许你使用服务器上的汇编代码,该编码的运行速度将快于所解释的网址。

因此,如果需要迅速进行大量的处理,那么<代码>exec(<>>/代码>可能有用。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...