EditPlus查找PHP源碼簡單數字型注入的正則表達式
互聯(lián)網 發(fā)布時間:2008-10-08 19:36:36 作者:佚名
我要評論

今天看一個項目代碼,文件不多,不過每個文件中都N多注入,一個一個看實在太累,索性花了點時間,弄了個正則表達式,搜索出來,然后再將安全的篩選出去。省了不少時間的說。
1.查找select、update、delete語句
((select|SELECT|update|UPDATE|delete|DELETE) .*(f
今天看一個項目代碼,文件不多,不過每個文件中都N多注入,一個一個看實在太累,索性花了點時間,弄了個正則表達式,搜索出來,然后再將安全的篩選出去。省了不少時間的說。
1.查找select、update、delete語句
((select|SELECT|update|UPDATE|delete|DELETE) .*(from|FROM|set|SET) .*(where|WHERE) .*) 查詢語句,對于沒有條件判斷的基本不存在注入問題,因而僅搜索此語句即可
例子:
select * from user where 2.簡單的數字型注入
((select|SELECT|update|UPDATE|delete|DELETE) .*(from|FROM|set|SET) .*(where|WHERE) .*=[ ]?["]?["]?\$) 能找到select、update delete三種語句,5種格式的整形注入,如:
直接變量傳入
select * from guess where id=$subject_id
update guess set is_valid=0 where id=$subject_id
delete from guess where id=$subject_id
=與變量之間存在空格
select * from guess where id= $subject_id
update guess set is_valid=0 where id= $subject_id
delete from guess where id= $subject_id
變量雙引號
select * from guess where id="$subject_id"
update guess set is_valid=0 where id="$subject_id"
delete from guess where id="$subject_id"
=與雙引號之間存在空格
select * from guess where id= "$subject_id"
update guess set is_valid=0 where id= "$subject_id"
delete from guess where id= "$subject_id"
=與引號、雙引號之間存在空格
select * from guess where id= " $subject_id"
update guess set is_valid=0 where id= " $subject_id"
delete from guess where id= " $subject_id"
((select|SELECT|update|UPDATE|delete|DELETE) .*(from|FROM|set|SET) .*(where|WHERE) .*) 查詢語句,對于沒有條件判斷的基本不存在注入問題,因而僅搜索此語句即可
例子:
select * from user where 2.簡單的數字型注入
((select|SELECT|update|UPDATE|delete|DELETE) .*(from|FROM|set|SET) .*(where|WHERE) .*=[ ]?["]?["]?\$) 能找到select、update delete三種語句,5種格式的整形注入,如:
直接變量傳入
select * from guess where id=$subject_id
update guess set is_valid=0 where id=$subject_id
delete from guess where id=$subject_id
=與變量之間存在空格
select * from guess where id= $subject_id
update guess set is_valid=0 where id= $subject_id
delete from guess where id= $subject_id
變量雙引號
select * from guess where id="$subject_id"
update guess set is_valid=0 where id="$subject_id"
delete from guess where id="$subject_id"
=與雙引號之間存在空格
select * from guess where id= "$subject_id"
update guess set is_valid=0 where id= "$subject_id"
delete from guess where id= "$subject_id"
=與引號、雙引號之間存在空格
select * from guess where id= " $subject_id"
update guess set is_valid=0 where id= " $subject_id"
delete from guess where id= " $subject_id"
相關文章
- 正則表達式是一個包含普通文本加上指示為擴展特殊字符的搜索字符串的搜索選項。正則表達式允許更多的高級搜索和替換2014-05-13
- 腳本之家以前為大家準備了不少關于editplus正則替換的一些資料,不過偶然看到了這篇文章確實不錯,特分享給大家2013-03-09
- 筆者一直使用editplus作為平時處理文檔使用的工具,因為經常處理文檔并替換,所以一直研究editplus的正則表達式,發(fā)現了阿一的整理的資料特分享下,結合我以前寫的,確實不2013-03-09
EditPlus中通過正則表達式刪除文檔多余空行使用指南[圖文]
從網上收集的文章大多有大量多余的空行,占據了許多篇幅,如果需要打印就非常浪費紙張。想要刪除這些空行,可是這些空行要么不包含任何字符,要么包含了許多空格、制表符(T2012-10-05- 在編程過程中??倳龅絺€別的來自其他程序文件多余很多空行。大家都知道這樣對源代碼優(yōu)化特別不好2012-10-04
- 正則表達式是一個查詢的字符串,它包含一般的字符和一些特殊的字符,特殊字符可以擴展查找字符串的能力,正則表達式在查找和替換字符串的作用不可忽視,它 能很好提高工作2011-01-03
- 從網上收集的文章大多有大量多余的空行,占據了許多篇幅,如果需要打印就非常浪費紙張。想要刪除這些空行,可是這些空行要么不包含任何字符,要么包含了許多空格、制表符(T2021-04-05
- 這篇文章主要介紹了Editplus常用正則表達式介紹,需要的朋友可以參考下2014-05-13