Evasion ladder — final levels

levels 5–6

Active filter:

Switch level: Level 5 Level 6
Method — exploit the filter's grammar assumptions
  1. <u>test</u> first. On these levels even that may vanish — the source view tells you what got eaten, which is the fingerprint of the filter.
  2. Level 5: the pattern needs a closing bracket. A tag that opens but never closes isn't a match candidate. Browsers finish the job once your reflection is followed by the page's own markup — the parser completes the tag at the next > it meets.
  3. Level 6: closed-or-not, the deny-listed tags vanish. New trick: let the filter delete FOR you. If the filter strips the token script, then breaking the tag apart makes the filter rebuild it — it removes the exact piece glueing your halves together.
  4. Also try: leading the tag with junk the pattern won't anchor, or splitting across two sink copies on real targets. Grammar ignorance is the finger you point at the regex.
Spoiler — Level 5: the unclosed tag
<img src=x onerror=alert(1)

No trailing > → the balanced pattern has nothing to match. Followup markup from the page completes the tag when the browser parses it — the handler fires anyway. If a filter seems to keep your payload but eat its head, check what it thinks a tag is.

Spoiler — Level 6: tag reassembly (the filter does the work)
<scr<script>ipt>alert(1)</scr<script>ipt>

The filter strips the script token — removing the piece that holds your halves apart. Left over: <scr + ipt> and </scr + ipt> — which reassembles into the very tag it was written to kill. Same trick for any deny-listed name: <i + <img> + mg>. This is the final evolution in the lesson, and it works BECAUSE the filter is too aggressive.