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

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