Skip to content

Commit e493e33

Browse files
committed
sort IP addresses if a range is selected
1 parent d498a48 commit e493e33

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

analyze_hosts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,8 @@ def prepare_queue(options):
335335
scanner = nmap.PortScanner()
336336
scanner.scan(hosts='{0}'.format(options['target']),
337337
arguments=arguments)
338-
hosts = scanner.all_hosts()
338+
hosts = sorted(scanner.all_hosts(),
339+
key=lambda x: tuple(map(int, x.split('.'))))
339340
else:
340341
hosts = [options['target']]
341342
with open(options['queuefile'], 'a') as queuefile:

0 commit comments

Comments
 (0)