This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Irritating portscanner...

Hi all,
For the last 3 weeks, I have a very irritating person who's scanning my ports 4 times a day!
I know ASG will drop the packets but I want to block his IP permantly!
In iptables there's an option to drop his connection. Is it possible to disable his IP to access the firewall? If so, how do I do this?

in the meanwhile: Everyone: HAPPY NEW YEAR !!!


This thread was automatically locked due to age.
  • You can create a Blackhole DNAT (just use a nonsensical, non-existent host definition as the final destination) for external attackers, just add them as the source group.

    I do have one customer that this does not appear to work on... it is annoying that there is not a blacklist for the portscan detector itself; it's one of the first modules to see packets, so a simple packet filter drop does not work.
  • Thanks for the fast reply. If I'm understandig it correctly, I set this up as following:
    >Network Security>NAT>DNAT/SNAT>New NAT Rule:

    Traffic Source: IP  to be "blocked"
    Traffic Service: ANY
    Traffic Destination: External (WAN) Address (or ANY?)
    NAT Mode: DNAT
    Destination: IP of a not existing IP in LAN

    Should there be a packet filter rule?????

    Thanks in advance!
  • Hi, the Traffic Destination should be External WAN Address.

    Do not set an 'auto packet filter rule' on that page.

    To be safe, create a PacketFilter rule of that source IP to any, any service, drop (or drop log).

    Barry
  • and what if I only make a PF-rule and put it at the top of the PF-list:

    Source: IP to be dropped
    Service: ANY
    Destination: ANY
    Action: DROP

    Is this enough to deny/drop this IP?
  • The Packet Filter rule alone will not work (as I explained in my first reply); the portscan detector gets to look at IP traffic before the packet filter.  With just the packet filter rule, yes, the traffic will never make it beyond the outside interface, but the Portscan detection will still be triggered.  Currently you have to configure the "blackhole" DNAT rule.  And Barry is correct, use the external IP Address(es) instead of ANY as the Destination in the DNAT rule.

    Hopefully Astaro will include a blacklist option for the portscan detector in a future release, doing it this way is admittedly a bit "kludgy."
  • al righty then I set it up as follows:

    PF Rule:
    Source     : IP(s) to be dropped
    Service    : ANY
    Destination: ANY
    Action    : DROP

    DNAT Rule:

    Traffic Source     : IP(s) to be dropped
    Traffic Service    : ANY
    Traffic Destination: ANY
    NAT Mode           : DNAT
    Destionation       : IP of a not existing host on LAN

    Please correct or give a "nicer" setup...
  • Fobe, as both Barry and Bruce told you above, the 'Traffic destination' in the traffic selector portion of the DNAT must be "External (Address)" instead of "Any."  For the reason for that and a discussion of the INPUT and FORWARD chains, see: https://community.sophos.com/products/unified-threat-management/astaroorg/f/54/p/39358/134494#134494

    Cheers - Bob
    PS If you log the packet filter rule above, I think you'll find that you have the same experience I did.
  • I took your advice. Unfortunately it doesn't work. I still get portscan detections from that dude from China!
    I have 2 WAN-connections I made DNAT-settings for both WAN-interfaces and 1 PF-rule. What I'm doing wrong?
    It is now set as follows:

    PF Rule:
    Source : IP(s) to be dropped
    Service : ANY
    Destination: ANY
    Action : DROP

    1st DNAT Rule:

    Traffic Source : IP(s) to be dropped
    Traffic Service : ANY
    Traffic Destination: WAN-1
    NAT Mode : DNAT
    Destionation : IP of a not existing host on LAN

    2nd DNAT Rule:

    Traffic Source : IP(s) to be dropped
    Traffic Service : ANY
    Traffic Destination: WAN-2
    NAT Mode : DNAT
    Destionation : IP of a not existing host on LAN
  • I don't understand why the DNAT approach doesn't work.  I solved the same problem with just a PF rule.  Using that approach all you should need is:

    First, create a group "External Addresses" with 'WAN-1 (Address)', 'WAN-2 (Address)' and other Additional Addresses on those interfaces.  Then, a PF rule:

    Source : IP(s) to be dropped
    Service : ANY
    Destination: "External Addresses"
    Action : DROP

    Cheers - Bob