Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Ignore Ports When Nothings Listening #19142

Open
hbednar opened this issue Jan 27, 2023 · 6 comments
Open

[Request] Ignore Ports When Nothings Listening #19142

hbednar opened this issue Jan 27, 2023 · 6 comments
Labels

Comments

@hbednar
Copy link
Contributor

hbednar commented Jan 27, 2023

I get a lot of events each day just from mass scans, which makes it hard to filter out the more useful events.
Would it be possible to ignore any scan on ports that are not in use to decrease the number of events.
As an example, i don't use telnet so every time that port 23 gets scanned can this be ignored, thanks.

@MikhailKasimov
Copy link
Collaborator

Hello!

USER_IGNORELIST variable is the way here: https://github.com/stamparm/maltrail/blob/master/maltrail.conf#L124-L125

Description: Location of file with ignore event rules. Example under misc/ignore_events.txt

Syntax of /misc/ignore_events.txt:

image

i don't use telnet so every time that port 23 gets scanned can this be ignored, thanks.

Hence, your case is *;*;23;*.

@MikhailKasimov
Copy link
Collaborator

Fixing the misorder: c7ab71c

image

Correct syntax for your case: *;*;*;23

@hbednar
Copy link
Contributor Author

hbednar commented Feb 1, 2023

Thanks for your comment but, is there any way to automate this as am getting a lot of events around 5k to 10k each day and the ports are generally mixed, see example below.

Also looking at the example you gave, this will ignore both ingoing and outgoing connections.

Screenshot

@MikhailKasimov
Copy link
Collaborator

Thanks for your comment but, is there any way to automate this as am getting a lot of events around 5k to 10k each day and the ports are generally mixed, see example below.

Not sure on having automation "out-of-box" here. Please, provide also trail and info columns output here: perhaps, some other way could be applicable here.

Also looking at the example you gave, this will ignore both ingoing and outgoing connections.

Yes, because fields src_ip and dst_ip are *, which mains any.

Screenshot

I can see 23 (telnet) on picture. Is it before applying *;*;*;23 option or after?

@MikhailKasimov MikhailKasimov reopened this Feb 1, 2023
@hbednar
Copy link
Contributor Author

hbednar commented Feb 2, 2023

Not sure on having automation "out-of-box" here. Please, provide also trail and info columns output here: perhaps, some other way could be applicable here.

Giving people the option to enable this would make sense, as devices on an internal network are a lot less noisy.

Yes, because fields src_ip and dst_ip are , which mains any.
I can see 23 (telnet) on picture. Is it before applying ;;
;23 option or after?

So there is currently no option to specify incoming and outgoing connections separately.

Is this what you are looking for:

Screenshot

@MikhailKasimov
Copy link
Collaborator

MikhailKasimov commented Feb 2, 2023

Hello!

Not sure on having automation "out-of-box" here. Please, provide also trail and info columns output here: perhaps, some other way could be applicable here.

Giving people the option to enable this would make sense, as devices on an internal network are a lot less noisy.

Thanks for the updated screenshot. It helps to propose to you the IGNORE_EVENTS_REGEX variable to apply:

https://github.com/stamparm/maltrail/blob/master/maltrail.conf#L127-L128

Your case would be: IGNORE_EVENTS_REGEX mass scanner|known attacker

Yes, because fields src_ip and dst_ip are , which mains any.
I can see 23 (telnet) on picture. Is it before applying ;;
;23 option or after?

So there is currently no option to specify incoming and outgoing connections separately.

Why not? Use two strings. E.g.:

*;*;192.168.1.1;23 <-- ignoring all incoming connections on port 23 to IP 192.168.1.1
192.168.1.1;*;*;23 <-- ignoring all outgoing connections on port 23 from IP 192.168.1.1

Netmasks/ranges are not supported, as far as I remember. So 192.168.1.0/24;*;*;23 <-- ignoring all outgoing connections on port 23 from all IPs from subnet 192.168.1.0/24 and 192.168.1.1-15;*;*;23<-- ignoring all outgoing connections on port 23 from all IPs of range 192.168.1.1-192.168.1.15 won't work. Perhaps, adding support of netmasks/ranges is reasonable here... What do you think, @stamparm ?

Is this what you are looking for:

Screenshot

Yes, it helps. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants