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

[known-issue] unable to compile some CommonWebAttack & BadCrawler patterns #4

Closed
dwisiswant0 opened this issue Dec 27, 2022 · 0 comments · Fixed by #14
Closed

[known-issue] unable to compile some CommonWebAttack & BadCrawler patterns #4

dwisiswant0 opened this issue Dec 27, 2022 · 0 comments · Fixed by #14
Assignees
Labels
help wanted Extra attention is needed known-issue

Comments

@dwisiswant0
Copy link
Collaborator

Here are some patterns that won't compile based on threat category.

  1. CommonWebAttack:
{Description:Detects hash-contained xss payload attacks, setter usage and property overloading ID:5 Impact:5 Rule:(?:\W\s*hash\s*[^\w\s-])|(?:\w+=\W*[^,]*,[^\s(]\s*\()|(?:\?"[^\s"]":)|(?:(?<!\/)__[a-z]+__)|(?:(?:^|[\s)\]\}])(?:s|g)etter\s*=) Tags:map[tag:[xss csrf]] pattern:<nil>}
{Description:Detects self-executing JavaScript functions ID:8 Impact:5 Rule:(?:\/\w*\s*\)\s*\()|(?:\([\w\s]+\([\w\s]+\)[\w\s]+\))|(?:(?<!(?:mozilla\/\d\.\d\s))\([^)[]+\[[^\]]+\][^)]*\))|(?:[^\s!][{([][^({[]+[{([][^}\])]+[}\])][\s+",\d]*[}\])])|(?:"\)?\]\W*\[)|(?:=\s*[^\s:;]+\s*[{([][^}\])]+[}\])];) Tags:map[tag:[xss csrf]] pattern:<nil>}
{Description:Detects JavaScript DOM/miscellaneous properties and methods ID:15 Impact:6 Rule:([^*:\s\w,.\/?+-]\s*)?(?<![a-z]\s)(?<![a-z\/_@\-\|])(\s*return\s*)?(?:create(?:element|attribute|textnode)|[a-z]+events?|setattribute|getelement\w+|appendchild|createrange|createcontextualfragment|removenode|parentnode|decodeuricomponent|\wettimeout|(?:ms)?setimmediate|option|useragent)(?(1)[^\w%"]|(?:\s*[^@\s\w%",.+\-])) Tags:map[tag:[xss csrf id rfe]] pattern:<nil>}
{Description:Detects possible includes and typical script methods ID:16 Impact:5 Rule:([^*\s\w,.\/?+-]\s*)?(?<![a-mo-z]\s)(?<![a-z\/_@])(\s*return\s*)?(?:alert|inputbox|showmod(?:al|eless)dialog|showhelp|infinity|isnan|isnull|iterator|msgbox|executeglobal|expression|prompt|write(?:ln)?|confirm|dialog|urn|(?:un)?eval|exec|execscript|tostring|status|execute|window|unescape|navigate|jquery|getscript|extend|prototype)(?(1)[^\w%"]|(?:\s*[^@\s\w%",.:\/+\-])) Tags:map[tag:[xss csrf id rfe]] pattern:<nil>}
{Description:Detects JavaScript object properties and methods ID:17 Impact:4 Rule:([^*:\s\w,.\/?+-]\s*)?(?<![a-z]\s)(?<![a-z\/_@])(\s*return\s*)?(?:hash|name|href|navigateandfind|source|pathname|close|constructor|port|protocol|assign|replace|back|forward|document|ownerdocument|window|top|this|self|parent|frames|_?content|date|cookie|innerhtml|innertext|csstext+?|outerhtml|print|moveby|resizeto|createstylesheet|stylesheets)(?(1)[^\w%"]|(?:\s*[^@\/\s\w%.+\-])) Tags:map[tag:[xss csrf id rfe]] pattern:<nil>}
{Description:Detects JavaScript array properties and methods ID:18 Impact:4 Rule:([^*:\s\w,.\/?+-]\s*)?(?<![a-z]\s)(?<![a-z\/_@\-\|])(\s*return\s*)?(?:join|pop|push|reverse|reduce|concat|map|shift|sp?lice|sort|unshift)(?(1)[^\w%"]|(?:\s*[^@\s\w%,.+\-])) Tags:map[tag:[xss csrf id rfe]] pattern:<nil>}
{Description:Detects JavaScript string properties and methods ID:19 Impact:4 Rule:([^*:\s\w,.\/?+-]\s*)?(?<![a-z]\s)(?<![a-z\/_@\-\|])(\s*return\s*)?(?:set|atob|btoa|charat|charcodeat|charset|concat|crypto|frames|fromcharcode|indexof|lastindexof|match|navigator|toolbar|menubar|replace|regexp|slice|split|substr|substring|escape|\w+codeuri\w*)(?(1)[^\w%"]|(?:\s*[^@\s\w%,.+\-])) Tags:map[tag:[xss csrf id rfe]] pattern:<nil>}
{Description:Detects JavaScript language constructs ID:20 Impact:4 Rule:(?:\)\s*\[)|([^*":\s\w,.\/?+-]\s*)?(?<![a-z]\s)(?<![a-z_@\|])(\s*return\s*)?(?:globalstorage|sessionstorage|postmessage|callee|constructor|content|domain|prototype|try|catch|top|call|apply|url|function|object|array|string|math|if|for\s*(?:each)?|elseif|case|switch|regex|boolean|location|(?:ms)?setimmediate|settimeout|setinterval|void|setexpression|namespace|while)(?(1)[^\w%"]|(?:\s*[^@\s\w%".+\-\/])) Tags:map[tag:[xss csrf id rfe]] pattern:<nil>}
{Description:Detects very basic XSS probings ID:21 Impact:3 Rule:(?:,\s*(?:alert|showmodaldialog|eval)\s*,)|(?::\s*eval\s*[^\s])|([^:\s\w,.\/?+-]\s*)?(?<![a-z\/_@])(\s*return\s*)?(?:(?:document\s*\.)?(?:.+\/)?(?:alert|eval|msgbox|showmod(?:al|eless)dialog|showhelp|prompt|write(?:ln)?|confirm|dialog|open))\s*(?:[^.a-z\s\-]|(?:\s*[^\s\w,.@\/+-]))|(?:java[\s\/]*\.[\s\/]*lang)|(?:\w\s*=\s*new\s+\w+)|(?:&\s*\w+\s*\)[^,])|(?:\+[\W\d]*new\s+\w+[\W\d]*\+)|(?:document\.\w) Tags:map[tag:[xss csrf id rfe]] pattern:<nil>}
{Description:Detects data: URL injections, VBS injections and common URI schemes ID:27 Impact:5 Rule:(?:(?:vbs|vbscript|data):.*[,+])|(?:\w+\s*=\W*(?!https?)\w+:)|(jar:\w+:)|(=\s*"?\s*vbs(?:ript)?:)|(language\s*=\s?"?\s*vbs(?:ript)?)|on\w+\s*=\*\w+\-"? Tags:map[tag:[xss rfe]] pattern:<nil>}
{Description:Detects possible event handlers ID:32 Impact:4 Rule:(?:[^\w\s=]on(?!g\&gt;)\w+[^=_+-]*=[^$]+(?:\W|\&gt;)?) Tags:map[tag:[xss csrf]] pattern:<nil>}
{Description:Detects obfuscated script tags and XML wrapped HTML ID:33 Impact:4 Rule:(?:\<\w*:?\s(?:[^\>]*)t(?!rong))|(?:\<scri)|(<\w+:\w+) Tags:map[tag:xss] pattern:<nil>}
{Description:Detects classic SQL injection probings 2/2 ID:43 Impact:6 Rule:(?:"\s*\*.+(?:or|id)\W*"\d)|(?:\^")|(?:^[\w\s"-]+(?<=and\s)(?<=or\s)(?<=xor\s)(?<=nand\s)(?<=not\s)(?<=\|\|)(?<=\&\&)\w+\()|(?:"[\s\d]*[^\w\s]+\W*\d\W*.*["\d])|(?:"\s*[^\w\s?]+\s*[^\w\s]+\s*")|(?:"\s*[^\w\s]+\s*[\W\d].*(?:#|--))|(?:".*\*\s*\d)|(?:"\s*or\s[^\d]+[\w-]+.*\d)|(?:[()*<>%+-][\w-]+[^\w\s]+"[^,]) Tags:map[tag:[sqli id lfi]] pattern:<nil>}
{Description:Detects MySQL comment-/space-obfuscated injections and backtick termination ID:57 Impact:5 Rule:(?:,.*[)\da-f"]"(?:".*"|\Z|[^"]+))|(?:\Wselect.+\W*from)|((?:select|create|rename|truncate|load|alter|delete|update|insert|desc)\s*\(\s*space\s*\() Tags:map[tag:[sqli id]] pattern:<nil>}
{Description:Detects basic XSS DoS attempts ID:65 Impact:5 Rule:(?:(^|\W)const\s+[\w\-]+\s*=)|(?:(?:do|for|while)\s*\([^;]+;+\))|(?:(?:^|\W)on\w+\s*=[\w\W]*(?:on\w+|alert|eval|print|confirm|prompt))|(?:groups=\d+\(\w+\))|(?:(.)\1{128,}) Tags:map[tag:[rfe dos]] pattern:<nil>}
  1. BadCrawler, just Yandex(?!Search)
@dwisiswant0 dwisiswant0 added the bug Something isn't working label Dec 27, 2022
@dwisiswant0 dwisiswant0 self-assigned this Dec 27, 2022
@dwisiswant0 dwisiswant0 added known-issue help wanted Extra attention is needed and removed bug Something isn't working labels Dec 28, 2022
@dwisiswant0 dwisiswant0 pinned this issue Dec 30, 2022
@dwisiswant0 dwisiswant0 unpinned this issue Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed known-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant