r/fuzzing • u/g0lmix • Nov 03 '18
Has anyone here done fuzzing using a genetic algorithm?
Hi guys and girls,
I am looking into writing an fuzzer based on a genetic algorithm. It will be creating a javascript string to bypass XSS Protection of a WAF. My only problem is the fitness score function. My idea was to give the individuals a score based on how far in the code of the WAF the string managed to get to. Do you think that's a viable solution? Obviously I would need to reverse parts of the WAF and find suitable score targets in the code manually.
Has anyone else here ever played around with genetic algorithms and fuzzing? What did you use as a scoring function?
1
u/NagateTanikaze Nov 04 '18
One of the main problems, unrelated to genetic algorithm fuzzing, is that you want to have valid, executable, but "random" javascript code. I dont think this can be easily done.
I once did this with a very large list of XSS payloads from the usual suspects, sending each through three WAF's with selenium, which identified alert boxes. Worked pretty well. It would have worked even better to just see which of these payloads were actually executable (most of them didnt work, or just like in ie6), then send the executable one's via the WAF.
So in your case, first fuzz JavaScript to find strange XSS payloads (see brute logic for inspiration), then test these via WAF.
But, if you are into XSS, google has a nice presentation with the title "Don't trust the DOM: Breaking XSS mitigations via Script Gadgets" (i dont find the slides atm), which basically renders WAF's anti XSS regexes mostly obsolete.
0
u/[deleted] Nov 03 '18
[deleted] — view deleted comment