lanmaster53 / recon-ng

Open Source Intelligence gathering tool aimed at reducing the time spent harvesting information from open sources.
GNU General Public License v3.0
4.1k stars 646 forks source link

netblocks lookup fails "has host bits set" #90

Open rameyst opened 4 years ago

rameyst commented 4 years ago

when attempting to lookup a netblock with cidr notation, an error is generated if the host bit is set. ex. xx.xx.xx.67/24 -> will raise ValueError('%s has host bits set' % self)

to fix it, in the recon-ng/recon/core/module.py add "False" when passing the netblock string to the ipaddress.ip_network(string) function.

def cidr_to_list(self, string): import ipaddress return [str(ip) for ip in ipaddress.ip_network(string, False)]

lanmaster53 commented 4 years ago

This is a valid issue. Thank you. Do you mind submitting a pull request to the staging branch?