ivre / masscanned

Let's be scanned. A low-interaction honeypot focused on network scanners and bots. It integrates very well with IVRE to build a self-hosted alternative to GreyNoise.
GNU General Public License v3.0
107 stars 15 forks source link

IP addresses selection enhancements #62

Open Unactived opened 2 years ago

Unactived commented 2 years ago

Hello,

at the moment, using the tool one can specify an exact list of IP addresses to impersonate in a file, or it defaults to all of them.

It could be nice to:

These last two can probably be achieved by careful routing of what to listen to masscanned, e.g. as done in https://masscanned.readthedocs.io/en/latest/usage.html where it's to ignore tcp on a port, but it still looks to me as an interesting feature to have directly in the tool.

In its current state the related part of the codebase already seems to, at least initially, want to support "blacklisting" IPs, but not fully.

e.g. the function to extract ip addresses from the given file, defined at https://github.com/ivre/masscanned/blob/851a418add74d13189bb0f46786d2b4f91f69cb2/src/utils/parsers.rs#L97-L135 takes a blacklist Option argument, likely to ignore ip addresses, but doesn't act on it. And when it's called at https://github.com/ivre/masscanned/blob/851a418add74d13189bb0f46786d2b4f91f69cb2/src/masscanned.rs#L179 the argument is hardcoded to None.

Maybe this is written down in some todo/roadmap but since I don't have access to it I'm asking anyway.

p-l- commented 2 years ago

Hi there,

First of all, there is no hidden roadmap or todo list for the project, you have access to everything that exists!

I suppose we never felt the need for another way to configure the IP addresses since the current configuration way allows for things like ivre runscans --output ListAll --net 1.2.3.0/12 > iplist; masscanned -i iplist.

But I do agree having something else might be good, you're right. If you want to submit a patch, I'd advice that you first propose (here for example) the options you would like to introduce before coding, so that it can be discussed.

Frky commented 2 years ago

Hi,

Thanks for the issue. I'll look into it. Blacklists are indeed partially implemented but not used, that is because this portion of code (parsers.rs) is copied/pasted from another small tool that we never published.