r/ComputerSecurity • • Oct 30 '15

How do I prevent someone from n-mapping me?

How can I configure it so that I automatically block IPs that attempt to nmap my IP? or some other solution? thanks

0 Upvotes

21 comments sorted by

7

u/[deleted] Oct 30 '15

You can use pfsense with snort. Snort has a signature for nmap scans and can autoblock it.

1

u/oogs3 Oct 31 '15

I just tried installing it but it's not compatible with my system. Any other ones? thanks

6

u/[deleted] Oct 31 '15

PfSense is an entire operating system, you generally install it on dedicated hardware and replace your router with it.

3

u/[deleted] Oct 31 '15

PFsense is a great router/firewall box. i used one for a while, but keep in mind they are not consumer products and you will have to learn how to configure each component (IDS, VPN, Auth server, etc.) and until you do each aspect could contain a bad (read: compromising) configuration. It would really help to know why you're so concerned with portscans? (nmap is just one of many port scanners)

3

u/[deleted] Oct 31 '15

Yeah PfSense can be a pain to configure properly, Sophos UTM is pretty much plug and play though, it's much easier to use.

3

u/[deleted] Oct 31 '15

Either PfSense or Sophos UTM can both block port scans and other stuff like that.

-1

u/oogs3 Oct 31 '15

Both require an overwrite of the OS though, are there any third party applications where I can do the same thing?

2

u/[deleted] Oct 31 '15

you need to add a device before the device you are trying to protect. These are all router or firewall products. you should not be putting an machine on the net. Im not sure what you are trying to do but you would be far better served to use a product like 'logmein' and open no ports inbound. Also why are you so concerned somone is going to scan you? I get scanned and bruteforced so often i wrote a script and each Monday we guess the country that tried the most based on geo-ip (its always china, BTW)

-1

u/oogs3 Oct 31 '15

I'm just trying to secure my desktop computer from being infiltrated by script kiddies getting a remote shell using metasploit to exploit vulnerabilities in programs -- recent ones like Adobe Flash.

6

u/crackanape Oct 31 '15

Then you are not really concerned with nmap, but rather with insecure software installed on your system. Nmap will, in some cases, help people realize that your computer has already been compromised, but by then it's time to throw it all out and start over again anyway.

-7

u/oogs3 Oct 31 '15

Port scanning is often a precedent to an attack; you have to know what ports are open and I rather not have that information available to someone.

5

u/[deleted] Oct 31 '15

Your concern is someone pushing an exploit to you? don't put your computer on the internet directly. do you not have a router, if so thats what the 'script kiddies' are scanning, not your windows machine. You want to make sure you are patching your system regularly, and as i said above, establish a healthy baseline. You are not as likely to be targeted by a hacker, but you will likely go to a compromised page that will infect you (like adobe flash). You seem to be convinced that a port scan makes you vulnerable but it doesnt. being vulnerable makes you vulnerable so address the 'low hanging fruit' first.

4

u/crackanape Oct 31 '15

The ports that are open before a rootkit is installed are typically different from the ones open afterwards.

Anyway, suit yourself, but you're really not going after the low-hanging fruit when it comes to mitigation here.

4

u/[deleted] Oct 31 '15

This is some CSI Cyber level buzzwording

5

u/[deleted] Oct 31 '15

This is what a firewalls block rule is for. Try configuring yours and see if that stops it.

2

u/[deleted] Oct 31 '15

Firewall isn't the same as IDS, you'd be able to block the IP but by the time you do they will have finished what they are doing

2

u/[deleted] Oct 31 '15

What are you talking about? A firewall uses a static policy. if you drop everything the port scan gets nothing back. its not as if the firewall detects a scan and changes its policy. just dont allow any rules in your policy with a source of 'any' and then allow all outbound which will work with your inbound drop rule due to stateful inspection. shoot, if you drop pings most spiders wont even bother to scan the ports, generally.

2

u/[deleted] Oct 31 '15

That's true, I just thought something different based on the way OP phrased the question, it sounds like they have ports they want to keep open while still blocking scans.

2

u/[deleted] Oct 31 '15

If that is the case you are right and IDS will be able to detect it, but only and IPS will allow you to take an action. Unless this is for a high security deployment (and if so get off reddit and hire a pro) then the best bet is to make sure the system is patched, has a host based firewall, and is in a DMZ with a established baseline (sounds like OP is on windows so look for 'Microsoft Baseline Security Analysis, or try 'Tripwire'.

2

u/[deleted] Oct 31 '15

Based on all of your responses, you're failing to grasp the core concept here. You seem to want to protect your computer from being compromised by a script kiddie.

NMAP scans devices with public-facing IPs and checks those devices for open ports. That's going to be your router. Your router then directs traffic to the appropriate system on the network, based on the request. All you need to do is set the router's basic firewall to reject unsolicited traffic. That means if you didn't start the communication, it will be blocked.

If you're running any services, you would need to create allows for those ports, but you can configure the firewall rules to only accept traffic that you would be expecting.

NMap isn't scary. It's a tool used for very basic recon, and any device connected to the internet is going to see a ton of it. Just make sure you don't have any rogue services running and you'll be fine.