Code Monkey home page Code Monkey logo

Comments (5)

sir-ragna avatar sir-ragna commented on August 24, 2024 1

I'm afraid I cannot share the original scan. I'll see if I can create a test xml file which reproduces the issue as well.

For reference the scan command I used: nmap -sn -oX hosts.xml 172.20.0.0/16 -d. I manually changed the XSLT line in the xml afterwards and ran xsltproc -o hosts.html hosts.xml. The resulting HTML file is 7.938.147 bytes for me. Is your HTML file a similar size?

My setup is a lightweight Kali VM (2GB RAM) with Firefox 52.9.0 and I also tested in Windows 10 1803 with Firefox 61.0.2(8GB RAM). Both seem unresponsive and in both Firefox versions I get prompted "A webpage is slowing down your browser. Would you like to wait? (Stop/Wait)". If I press wait several times and give it enough time it will eventually render the whole page and render correctly.

Chrome 68.0 on W10 the page is responsive while it is loading in the the DOM elements. When everything is loaded in it seems however that not all the Javascript is executed. The list of hosts does not have paging and is just one long list. I get the following error in the Chrome console.
image


BTW thanks for creating this and sharing it.

from nmap-bootstrap-xsl.

honze-net avatar honze-net commented on August 24, 2024 1

I managed to reproduce the problem by manually duplicating offline hosts in a test XML file. The HTML files are getting really big, also. The slow part seems to be the DOM parser of the browser, as it tries to render a huge table. Even if that part gets better, JS crashes as you stated above. So I think there is really no reason to show more than 1024 offline hosts. Therefore, I hard coded that into the XSL. Seems to be the most convenient fix, for now.

Please test the current Dev/nmap-bootstrap.xsl and see if that fixes the problem. Thank you very much.

I am standing on the shoulders of giants. This is just a little XSL file. But, you are welcome!

from nmap-bootstrap-xsl.

sir-ragna avatar sir-ragna commented on August 24, 2024 1

Works like a charm. Thanks.

from nmap-bootstrap-xsl.

honze-net avatar honze-net commented on August 24, 2024

Thank you for opening an issue for that. Indeed, /16 is big and the sheer amount of hosts can slow down the page (probably because of JavaScript). But scanning a /16 is a rather normal use case for nmap, so this should be fixed.

I will generate a test case with 64K hosts, in order to check for this bug in the future.

If you have a solution for the problem, you can submit a pull request. I have created the Dev branch in order to work on a solution. My idea is to prevent all hosts, that are down, going into the data tables, if the count of down hosts is above a threshold. Maybe 1K, 2K, 4K?

Update:
I created a file with 64K hosts. 252 are online. In my setup (Kali Linux VM - 4GB RAM - Firefox 61.0.1 (64-Bit)) I could not recreate the bug. Scrolling and navigating works like other files. Can you share your xml file? What is your setup?

from nmap-bootstrap-xsl.

honze-net avatar honze-net commented on August 24, 2024

Nice, I will merge this into master.

from nmap-bootstrap-xsl.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.