EditPlus查找PHP源碼簡(jiǎn)單數(shù)字型注入的正則表達(dá)式
發(fā)布日期:2021-12-29 18:10 | 文章來源:源碼中國(guó)
今天看一個(gè)項(xiàng)目代碼,文件不多,不過每個(gè)文件中都N多注入,一個(gè)一個(gè)看實(shí)在太累,索性花了點(diǎn)時(shí)間,弄了個(gè)正則表達(dá)式,搜索出來,然后再將安全的篩選出去。省了不少時(shí)間的說。
1.查找select、update、delete語(yǔ)句
((select|SELECT|update|UPDATE|delete|DELETE) .*(from|FROM|set|SET) .*(where|WHERE) .*) 查詢語(yǔ)句,對(duì)于沒有條件判斷的基本不存在注入問題,因而僅搜索此語(yǔ)句即可
例子:
select * from user where 2.簡(jiǎn)單的數(shù)字型注入
((select|SELECT|update|UPDATE|delete|DELETE) .*(from|FROM|set|SET) .*(where|WHERE) .*=[ ]?["]?["]?\$) 能找到select、update delete三種語(yǔ)句,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) .*) 查詢語(yǔ)句,對(duì)于沒有條件判斷的基本不存在注入問題,因而僅搜索此語(yǔ)句即可
例子:
select * from user where 2.簡(jiǎn)單的數(shù)字型注入
((select|SELECT|update|UPDATE|delete|DELETE) .*(from|FROM|set|SET) .*(where|WHERE) .*=[ ]?["]?["]?\$) 能找到select、update delete三種語(yǔ)句,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"
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
相關(guān)文章