ÔÚPHPÖÐÖ´ÐÐϵͳÍⲿÃüÁî
×÷Õß ØýÃû¼¼Êõ
À´Ô´ NET±à³Ì
ä¯ÀÀ
·¢²¼Ê±¼ä 2012-05-25
PHP×÷ΪһÖÖ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ£¬Ïó±àд¼òµ¥£¬»òÕßÊǸ´ÔӵĶ¯Ì¬ÍøÒ³ÕâÑùµÄÈÎÎñ£¬ËüÍêÈ«Äܹ»Ê¤ÈΡ£µ«ÊÂÇé²»×ÜÊÇÈç´Ë£¬ÓÐʱΪÁËʵÏÖij¸ö¹¦ÄÜ£¬±ØÐë½èÖúÓÚ²Ù×÷ϵͳµÄÍⲿ³ÌÐò£¨»òÕß³Æ֮ΪÃüÁ£¬ÕâÑù¿ÉÒÔ×öµ½Ê°빦±¶¡£ ÄÇô£¬ÊÇ·ñ¿ÉÒÔÔÚPHP½Å±¾Öе÷ÓÃÍⲿÃüÁîÄØ£¿Èç¹ûÄÜ£¬ÈçºÎÈ¥×öÄØ£¿ÓÐЩʲô·½ÃæµÄ¹ËÂÇÄØ£¿ÏàÐÅÄã¿´Á˱¾Îĺ󣬿϶¨Äܹ»»Ø´ðÕâЩÎÊÌâÁË¡£ ÊÇ·ñ¿ÉÒÔ£¿ ´ð°¸Êǿ϶¨µÄ¡£PHPºÍÆäËüµÄ³ÌÐòÉè¼ÆÓïÑÔÒ»Ñù£¬ÍêÈ«¿ÉÒÔÔÚ³ÌÐòÄÚµ÷ÓÃÍⲿÃüÁ²¢ÇÒÊǺܼòµ¥µÄ£ºÖ»ÒªÓÃÒ»¸ö»ò¼¸¸öº¯Êý¼´¿É¡£ Ç°ÌáÌõ¼þ ÓÉÓÚPHP»ù±¾ÊÇÓÃÓÚWEB³ÌÐò¿ª·¢µÄ£¬ËùÒÔ°²È«ÐÔ³ÉÁËÈËÃÇ¿¼ÂǵÄÒ»¸öÖØÒª·½Ãæ¡£ÓÚÊÇPHPµÄÉè¼ÆÕßÃǸøPHP¼ÓÁËÒ»¸öÃÅ£º°²È«Ä£Ê½¡£Èç¹ûÔËÐÐÔÚ°²È«Ä£Ê½Ï£¬ÄÇôPHP½Å±¾Öн«Êܵ½ÈçÏÂËĸö·½ÃæµÄÏÞÖÆ£º Ö´ÐÐÍⲿÃüÁî ÔÚ´ò¿ªÎļþʱÓÐЩÏÞÖÆ Á¬½ÓMySQLÊý¾Ý¿â »ùÓÚHTTPµÄÈÏÖ¤ ÔÚ°²È«Ä£Ê½Ï£¬Ö»ÓÐÔÚÌض¨Ä¿Â¼ÖеÄÍⲿ³ÌÐò²Å¿ÉÒÔ±»Ö´ÐУ¬¶ÔÆäËü³ÌÐòµÄµ÷Óý«±»¾Ü¾ø¡£Õâ¸öĿ¼¿ÉÒÔÔÚphp.iniÎļþÖÐÓÃsafe_mode_exec_dirÖ¸Á»òÔÚ±àÒëPHPÊǼÓÉÏ--with-exec-dirÑ¡ÏîÀ´Ö¸¶¨£¬Ä¬ÈÏÊÇ/usr/local/php/bin¡£ Èç¹ûÄãµ÷ÓÃÒ»¸öÓ¦¸Ã¿ÉÒÔÊä³ö½á¹ûµÄÍⲿÃüÁÒâ˼ÊÇPHP½Å±¾Ã»ÓдíÎ󣩣¬µÃµ½µÄÈ´ÊÇһƬ¿Õ°×£¬ÄÇôºÜ¿ÉÄÜÄãµÄÍø¹ÜÒѾ°ÑPHPÔËÐÐÔÚ°²È«Ä£Ê½ÏÂÁË¡£ ÈçºÎ×ö£¿ ÔÚPHPÖе÷ÓÃÍⲿÃüÁ¿ÉÒÔÓÃÈçÏ**ýÖÖ·½·¨À´ÊµÏÖ£º 1£© ÓÃPHPÌṩµÄרÃź¯Êý PHPÌṩ¹²ÁË3¸öרÃŵÄÖ´ÐÐÍⲿÃüÁîµÄº¯Êý£ºsystem()£¬exec()£¬passthru()¡£ system() ÔÐÍ£ºstring system (string command [, int return_var]) system()º¯ÊýºÜÆäËüÓïÑÔÖеIJ¶à£¬ËüÖ´Ðиø¶¨µÄÃüÁÊä³öºÍ·µ»Ø½á¹û¡£µÚ¶þ¸ö²ÎÊýÊÇ¿ÉÑ¡µÄ£¬ÓÃÀ´µÃµ½ÃüÁîÖ´ÐкóµÄ״̬Âë¡£ Àý×Ó£º <? system("/usr/local/bin/webalizer/webalizer"); ?> exec() ÔÐÍ£ºstring exec (string command [, string array [, int return_var]]) exec()º¯ÊýÓësystem()ÀàËÆ£¬Ò²Ö´Ðиø¶¨µÄÃüÁµ«²»Êä³ö½á¹û£¬¶øÊÇ·µ»Ø½á¹ûµÄ×îºóÒ»ÐС£ËäÈ»ËüÖ»·µ»ØÃüÁî½á¹ûµÄ×îºóÒ»ÐУ¬µ«Óõڶþ¸ö²ÎÊýarray¿ÉÒԵõ½ÍêÕûµÄ½á¹û£¬·½·¨Êǰѽá¹ûÖðÐÐ×·¼Óµ½arrayµÄ½áβ´¦¡£ËùÒÔÈç¹ûarray²»Êǿյģ¬ÔÚµ÷ÓÃ֮ǰ×îºÃÓÃunset()×îËüÇåµô¡£Ö»ÓÐÖ¸¶¨Á˵ڶþ¸ö²ÎÊýʱ£¬²Å¿ÉÒÔÓõÚÈý¸ö²ÎÊý£¬ÓÃÀ´È¡µÃÃüÁîÖ´ÐеÄ״̬Âë¡£ Àý×Ó£º <? exec("/bin/ls -l"); exec("/bin/ls -l", $res); #$resÊÇÒ»¸öÊý¾Ý£¬Ã¿¸öÔªËØ´ú±í½á¹ûµÄÒ»ÐÐ exec("/bin/ls -l", $res, $rc); #$rcµÄÖµÊÇÃüÁî/bin/ls -lµÄ״̬Âë¡£³É¹¦µÄÇé¿öÏÂͨ³£ÊÇ0 ?> passthru() ÔÐÍ£ºvoid passthru (string command [, int return_var]) passthru()Ö»µ÷ÓÃÃüÁ²»·µ»ØÈκνá¹û£¬µ«°ÑÃüÁîµÄÔËÐнá¹ûÔÑùµØÖ±½ÓÊä³öµ½±ê×¼Êä³öÉ豸ÉÏ¡£ËùÒÔpassthru()º¯Êý¾³£ÓÃÀ´µ÷ÓÃÏópbmplus£¨UnixϵÄÒ»¸ö´¦ÀíͼƬµÄ¹¤¾ß£¬Êä³ö¶þ½øÖƵÄÔʼͼƬµÄÁ÷£©ÕâÑùµÄ³ÌÐò¡£Í¬ÑùËüÒ²¿ÉÒԵõ½ÃüÁîÖ´ÐеÄ״̬Âë¡£ Àý×Ó£º <? header("Content-type: image/gif"); passthru("./ppmtogif hunte.ppm"); ?> 2£© ÓÃpopen()º¯Êý´ò¿ª½ø³Ì ÉÏÃæµÄ·½·¨Ö»Äܼòµ¥µØÖ´ÐÐÃüÁȴ²»ÄÜÓëÃüÁî½»»¥¡£µ«ÓÐЩʱºò±ØÐëÏòÃüÁîÊäÈëһЩ¶«Î÷£¬ÈçÔÚÔö¼ÓLinuxµÄϵͳÓû§Ê±£¬Òªµ÷ÓÃsuÀ´°Ñµ±Ç°Óû§»»µ½root²ÅÐУ¬¶øsuÃüÁî±ØÐëÒªÔÚÃüÁîÐÐÉÏÊäÈërootµÄÃÜÂë¡£ÕâÖÖÇé¿öÏ£¬ÓÃÉÏÃæÌáµ½µÄ·½·¨ÏÔÈ»ÊDz»Ðеġ£ popen()º¯Êý´ò¿ªÒ»¸ö½ø³Ì¹ÜµÀÀ´Ö´Ðиø¶¨µÄÃüÁ·µ»ØÒ»¸öÎļþ¾ä±ú¡£¼ÈÈ»·µ»ØµÄÊÇÒ»¸öÎļþ¾ä±ú£¬ÄÇô¾Í¿ÉÒÔ¶ÔËü¶ÁºÍдÁË¡£ÔÚPHP3ÖУ¬¶ÔÕâÖÖ¾ä±úÖ»ÄÜ×öµ¥Ò»µÄ²Ù×÷ģʽ£¬ÒªÃ´Ð´£¬ÒªÃ´¶Á£»´Ó |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»! |
Äã¿ÉÄܶÔÏÂÃæµÄÎÄÕ¸ÐÐËȤ
- CSSÍøÒ³ÖÆ×÷:¸¡¶¯Çå³ýµÄз½·¨
- Photoshop½Ì³Ì:ÓÃUSMÂ˾µÈñ»¯½«ÕÕƬ±äÇåÎú
- PhotoshopÊó»æ½Ì³Ì:»æÖƱÆÕæµÄ¿¨Í¨Âéȸ
- ÀûÓÃHttpSessionListenerͳ¼ÆÔÚÏßÈËÊý - ±à³ÌÈëÃÅÍø
- Ñз¢´óÐÍPHPÏîÄ¿µÄ·½·¨
- PhotoshopÖÆ×÷¿¨Í¨Ìì¿ÕµÄÉñÆæÀâ¾µ
- vbs°æIPµØÀíλÖòéѯС͵
- PhotoshopÖÆ×÷¶¯»ÎÄ×ÖÌØЧ:ÉÁ˸µÄÄÞºçµÆÎÄ×Ö
- ÔÚSpringSide 2.0ÖÐʹÓöà¸öÊý¾Ý¿â - ±à³ÌÈëÃÅÍø
- dz̸Linux´ÅÅÌ´æ´¢¹ÜÀí
ÉÏһƪ: PHPÖÐÒ»¸ö¿ØÖÆ×Ö·û´®Êä³öµÄº¯ÊýÏÂһƪ: ×îС»¯Êý¾Ý´«Ê䡪¡ªÔÚ¿Í»§¶Ë´æ´¢Êý¾Ý
¹ØÓÚÔÚPHPÖÐÖ´ÐÐϵͳÍⲿÃüÁîµÄËùÓÐÆÀÂÛ