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

Blocking a hacker

Hi,
I've just discovered for about the past 4 hours I've had someone trying to access my exchange server. I thought I could put their IP address in as the source on the firewall, service as any, and destination as either any or internal network and then drop the packets.. but it doesn't seem to work...

Can anyone help? - I want to stop this person just incase they happen to gain access...


This thread was automatically locked due to age.
  • falling back on the "rulz":
    In general, a packet arriving at an interface is handled only by one of the following, in order: DNATs first, then VPNs and Proxies and, finally, manual Routes and Firewall rules. (see attachment below)

    so I guess you either have a DNAT or manual route to the exchange server which matches first, so it doesn't even hit the firewall

    note: (this is how I understand it, can someone confirm?)
  • Yeah most likely you have a DNAT set to forward traffic from your external interface to your internal IP.

    You have some options, 
    you could create a White List of IPs that should be accessing your server. Only forward trusted IPs to your server. This Does not help if your server is open to the public.

    You could place a new NAT rule above your current one to blackhole the attacker sending packets to a junk IP. I have not had much luck with this approach.

    Or you could create your own custom firewall rules.
    1) First I would create a new firewall rule that duplicates that NAT rule to allow traffic, turn on Logging
    2) Then turn off Automatic firewall rules on your original NAT, traffic should now depend your new firewall rule you to access the server.
    3) Confirm people can still reach your server, by looking at the logs.
    4) Create a new firewall rule that blocks the attackers IP, MAKE SURE you place it above the firewall rule you made in step 1. Turn on Logging
    5) Confirm again by looking at the live logs. You should see all traffic green other then your attacker who should be getting blocked.

    The blocking firewall rule must be above your allow rule (Have a lower number). Firewalls start at rule #1 then look at #2 and goes down the list of rules until it hits a rule that applies, once it finds a matching rule, it stops looking. If your allow rule is first it will never see the blocking rule.
  • Frank, "manual Routes and (manual) Firewall rules" are considered only if the automatic routes and firewall rules for "DNATs, Proxies and VPNs" don't handle the traffic first.  I'll change the wording in Rulz to make that clearer.  Thanks!

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • How do you recommend setting up DNATs BAlfon? I like just turning off the automatic rules created with NAT, because there is no deny ability. 

    I always thought the Automatic rules generated with NATS should be set to the very bottom of the firewall list, after User generated ones, not the top, that would stop a lot of confusion.
  • Once you understand how it works, it's easier like this.  Plus, I think putting the auto rules at the bottom would create too many problems for most admins.  Here's a picture of a Blackhole DNAT on our UTM.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I know this thread is quite old, but what does Sophos do with packets to the "Null Route"? I mean...does Sophos send out packets to it's default route to look for the target (null route)? If so, doesn't this mean, that sophos just do more work instead of just droping the packets?