Skip to main content
tumming
Visitor III
November 2, 2023
Solved

Is it possible to sniff for IP numbers that are _not_ in a list?

  • November 2, 2023
  • 4 replies
  • 3683 views

I have a list of < 300 IP numbers that I know about. We're not using DHCP, so there should be no addresses outside of those 300. I am really curious if there is any traffic going to IP numbers that I don't know about. If there is it could indicate something that is broken, or a hacker trying to discover something. This is obviously would work only on internal ports. 

 

Any ideas?

Best answer by ebilcari

You can create an Address Group with all the known IPs you have in your subnet and create two firewall polices. On the first firewall policy allow access by specifying this group as Source. Clone the same rule and put it below and this time allow all the IP range for that subnet. On the second firewall policy enable "Log Allowed Traffic: All Sessions". This way you can verify if the second policy is used by any other IP (outside of the address group) and what traffic are they generating.

4 replies

knagaraju
Staff
Staff
November 3, 2023

Hi tumming,

Could you please let me know if IP numbers means Protocol numbers ?

Sniffer command has options which are mentioned in the below link
https://docs.fortinet.com/document/fortigate/6.2.15/cookbook/680228/performing-a-sniffer-trace-cli-and-packet-capture

Please let me know if you have any additional queries.

Regards
Nagaraju.

 

tumming
tummingAuthor
Visitor III
November 3, 2023

No, I meant IP addresses. We call them IP numbers here. I had already rtfm'd and could not find an answer, hence my posting here.

 

tom

ebilcari
Staff
ebilcariAnswer
Staff
November 3, 2023

You can create an Address Group with all the known IPs you have in your subnet and create two firewall polices. On the first firewall policy allow access by specifying this group as Source. Clone the same rule and put it below and this time allow all the IP range for that subnet. On the second firewall policy enable "Log Allowed Traffic: All Sessions". This way you can verify if the second policy is used by any other IP (outside of the address group) and what traffic are they generating.

Emirjon
tumming
tummingAuthor
Visitor III
November 3, 2023

Yes! This looks like what I'm asking for. I already know how to create address groups from the command line, and I can write a simple script to automate creating the command. Then just cut'n paste into the cli. Easy peasy!

 

I'm going to run this by some other folks here first. If I mess up, I could break things badly.

 

Thanks for the answer, and actually reading the question! :)

 

tom

mle2802
Staff
Staff
November 3, 2023

Hi @tumming,

Do you mean IP address? If that, you can try this command "diag sniffer packet any "host X.X.X.X" 4 0 l" (replace X.X.X.X with your desired IP).

Regards,
Minh

tumming
tummingAuthor
Visitor III
November 3, 2023

That would work for an individual IP address. What I need is something like "diag sniffer packet not "long list of ip addresses"..

 

hbac
Staff
Staff
November 3, 2023

Hi @tumming,

 

You can sniff any IP addresses. Please refer to https://community.fortinet.com/t5/FortiGate/Troubleshooting-Tip-Packet-Capture-on-FortiOS-GUI/ta-p/194444

 

Regards, 

tumming
tummingAuthor
Visitor III
November 3, 2023

I have almost 300 IP addresses. That solution would only work for onesies twosies.