SQL注入原理 手工注入access資料庫

2021-07-26 10:10:39 字數 1977 閱讀 9248

一、target

sql注入原理、學習手工注入過程

二、實驗原理:通過把sql命令插入到web表單提交或輸入網域名稱或頁面請求的的查詢字串,最終達到欺騙伺服器執行惡意的sql命令

1、在結尾的鏈結中依次新增【』】和【and 1=1】和【and 1=2】判斷**是否存在注入點

2、新增語句【and exists(select*from admin)】根據頁面返回結果來猜解表名

3、新增【and exists(select admin from admin)】猜解admin表中的列名admin

4、新增語句【and (select top 1 len (admin)from admin)>1】猜解字段長度

5、新增【and (select top 1 asc(mid(admin,1,1))from admin)>97】猜解字段中字元的ascii碼

通過上述的步驟,反覆猜解,即可得到資料庫儲存的使用者名稱和密碼

三、實驗環境:

本機:192.168.1.2

目標機:192.168.1.3

四、實驗步驟:

找到有注入漏洞目標**:

**1、目標站點:

3、在末尾新增【and 1 =1】

4、在末尾新增【and 1 =2】,返回頁面發現該**存在注入漏洞

猜解表名

在鏈結末尾新增語句【and exists(select*from admin)】,頁面正常顯示,說明存在表名【admin】

猜解列名

1、在鏈結末尾新增語句【and exists(select admin from admin)】,頁面顯示正常,說明表中存在admin列

2、在鏈結末尾新增語句【and exists(select password from admin)】,頁面顯示正常,說明表中存在列password

猜解字段內容

1、在鏈結末尾,輸入【and (select top 1 len (admin)from admin>1】頁面顯示正常,數字依次加1,進行測試,例如:【and (select top 1 len (admin)from admin>5】說明字段長度為5

2、在鏈結末尾,輸入【and (select top 1 asc(mid(admin,1,1))from admin)>97】,可猜解第一條記錄的第乙個字元的ascill碼為97,對應為a.

3、同樣的方法得到admin的字段內容【admin】,password的字段內容【bfpms】

sql手工注入原理

純粹一些個人練習心得,所以今天就寫一篇部落格記錄一下 數值型 1.url輸入 and 1 1 and 1 2 回顯頁面不同 整形判斷 如果頁面執行錯誤,則說明此 sql 注入為數字型注入。因為當我們輸入 and 1 1時,後台執行 sql 語句 如 select from 表名 where id x...

SQL手工注入原理(二)

靶機 metasploitable2 sql手工注入原理 一 low等級 if isset get submit 此時瀏覽器不會返回資料庫報錯資訊!正常輸入 錯誤輸入 不會提示錯誤!1 and 1 1 1 and 1 2 1 or 1 1 1 or 1 2 1 order by 3 1 order ...

sql注入 手工注入

表示式 描述union 將查詢結果進行聯合輸出,追加在列尾 union all load 檔案讀取 into outfile 檔案寫入 datadir 資料庫檔案存放路徑 user 當前使用者 version 資料庫版本 database 資料庫名稱 表示系統變數 資料庫 表名描述 informat...