Improving Web Application Vulnerability Detection Leveraging Ensemble Fuzzing
Improving Web Application Vulnerability Detection Leveraging Ensemble Fuzzing
net/publication/351239334
CITATIONS READS
0 11
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by João Caseirito on 22 September 2021.
Abstract: The vast majority of online services we use nowadays provide their web application to the users. The correct-
ness of the source code of these applications is crucial to prevent attackers from exploiting its vulnerabilities,
leading to severe consequences like the disclosure of sensitive information or the degradation of the availability
of the application. Currently, multiple existent solutions analyse and detect vulnerabilities in the source code.
Attackers, however, do not usually have access to the source code and must work with the information that is
made public. Their goals are clear – exploit vulnerabilities without accessing the code –, and they resort of
black-box fuzzing tools to achieve such. In this paper, we propose an ensemble fuzzing approach to check the
correctness of the web applications from the point of view of an attacker and, in a posterior phase, analyse the
source code to correlate with the collected information. The approach focuses first on the quality of fuzzers’
crawlers and afterwards on fuzzers capabilities of exploiting the results of all crawlers between them, in order
to provide better coverage and precision in the detection of web vulnerabilities. Our preliminary results show
that the ensemble performs better than fuzzers individually.
6.3 Scanners Evaluation crawlers. Also, w3af-EF was the fuzzer that had its
precision more increased. ZAP-EF exploited more
vulnerabilities in DVWA, while in the Mutillidae and
In this section it is assessed the capabilities of the
bWAPP applications, Wapiti-EF had better results.
fuzzers’ scanners, individually and in the ensemble.
In order to assess the quality of the scanners, we
Also, the section intents to find out if scanners have
compared the reported vulnerabilities between each
the ability to explore requests found by other crawlers
other, identifying the unique and common findings.
than their own fuzzer and, hence, exploit vulnerabili-
Figure 3 displays the vulnerability distribution for
ties from them.
each application. The common findings ranges 27%
For the individual evaluation, each scanner was – 50% between all scanners, and 14% – 49% between
run as standalone with the requests that its crawler two scanners. The unique findings in average are
discovered. On the other hand, in the ensemble, each 39%. Wapiti-EF and ZAP-EF had a greater number
scanner run with the requests found by the ensemble of unique findings, varying according to the applica-
fuzzing and provided by the distributor, after they be- tion tested. w3af-EF, on the other hand, had a low rate
ing formatted according to the fuzzer format. Hence, of unique findings (1 or 0).
having a list of requests gotten by the three fuzzers’ During the analysis we found interesting cases
crawlers, each fuzzer was fed with the list, and each when we compared the results of the scanners and the
fuzzer’s scanner used the requests, exercised them requests of the crawlers. Also, we tried all outputted
with diverse inputs and carried out attacks on the web results on the tested web applications (i.e., we per-
applications to try to exploit SQLi and XSS. formed the attacks manually) and we found that some
Table 1 summarize the results obtained from the of them were false positives. The next two sections
scanners on both evaluations, where columns 3, 5 and we present some of these cases.
7 regard individual fuzzers and columns 4, 6, and
8 to fuzzers in the ensemble (EF). The results vary 6.3.1 Identifying Interesting Cases
with the complexity of each web application. Again,
there is no scanner that is the best. It is visible that We considered an attack interesting if it fits in one of
fuzzers within the ensemble improves their precision the following cases: (i) the crawler of the fuzzer Fx
on discovering vulnerabilities, denoting thus that they missed the URLi and the remaining crawlers found it
are able to explore request that were found by other but were unable to explore it. In the ensemble, only
Wapiti W3af Wapiti W3af Wapiti W3af
0 40 6
0 1 17 1 10 0
7 25 10
0 2 6 0 0 0
4 5 11
Fx was able to explore the URLi and found the vulner- only found the parameters from a form that is used
ability; (ii) only the crawler of the fuzzer Fx was able to update information, missing a parameter that is
to find the URLi and explored it. In the ensemble, all needed to send the request; hence, its exploration
fuzzers were able to explore URLi and found the vul- failed. ZAP found the correct URL and explored it
nerability. (iii) both fuzzers Fx and Fy found the same successfully. When the correct URL (from ZAP) was
base URL, however Fy was not able to retrieve a valid explored by all fuzzers, they all were able to explore
request from it because Fy missed a variable or sent the vulnerability. The code that validates this request
an erroneous value. Fx discovered the correct request is presented in Listing 1. The vulnerable code can
(URLi ) and was able to explore it. In the ensemble, Fy only be accessible if all the parameters form, first-
also was able to explore URLi . name and lastname are set, making the parameter
We found 18 interesting cases, namely 6 from the form, discovered by ZAP, crucial in the vulnerability
first case, 11 from the second and 1 from the last. exploitation.
Table 2 presents an interesting XSS vulnerability we
Listing 1: Source code that validates the requests sent to
found of each case. We used a binary representation /bWAPP/xss php self.php
to identify if the vulnerability was explored or not.
if(isset( $_GET [" form " ]) && isset( $_GET [" firstname "
The ”–EF” columns represent the attacks performed
]) && isset( $_GET [" lastname " ]) ) {
in the ensemble, and the others columns represent the $firstname = $_GET [" firstname " ];
attacks performed by the fuzzer individually. $lastname = $_GET [" lastname " ];
Table 2: An example of XSS of each case. if( $firstname == "" or $lastname == "")
echo " < font color =\" red \" > Please enter both
URL Wapiti Wapiti-EF W3af W3af-EF ZAP ZAP-EF
/bWAPP/csrf 3.php 0 1 0 0 0 0 fields ... </ font >";
/DVWA/vulnerabilities/ 1 1 0 1 0 1 else
csrf/test credentials.php
/bWAPP/xss php self.php 0 1 0 1 1 1 echo " Welcome ". xss ( $firstname )." ". xss (
$lastname );
}
In the first row, it is represented a vulnerability
where the request was missed by the Wapiti’s crawler
but caught by other one’s crawlers, in which these 6.3.2 Identifying False Positives
were unable to exploit that vulnerability. Observing
the application code, there is a submit button that By manually performing all the attacks reported by
sends some values, including one that is in a hidden each fuzzer’s scanner, we confirmed a total of 15 false
input Wapiti was able to manage this hidden input, positives: 13 from ZAP and 2 from w3af. The last
unlike the other fuzzers. column of the Table 1 presents them on the three
The second row is the case mentioned in Section applications. Most of the ZAP false positives were
6.2. Wapiti’s crawler is the only one that found the XSS attacks in the application bWAPP, as the val-
URL, being able to explore it. When the URL is ues of the variables instantiated by ZAP were not
shared between all fuzzers, all of them exploited the used, since it was only checked if the variable was
vulnerability too. set. One example of a w3af false positive was in
In the last row, the w3af’s crawler missed the DVWA, as it reported a SQLi attack in “/DVWA/in-
URL, unlike the other crawlers. But, ZAP and Wapiti structions.php?doc=”, where the attacked parameter
returned different parameters for this URL. Wapiti was “doc”. Listing 2 presents a fragment of code that
deals with this parameter. Here, the value of the vari- Proceedings of the 28th USENIX Security Symposium,
able is only used to compare with values of an existing pages 1967–1983.
array, and if it does not match any of it’s values, a de- Chess, B. and McGraw, G. (2004). Static analysis for secu-
fault one is used. The value is not used anywhere else rity. IEEE Security & Privacy, 2(6):76–79.
in the application, and so no SQLi attack is possible. Demetrio, L., Valenza, A., Costa, G., and Lagorio, G.
(2020). WAF-A-MoLE. Proceedings of the 35th An-
Listing 2: Source code of the page attacked by the w3af nual ACM Symposium on Applied Computing.
fuzzer that resulted in a false positive. Doupé, A., Cavedon, L., Kruegel, C., and Vigna, G. (2012).
Enemy of the state: A state-aware black-box web vul-
$docs = array(
nerability scanner. In Proceedings of the USENIX
’ readme ’=> array( ’ file ’ => ’ README . md ’) ,
Conference on Security Symposium, pages 26–26.
’PDF ’=> array( ’ file ’ => ’ docs / pdf . html ’) ,
);
Duchène, F., Rawat, S., Richier, J., and Groz, R. (2013).
$selectedDocId = isset( $_GET [ ’doc ’]) ? $_GET [ ’doc ’
Ligre: Reverse-engineering of control and data flow
] : ’’;
models for black-box XSS detection. In Proceedings
if( ! array_key_exists ( $selectedDocId , $docs ) ) {
of the Working Conference on Reverse Engineering,
$selectedDocId = ’ readme ’;
pages 252–261.
} Duchene, F., Rawat, S., Richier, J.-L., and Groz, R. (2014).
$readFile = $docs [ $selectedDocId ][ ’ file ’]; Kameleonfuzz: evolutionary fuzzing for black-box
xss detection. In Proceedings of the ACM Conference
on Data and Application Security and Privacy, pages
37–48.
Holler, C., Herzig, K., and Zeller, A. (2012). Fuzzing with
7 CONCLUSIONS code fragments. In Proceedings of the 21st USENIX
Security Symposium, pages 445–458.
The paper presented an ensemble fuzzing approach Jovanovic, N., Kruegel, C., and Kirda, E. (2006). Pre-
for web applications to improve the detection of vul- cise alias analysis for static detection of web appli-
cation vulnerabilities. In Proceedings of the workshop
nerabilities by exploring all returned requests of all on Programming languages and analysis for security,
fuzzers’ crawlers and increase the code coverage of pages 27–36.
such applications. The approach was implemented Medeiros, I., Neves, N. F., and Correia, M. (2014). Au-
with three open-source web fuzzers and evaluated tomatic detection and correction of web application
with three well known vulnerable applications. The vulnerabilities using data mining to predict false posi-
preliminary results are promising and showed that tives. In Proceedings of the International Conference
there are advantages to have such ensemble, specially on World Wide Web, pages 63–74.
in those cases where it is able to detect vulnerabilities Miller, B. P., Fredriksen, L., and So, B. (1990). An empiri-
that would be missed if the fuzzers would run indi- cal study of the reliability of UNIX utilities. Commu-
nications of the ACM, 33(12):32–44.
vidually. As a further step, we want to identify in the
Ryan, K. (2020). Patched zoom exploit: Altering camera
code of the applications the vulnerabilities exploited
settings via remote sql injection.
by inspecting the code traces resulting from fuzzers.
Sargsyan, S., Kurmangaleev, S., Hakobyan, J., Mehrabyan,
M., Asryan, S., and Movsisyan, H. (2019). Directed
fuzzing based on program dynamic instrumentation.
ACKNOWLEDGMENTS. This work was par- In Proceedings of the International Conference on En-
tially supported by the national funds through gineering Technologies and Computer Science, pages
FCT with reference to SEAL project (PTDC/CCI- 30–33.
INF/29058/2017) and LASIGE Research Unit Sohoel, H., Jaatun, M., and Boyd, C. (2018). Owasp top 10
(UIDB/00408/2020 and UIDP/00408/2020). - do startups care? pages 1–8.
Sutton, M., Greene, A., and Amini, P. (2007). Fuzzing:
brute force vulnerability discovery. Addison-Wesley.
REFERENCES Vimpari, M. (2015). An evaluation of free fuzzing tools.
Williams, J. and Wichers, D. (2017). OWASP Top 10 -
2017 rcl - the ten most critical web application secu-
Araújo, F., Medeiros, I., and Neves, N. (2020). Generat- rity risks. Technical report, OWASP Foundation.
ing tests for the discovery of security flaws in prod-
uct variants. In Proceedings of the IEEE International
Conference on Software Testing, Verification and Val-
idation Workshops, pages 133–142.
Chen, Y., Jiang, Y., Ma, F., Liang, J., Wang, M., Zhou, C.,
Jiao, X., and Su, Z. (2019). Enfuzz: Ensemble fuzzing
with seed synchronization among diverse fuzzers. In