本文介紹了使用正則表達(dá)式刪除注入的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
限時送ChatGPT賬號..
我希望從大約 16,000 多個文件的第 1 行中刪除此特定行.
I'm looking to sed this specific line from line 1 of about 16,000+ files.
注入的開始是:
<?php if(!isset($GLOBALS`
Middle of the injection is:
`7860msvd`
And end of the injection is:
`oqggbrtstz-1; ?>
此內(nèi)容僅在 1 行(第一行)
This content is in 1 line only (the first)
不知道怎么做,但我這里有以下內(nèi)容;
Not sure how to do it but what I have here is the following;
sed -i -e '1 s/.*<?php if(!isset($GLOBALS.*7860msvd.*oqggbrtstz-1; ?>//g'
error: sed: -e expression #1, char 67: Unmatched ( or (
任何幫助都會很棒.
推薦答案
您遺漏了一些特殊字符,例如 ?
并使用 -r
得到期望結(jié)果
You missing to literal some special character like ?
and using -r
get expect result
sed -ri '1 s/.*<?php if(!isset($GLOBALS.*7860msvd.*oqggbrtstz-1; ?>//g' File
-r, --regexp-extended
use extended regular expressions in the script.
這篇關(guān)于使用正則表達(dá)式刪除注入的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!