Hi, Monks.
I have a task to parse line, containing XSS vulnerability string and find a vulnerable file in it. Here some examples:
my @vulnerabilities = qw( http://www.parismatch.com/recherche/recherche?motcle="%2F><marquee +>xss+death-angel<iframe+src%3D"htt p%3A%2F%2Fwww.xssed.com"%2F>&x=5&y=6 https://www.simplydomains.co.nz/register.php/ref="><script>alert(1 +);</script> https://www.simplydomains.co.nz/logon/ref="><script>alert(1);</scr +ipt> https://www.eso.shell.com/eso/e_invoice_jsp/req_form_uk2.jsp?coun +trycode=18&language=%22%3E%3Cscript%3Ealert(%22daimon%22)%3C/script%3 +E ); foreach my $vuln (@vulnerabilities) { my ($file) = $vuln =~ m{^/.*?([^/]+)[\?/]}; print $file, "\n"; }
So the correct list for me is:
recherche register.php logon req_form_uk2.jsp
The main problem for me is to find where mod_rewrite stuff starts (where ? changed with /). How i can find it? May be i need several regex?
Thanks.
Roman
In reply to Need help with regex/strategy by Gangabass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |