Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make text4shell datascript faster #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions security/check_for_text4shell_attacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@ in application profile.
-- detect CVE-2022-42889 Text4shell
local function check_for_attack (location, value)
if type(value) == "string" then
lower = string.lower(value)
if string.contains(lower, "${script:") then
avi.vs.log("CVE-2022-42889 Text4shell attack detected at " .. location)
avi.http.response(400)
end
if string.contains(lower, "${dns:") then
avi.vs.log("CVE-2022-42889 Text4shell attack detected at " .. location)
avi.http.response(400)
end
if string.contains(lower, "${url:") then
avi.vs.log("CVE-2022-42889 Text4shell attack detected at " .. location)
avi.http.response(400)
end
-- detect evasion
if string.match(lower, "${%a*${") then
avi.vs.log("CVE-2022-42889 Text4shell attack (evasion attempt) detected at " .. location)
if string.contains(value, "${") then
lower = string.lower(value)
if string.contains(lower, "${script:") then
avi.vs.log("CVE-2022-42889 Text4shell attack detected at " .. location)
avi.http.response(400)
end
if string.contains(lower, "${dns:") then
avi.vs.log("CVE-2022-42889 Text4shell attack detected at " .. location)
avi.http.response(400)
end
if string.contains(lower, "${url:") then
avi.vs.log("CVE-2022-42889 Text4shell attack detected at " .. location)
avi.http.response(400)
end
-- detect evasion
if string.match(lower, "${%a*${") then
avi.vs.log("CVE-2022-42889 Text4shell attack (evasion attempt) detected at " .. location)
avi.http.response(400)
end
end
end
end
Expand Down