infobyte / faraday

Open Source Vulnerability Management Platform
https://www.faradaysec.com
GNU General Public License v3.0
4.78k stars 885 forks source link

Wrong sort order of IPv4 addresses in WebGui #417

Closed securitytime closed 3 years ago

securitytime commented 3 years ago

Issue Type

Bug Report

Faraday version

Faraday v3.12 (deb)

Component Name

WebGui

Steps to reproduce

I uploaded an nmap XML file with the following scanned hosts:

192.168.0.1
192.168.0.2
192.168.0.3
192.168.0.10
192.168.0.20
192.168.0.100
192.168.0.200

In the WebGui these hosts are sorted incorrectly:

hosts

Apparently, Faraday sorts the IP addresses lexicographically instead of how IPv4 addresses are normally sorted.

This bug also occurs when selecting services from the "Service report" section.

Expected results

The WebGui should sort these IPv4 addresses like this:

192.168.0.1
192.168.0.2
192.168.0.3
192.168.0.10
192.168.0.20
192.168.0.100
192.168.0.200

OS

Provide information on your operating system. Example:

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
aenima-x commented 3 years ago

The "ip" field really can hold any string. For example in case a report from a tool has the hostname of the target but faraday cant resolve the ip address. That is why the sorting.