Anaranjado
Introduction
When security tools crawls for links within target applications, there are some restrictions while parsing JavaScript files. In specific, during many pentest projects it was seen that some links were hardcoded within JavaScript files, but scanners aren't able to find them.
For example, considering the following HTML file:
<html>
<body><script src="thisIsTest.js"></script>
<a href="www.google.com.ar
"> Google! </a>
</body>
</html>
And the referenced JavaScript file (thisIsTest.js) is the following:
public void thest(){
page = "http://www.Encontrame.com.ar
";
for(1;99;){
page2 = "/foundme.asp";
}
page34="http:%2f%2fencontrame2.com%2ftest%3fa%3d2
";
if s == 3{
line = "jojo";
}
page55="http%3a%2f%2fencontrame3.com%2ftest%3fa%3d2
";
while (2){
do something
}
redirect = "/foundme2.asp?a=33";
}
By using Burp to spider the site, the following result was achieved:
[+] http://localhost
- craul
- index.html
- thisIsTest.js
[+] http://www.encontrame.com.ar
By crawling the page using Arachni, the following result was achieved:
[+] http://localhost/craul/index.html
[+] http://localhost/craul/thisIsTest.js
[+] http://localhost/craul/www.google.com.ar
While using Anaranjado
, the following result was achieved:
[i]- Hey! This is good, some links were found within JavaScript Files:
http://encontrame2.com/test?a=2
From: http://localhost/craul/thisIsTest.js
/foundme.asp
From: http://localhost/craul/thisIsTest.js
http://encontrame3.com/test?a=2
From: http://localhost/craul/thisIsTest.js
http://www.Encontrame.com.ar
From: http://localhost/craul/thisIsTest.js
/foundme2.asp?
From: http://localhost/craul/thisIsTest.js
Summary
Anaranjado is a scraping tool that identifies URLs within JavaScript files.
Usage
In order to identify JavaScript referenced files within an HTML file, run the following command:
python Anaranjado.py --url http://localhost/
The tool will retrieve all .js files and then will perform scraping to each one. The final result will be a list of identified links within JavaScript files.
In order to scrap a single JavaScript file, run the following command:
python Anaranjado.py --jsUrl http://localhost/craul/thisIsTest.js
Coming Anaranjado is still being developed and this will be happening soon:
- Bug fixing
- False positive improvement
- Regex enhancement
- New funtionalities
- Threading
- Full Crawling