question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disassemble regex in 930100

See original GitHub issue

The regex in 930100 is rather hard to read. It would be worthwhile to disassemble it and then generate it via script:

(?i)(?:\x5c|(?:%(?:c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|2(?:5(?:c(?:0%25af|1%259c)|2f|5c)|%46|f)|(?:(?:f(?:8%8)?0%8|e)0%80%a|bg%q)f|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|u(?:221[56]|002f|EFC8|F025)|1u|5c)|0x(?:2f|5c)|/))(?:%(?:(?:f(?:(?:c%80|8)%8)?0%8|e)0%80%ae|2(?:(?:5(?:c0%25a|2))?e|%45)|u(?:(?:002|ff0)e|2024)|%32(?:%(?:%6|4)5|E)|c0(?:%[256aef]e|\.))|\.(?:%0[01]|\?)?|\?\.?|0x2e){2}(?:\x5c|(?:%(?:c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|2(?:5(?:c(?:0%25af|1%259c)|2f|5c)|%46|f)|(?:(?:f(?:8%8)?0%8|e)0%80%a|bg%q)f|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|u(?:221[56]|002f|EFC8|F025)|1u|5c)|0x(?:2f|5c)|/))

For the record: 930100 protects us from CVE-2021-41773, yet looking at the regex I can not readily see how.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
theseioncommented, Oct 24, 2021
##! These use the same techniques as for slashes to evade the detection of '.'
\.
\.%00
\.%01
\.\?
\?\.
\?
%2e
0x2e
%c0\.
%252e
%c0%2e
%c0%ae
%c0%5e
%c0%ee
%c0%fe
%uff0e
%%32%%65
%e0%80%ae
%25c0%25ae
%f0%80%80%ae
%f8%80%80%80%ae
%fc%80%80%80%80%ae
%2%45
%u002e
%uff0e
%u2024
%%32%45
%%32E
%c0%6e
1reaction
theseioncommented, Oct 24, 2021
##! source: https://github.com/wireghoul/dotdotpwn/blob/master/DotDotPwn/TraversalEngine.pm
##! attack description: https://doc.lagout.org/security/McGraw.Hill.HackNotes.Web.Security.Portable.Reference.eBook-DDU.pdf
##! Excerpt:
##! In short, IIS turns %c0%af into
##! the ASCII / character, but parses it at a point where security checks for
##! ‘../’ traversals have already occurred!
##! What has really happened? The attack uses an overlong Unicode
##! representation for a forward or backward slash (/ or \).
##! Unicode permits multibyte encoding of the same character.
##! The fundamental representation can be referred to as a one (character) to one (byte field)
##! representation. The overlong representation is a one (character) to many
##! (bytes) version.
##! Two more valid strings that represent the backward slash are %c1%1c
##! and %c1%9c. The difference between these two hex values is 128. More
##! valid slash representations boil down to a matter of math. For example,
##! %c0%9v works even though %9v isn’t a hexadecimal value. Try adding
##! the value for “9” (57) to “v” (118); if the result is greater than 127, then
##! subtract 128—hint, the final result should be 47.

##! URI encoded
%2f
%5c
##! hex encoded
0x2f
0x5c
##! double URI encoded
%252f
%255c
##! overlong Unicode sequences (target IIS)
%c0%2f
%c0%af
%c0%5c
%c1%9c
%c1%pc
%c0%9v
%c0%qf
%c1%8s
%c1%1c
%c1%af
%bg%qf
##! Unicode 16 "alternative" glyphs
%u2215
%u2216
##! unknown
%uEFC8
%uF025
##! more double encoding and variations on the above
%%32%%66
%%35%%63
%e0%80%af
%25c1%259c
%25c0%25af
%f0%80%80%af
%f8%80%80%80%af
%2%46
%%32%46
%%32F
%u002f
%1u
/
Read more comments on GitHub >

github_iconTop Results From Across the Web

Disassembly Regex - NVIDIA Documentation Center
The Disassembly Regex experiment is a framework for creating custom experiments to count classes of instructions. The experiment is configured by a script, ......
Read more >
Regular Expression (Regex) Tutorial
Regular Expression, or regex or regexp in short, is extremely and amazingly powerful in searching and manipulating text strings, particularly in processing ...
Read more >
Find and replace text using regular expressions - JetBrains
Enter a search string in the top field and a replace string in the bottom field. Regex search and replace fields. Click the...
Read more >
Regular Expression Examples - Regular-Expressions.info
Sample Regular Expressions. Below, you will find many example patterns that you can use for and adapt to your own purposes. Key techniques...
Read more >
RegEx Tool | Alteryx Help
Use RegEx (Regular Expression) to leverage regular expression syntax to parse, match, or replace data. RegEx Support. While regular expressions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found