fcavallarin / htcap

htcap is a web application scanner able to crawl single page application (SPA) recursively by intercepting ajax calls and DOM changes.
GNU General Public License v2.0
611 stars 114 forks source link

Refactoring of the JS probe v.1.1 ;) #27

Closed GuilloOme closed 7 years ago

GuilloOme commented 7 years ago

Fix #22 and issues from #26, there is a lot of change here, it's some pretty advanced low level javascript (as low as javascript can go ;) ). if you need more information about it, ask me!

What have been done

Benefits

Drawback

Test

Got a 85% coverage on wivet (was 35% before) Got more result from http://htcap.org/scanme:

segment-srl commented 7 years ago

the recursion is still not working as expected. From htcap.org/scanme/ng/ the "steps" should be crawled in this order: 1,2,20,3,4,5,21,22. Your code produces 1,2,20,3,21,4,22,5. Also there are still duplicate requests to the database.

GuilloOme commented 7 years ago

The order is different because it runs async so it call the next one as soon it's ready (call get 2 and 20, request 3 and 21…). In fact, it could be a problem in some edge case.

For the question of the duplicates, since the referrer urls* are different, every request made from these urls are considered different.

* index.php, index.php?document-location-href=1, index.php?document-location=1, index.php?openurl=undefined and index.php?window-location=1