mysqlÌáʾµÄ23¸ö×¢ÒâÊÂÏî
1.Èç¹û¿Í»§¶ËºÍ·þÎñÆ÷¶ËµÄÁ¬½ÓÐèÒª¿çÔ½²¢Í¨¹ý²»¿ÉÐÅÈεÄÍøÂ磬ÄÇô¾ÍÐèҪʹÓÃSSHËíµÀÀ´¼ÓÃܸÃÁ¬½ÓµÄͨÐÅ¡£
¡¡¡¡2.ÓÃset passwordÓï¾äÀ´ÐÞ¸ÄÓû§µÄÃÜÂ룬Èý¸ö²½Ö裬ÏÈ“mysql -u root”µÇ½Êý¾Ý¿âϵͳ£¬È»ºó“mysql> update mysql.user set password=password(’newpwd’)”£¬×îºóÖ´ÐГflush privileges”¾Í¿ÉÒÔÁË¡£
¡¡¡¡3.ÐèÒªÌá·ÀµÄ¹¥»÷ÓУ¬·À͵Ìý¡¢´Û¸Ä¡¢»Ø·Å¡¢¾Ü¾ø·þÎñµÈ£¬²»Éæ¼°¿ÉÓÃÐÔºÍÈÝ´í·½Ãæ¡£¶ÔËùÓеÄÁ¬½Ó¡¢²éѯ¡¢ÆäËû²Ù×÷ʹÓûùÓÚACL¼´·ÃÎÊ¿ØÖÆÁбíµÄ°²È«´ëÊ©À´Íê³É¡£Ò²ÓÐһЩ¶ÔSSLÁ¬½ÓµÄÖ§³Ö¡£
¡¡¡¡4.³ýÁËrootÓû§ÍâµÄÆäËûÈκÎÓû§²»ÔÊÐí·ÃÎÊmysqlÖ÷Êý¾Ý¿âÖеÄuser±í;
¡¡¡¡¼ÓÃܺó´æ·ÅÔÚuser±íÖеļÓÃܺóµÄÓû§ÃÜÂëÒ»µ©Ð¹Â¶£¬ÆäËûÈË¿ÉÒÔËæÒâÓøÃÓû§Ãû/ÃÜÂëÏàÓ¦µÄÊý¾Ý¿â;
¡¡¡¡5.ÓÃgrantºÍrevokeÓï¾äÀ´½øÐÐÓû§·ÃÎÊ¿ØÖƵŤ×÷;
¡¡¡¡6.²»Ê¹ÓÃÃ÷ÎÄÃÜÂ룬¶øÊÇʹÓÃmd5()ºÍsha1()µÈµ¥ÏòµÄ¹þϵº¯ÊýÀ´ÉèÖÃÃÜÂë;
¡¡¡¡7.²»Ñ¡ÓÃ×ÖµäÖеÄ×ÖÀ´×öÃÜÂë;
¡¡¡¡8.²ÉÓ÷À»ðǽÀ´È¥µô50%µÄÍⲿΣÏÕ£¬ÈÃÊý¾Ý¿âϵͳ¶ãÔÚ·À»ðǽºóÃ湤×÷£¬»ò·ÅÖÃÔÚDMZÇøÓòÖÐ;
¡¡¡¡9.´ÓÒòÌØÍøÉÏÓÃnmapÀ´É¨Ãè3306¶Ë¿Ú£¬Ò²¿ÉÓÃtelnet server_host 3306µÄ·½·¨²âÊÔ£¬²»ÄÜÔÊÐí´Ó·ÇÐÅÈÎÍøÂçÖзÃÎÊÊý¾Ý¿â·þÎñÆ÷µÄ3306ºÅTCP¶Ë¿Ú£¬Òò´ËÐèÒªÔÚ·À»ðǽ»ò·ÓÉÆ÷ÉÏ×öÉ趨;
¡¡¡¡10.ΪÁË·ÀÖ¹±»¶ñÒâ´«Èë·Ç·¨²ÎÊý£¬ÀýÈçwhere ID=234£¬±ðÈËÈ´ÊäÈëwhere ID=234 OR 1=1µ¼ÖÂÈ«²¿ÏÔʾ£¬ËùÒÔÔÚwebµÄ±íµ¥ÖÐʹÓÃ’’»ò\"\"À´ÓÃ×Ö·û´®£¬ÔÚ¶¯Ì¬URLÖмÓÈë\"´ú±íË«ÒýºÅ¡¢#´ú±í¾®ºÅ¡¢\'´ú±íµ¥ÒýºÅ;´«µÝδ¼ì²é¹ýµÄÖµ¸ømysqlÊý¾Ý¿âÊǷdz£Î£ÏÕµÄ;
¡¡¡¡11.ÔÚ´«µÝÊý¾Ý¸ømysqlʱ¼ì²éһϴóС;
¡¡¡¡12.Ó¦ÓóÌÐòÐèÒªÁ¬½Óµ½Êý¾Ý¿âÓ¦¸ÃʹÓÃÒ»°ãµÄÓû§Õʺţ¬Ö»¿ª·ÅÉÙÊý±ØÒªµÄȨÏÞ¸ø¸ÃÓû§;
¡¡¡¡13.ÔÚ¸÷±à³Ì½Ó¿Ú(C C++ php Perl Java JDBCµÈ)ÖÐʹÓÃÌض¨‘ÌÓÍÑ×Ö·û’º¯Êý;
¡¡¡¡ÔÚÒòÌØÍøÉÏʹÓÃmysqlÊý¾Ý¿âʱһ¶¨ÉÙÓô«ÊäÃ÷ÎĵÄÊý¾Ý£¬¶øÓÃSSLºÍSSHµÄ¼ÓÃÜ·½Ê½Êý¾ÝÀ´´«Êä;
¡¡¡¡14.ѧ»áʹÓÃtcpdumpºÍstrings¹¤¾ßÀ´²é¿´´«ÊäÊý¾ÝµÄ°²È«ÐÔ£¬ÀýÈçtcpdump -l -i eth0 -w -src or dst port 3306 | strings¡£ÒÔÆÕͨÓû§À´Æô¶¯mysqlÊý¾Ý¿â·þÎñ;
¡¡¡¡
Ïà¹ØÎĵµ£º
conn.php
<?php
/*
* Created on 2010-1-6
* Author:CHAUVET
* Function:Á¬½Ó×Ö·û´®
*/
$conn=@mysql_connect("localhost","root","")or die("Á¬½ÓÊý¾Ý¿â³ö´í£¡");
mysql_select_db("newdb",$conn);
mysql_query("set names 'gb2312'");
function ReplaceSom ......
mysqlϵļÓÃܺ¯ÊýÓÐÈçϼ¸¸ö
PASSWORD()£º´´½¨Ò»¸ö¾¹ý¼ÓÃܵÄÃÜÂë×Ö·û´®£¬ÊʺÏÓÚ²åÈëµ½MySQLµÄ°²È«Ïµ
ͳ¡£¸Ã¼ÓÃܹý³Ì²»¿ÉÄ棬ºÍunixÃÜÂë¼ÓÃܹý³ÌʹÓò»Í¬µÄËã·¨¡£Ö÷ÒªÓÃÓÚMySQLµÄÈÏ֤ϵͳ¡£
ENCRYPT(£¬)£ºÊ¹ÓÃUNIX crypt()ϵͳ¼ÓÃÜ×Ö·û´®£¬ENCRYPT()º¯Êý½ÓÊÕÒª¼ÓÃܵÄ×Ö·û´®ºÍ£¨¿ÉÑ¡µÄ£©ÓÃÓÚ¼ÓÃܹý³ÌµÄsalt£¨Ò»¸ ......
MySQLµÄĬÈϱàÂëÊÇLatin1£¬²»Ö§³ÖÖÐÎÄ.ÒªÈÃĬÈϱàÂë±äΪutf8¡£¿É½øÐÐÈçÏÂÅäÖãº
SET GLOBAL character_set_client = utf8;
SET GLOBAL character_set_connection = utf8;
SET GLOBAL character_set_database = utf8;
SET GLOBAL character_set_results = utf8;
......
Á¬½ÓMySQLÊý¾Ý¿âʱ³£»á³öÏÖÈçϵĴíÎóÌáʾ£º
#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
³öÏÖÕâÖÖÎÊÌâÊÇÔÚMySQL4.1ÒÔÉÏ°æ±¾£¬ÔÒòMySQL·þÎñÆ÷°æ±¾Ê¹ÓÃÁËеÄÃÜÂëÑéÖ¤»úÖÆ£¬Æä½â¾ö·½·¨ÈçÏ£º
mysql>;set password for 'Óû§Ãû' @ 'Ö÷»úÃû' = old ......
°²×°ºÃ mysqlºóÔÚÖÕ¶ËÊäÈëÃüÁîmysql -s root -p
ÏÔʾ£º
Access denied for user 'star'@'localhost' (using password: YES)
ÊÇ·þÎñ»¹Ã»¿ªÆô£¬ÊäÈ룺sudo /etc/init.d/mysql start
È»ºóÊäÈë mysql -uroot -p µÇ¼³É¹¦
ÖÐÎÄÎÊÌâ
Ubuntu 7.04 ÏÂÓÃÔ´°²×°ÁËMySQL¡£Ä¬ÈÏÇé¿öÏ£¬ÓÃmysql shellµÇ¼´´½¨Êý¾Ý¿â´´½¨±í²åÈëÖÐÎ ......