ÏàʶLinuxЧÀÍÆ÷ÉϵÄWeb½Ó¿Ú¹¥»÷ÀàÐÍ¡£
ÏàʶLinuxЧÀÍÆ÷ÉϵÄWeb½Ó¿Ú¹¥»÷ÀàÐÍ
Ëæ×Å»¥ÁªÍøÊÖÒÕµÄÉú³¤£¬WebЧÀÍÆ÷ÒѾ³ÉΪ´ó²¿·ÖÆóÒµºÍСÎÒ˽È˾ÙÐÐÔÚÏßÓªÒµ½»Á÷µÄÖ÷Òª×é³É²¿·Ö¡£È»¶ø£¬ÓÉÓÚWebЧÀÍÆ÷µÄÎó²îºÍÈõµã£¬¹¥»÷ÕßÓпÉÄÜʹÓÃÕâЩÎó²î½øÈëϵͳ£¬ÇÔÈ¡»ò¸Ä¶¯Ãô¸ÐÐÅÏ¢¡£±¾ÎĽ«ÏÈÈÝһЩ³£¼ûµÄLinuxЧÀÍÆ÷ÉϵÄWeb½Ó¿Ú¹¥»÷ÀàÐÍ£¬²¢ÌṩʾÀý´úÂëÀ´×ÊÖú¶ÁÕ߸üºÃµØÏàʶÕâЩ¹¥»÷·½·¨¡£
SQL×¢Èë¹¥»÷
SQL×¢Èë¹¥»÷ÊÇ×î³£¼ûµÄWeb½Ó¿Ú¹¥»÷Ö®Ò»¡£¹¥»÷Õßͨ¹ýÔÚÓû§ÊäÈëµÄÊý¾ÝÖвåÈë¶ñÒâµÄSQL´úÂ룬´Ó¶øÈƹýÓ¦ÓóÌÐòµÄÉí·ÝÑéÖ¤ºÍÊÚȨ»úÖÆ£¬²¢¶ÔÊý¾Ý¿â¾ÙÐв»·¨²Ù×÷¡£ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄSQL×¢Èë¹¥»÷ʾÀý£º
// PHP´úÂë $username = $_GET['username']; $password = $_GET['password']; $query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'"; $result = mysql_query($query);
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÊöʾÀýÖУ¬ÈôÊǹ¥»÷Õß½«usernameÊäÈë¿òÖеÄÖµÉèÖÃΪ’ OR ‘1=1’ — £¬Ôò»áÈƹýÉí·ÝÑéÖ¤²¢·µ»ØËùÓÐÓû§µÄÐÅÏ¢¡£
ΪÁ˱ÜÃâSQL×¢Èë¹¥»÷£¬¿ÉÒÔʹÓÃÔ¤±àÒëÓï¾ä»ò²ÎÊý»¯ÅÌÎÊÀ´¹ýÂËÓû§ÊäÈ룬´Ó¶ø×èÖ¹¶ñÒâSQL´úÂëµÄÖ´ÐС£
XSS¹¥»÷
¿çÕ¾¾ç±¾¹¥»÷£¨XSS£©ÊÇÒ»ÖÖʹÓÃWebÓ¦ÓóÌÐò¶ÔÓû§ÊäÈë¾ÙÐв»³ä·Ö¹ýÂ˺ÍÑéÖ¤µÄÎó²î¡£¹¥»÷Õßͨ¹ýÔÚÍøÒ³ÖвåÈë¶ñÒâ¾ç±¾´úÂ룬½«Æä×¢Èëµ½Óû§ä¯ÀÀÆ÷ÖÐÖ´ÐС£ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄXSS¹¥»÷ʾÀý£º
// PHP´úÂë $name = $_GET['name']; echo "Welcome, $name!";
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÊöʾÀýÖУ¬ÈôÊǹ¥»÷ÕßÔÚURLÖÐÊäÈë<script>alert(‘XSS’);</script>×÷Ϊname²ÎÊýµÄÖµ£¬ÄÇô¶ñÒâ¾ç±¾½«±»Ö´ÐС£
ΪÁ˱ÜÃâXSS¹¥»÷£¬¿ÉÒÔ¶ÔÓû§ÊäÈë¾ÙÐÐHTMLʵÌå±àÂ룬½«ÌØÊâ×Ö·ûת»»ÎªµÈЧµÄHTMLʵÌå¡£ÀýÈ磬ÔÚÉÏÊöʾÀýÖУ¬Ó¦¸ÃʹÓÃhtmlspecialchars()º¯Êý¶Ô$name¾ÙÐд¦Àí¡£
CSRF¹¥»÷
¿çÕ¾ÇëÇóαÔ죨CSRF£©¹¥»÷ÊÇÒ»ÖÖʹÓÃÓû§Ä¿½ñµÇ¼µÄÍøÕ¾Éí·ÝÑé֤״̬¾ÙÐв»·¨²Ù×÷µÄ¹¥»÷·½·¨¡£¹¥»÷ÕßÓÕµ¼Óû§µã»÷¶ñÒâÁ´½Ó£¬ÕâÑùÔÚÓû§²»ÖªÇéµÄÇéÐÎÏ£¬¶ñÒâ´úÂ뽫·¢ËÍHTTPÇëÇóÈ¥Ö´ÐÐһЩΣÏյIJÙ×÷¡£ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄCSRF¹¥»÷ʾÀý£º
<!-- HTML´úÂë --> <form action="http://vulnerable-website.com/reset-password" method="POST"> <input type="hidden" name="newPassword" value="evil-password"> <input type="submit" value="Reset Password"> </form>
µÇ¼ºó¸´ÖÆ
ÉÏÊöʾÀý´úÂë»á½«Óû§ÃÜÂëÖØÖÃΪevil-password£¬¶øÓû§¿ÉÄÜÔÚÎÞÒâÖеã»÷Á˸ÃÍøÒ³¡£
ΪÁ˱ÜÃâCSRF¹¥»÷£¬¿ÉÒÔʹÓÃCSRFÁîÅƶÔÓû§Ìá½»µÄÇëÇó¾ÙÐÐÑéÖ¤¡£ÔÚЧÀÍÆ÷¶ËÌìÉúÒ»¸öΨһµÄCSRFÁîÅÆ£¬²¢½«ÆäǶÈëµ½±íµ¥ÖУ¬È»ºóÔÚЧÀÍÆ÷¶ËÑéÖ¤¸ÃÁîÅƵÄ׼ȷÐÔ¡£
×ܽ᣺
Web½Ó¿Ú¹¥»÷ÊǷǾ³£¼ûµÄ£¬ÔÚ±£»¤LinuxЧÀÍÆ÷ÉϵÄWebÓ¦ÓóÌÐòʱ£¬Ã÷È·ºÍÌá·ÀÕâЩ¹¥»÷ÊÇÖÁ¹ØÖ÷ÒªµÄ¡£±¾ÎÄͨ¹ýÏÈÈÝSQL×¢Èë¡¢XSSºÍCSRF¹¥»÷£¬ÌṩÁËһЩÏÖʵʾÀý´úÂ룬ϣÍû¶ÁÕßÄܹ»¼ÓÉî¶ÔÕâЩ¹¥»÷·½·¨µÄÏàʶ£¬½ø¶ø½ÓÄÉÊʵ±µÄÇå¾²²½·¥À´±£»¤WebÓ¦ÓóÌÐòµÄÇå¾²ÐÔ¡£
ÒÔÉϾÍÊÇÏàʶLinuxЧÀÍÆ÷ÉϵÄWeb½Ó¿Ú¹¥»÷ÀàÐÍ¡£µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡