View previous topic :: View next topic |
Author |
Message |
lots Tux's lil' helper
Joined: 11 Mar 2003 Posts: 95
|
Posted: Sun Oct 15, 2006 4:22 pm Post subject: Shorewall oddities |
|
|
I'm using Nmap on a windows machine (yeah I know , but its the only machine type I have available outside my shorewall router). I'm testing a new machine's firewall that I plan to replace my current firewall/router with. Upon using nmap's connect() scan, I discovered a bunch of random ports that are listed by nmap as open. Ports 22, 25, 113, nntp, imap, pop3, imap2. There may have been a few others, but I dont remember off the top of my head.
I thought this was odd, because during the test, the only port that should have reported back was 22, due to ssh. All the others should be filtered. I dont even have services running on these ports. So I figured I'd specifically add drop rules to the shorewall rules file, for these ports. Nothing's changed. Is this windows version of NMap crazy? or am I missing something. Shorewall is the only thing modifying the iptables rules, as far as I know . |
|
Back to top |
|
|
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Sun Oct 15, 2006 6:21 pm Post subject: |
|
|
Sorry if this it too obvious - but you're not testing
the network from *inside* the network are you? |
|
Back to top |
|
|
lots Tux's lil' helper
Joined: 11 Mar 2003 Posts: 95
|
Posted: Sun Oct 15, 2006 6:56 pm Post subject: |
|
|
currently I've got it all set up in the following way:
Code: |
<internet> ---- <current router> ----- <PC-A and PC-B>
|
------<new router> ---- <laptop for testing>
|
Im running nmap from PC-A on the "outside" network to the new router. Also after completing an nmap scan using udp ports, I get a whole list of open ports.
Any advice on getting the default action for UDP ports to be dropped using shorewall?
Thanks for the help |
|
Back to top |
|
|
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
|
Back to top |
|
|
lots Tux's lil' helper
Joined: 11 Mar 2003 Posts: 95
|
Posted: Mon Oct 16, 2006 8:59 pm Post subject: |
|
|
In order for me to check against shields up, i'd have to put my router out onto the internet. Currently the way its hooked up, it is still behind another router.
Maybe my attempt at a diagram was not clear
Basically I have a router running on my network currently. This router feeds directly to a switch which then feeds to the other computers on the network, _and_ my new router that I am setting up. My new router treats the peers on the "active" network as if they're from the internet, or supposidly it does . It then serves this connection to a laptop I have hooked up to it for testing. I guess I can call this a "testing" network.
So ideally, the new router should be dropping unwanted connection attempts and nmap scans from other computers on the "active" network. Simply checking GRC will have GRC hit my old router, which isn't very effective.
I suppose I could temporarily hook my new router to the net to see what GRC says. I could also boot my laptop into knoppix and hook it up to the active network and see if linux based nmap reports anything different from the windows version. I'll get back to you on the GRC test when I get back home and can physically swap around the cables.
On a good note, it does appear to be dropping pings ... but udp port scans and some tcp ports still report active.. even though they shouldn't.
Are there any special rules I need to add to shorewall to have it drop everything from the net by default? I followed the tutorials on the shorewall site, but they included steps like this, and they rules/policies files are set up according to it. |
|
Back to top |
|
|
yabbadabbadont Advocate
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Mon Oct 16, 2006 9:05 pm Post subject: |
|
|
You probably should post the non-comment portions of the interfaces, policy, rules, and zones files. _________________
Bones McCracker wrote: | On the other hand, regex is popular with the ladies. |
|
|
Back to top |
|
|
lots Tux's lil' helper
Joined: 11 Mar 2003 Posts: 95
|
Posted: Mon Oct 16, 2006 10:47 pm Post subject: |
|
|
Here they are:
interfaces (note eth0 is internal):
Code: | net eth1 detect dhcp,tcpflags,routefilter,nosmurfs,logmartians
loc eth0 detect tcpflags,detectnets,nosmurfs
|
policy:
Code: | loc net ACCEPT
loc $FW ACCEPT
loc all REJECT info
$FW net ACCEPT
$FW loc ACCEPT
$FW all REJECT info
net $FW DROP info
net loc DROP info
net all DROP info
all all DROP info
|
zones:
Code: | fw firewall
net ipv4
loc ipv4
|
rules:
Code: | DNS/ACCEPT $FW net
SSH/ACCEPT loc $FW
SSH/ACCEPT net $FW
Webmin/ACCEPT loc $FW
SMB/ACCEPT $FW loc
SMB/ACCEPT loc $FW
Ping/ACCEPT loc $FW
Ping/DROP net $FW
SMTP/DROP net loc
POP3/DROP net loc
IMAP/DROP net loc
NNTP/DROP net loc
SMTP/DROP net $FW
POP3/DROP net $FW
IMAP/DROP net $FW
NNTP/DROP net $FW
ACCEPT $FW loc icmp
ACCEPT $FW net icmp
|
Note in the rules file i added a bunch of drops for the specific ports that nmap reported. I will see what grc says in just a few minutes.
EDIT:
A run through of shields up on grc.com results in almost all ports being stealthed. The only two that are noticable to a random scan seem to be the ssh port (which I have been depating using a port knocker with) and the ident port.
Which makes me curious as to why my nmap scan using the connect scan type results in open ports? And should I be concerned with the open UDP ports? Though those too were obtained using the nmap windows version.. which im starting to think is bugged
Next to come is a scan of the new firewall using a linux native machine...
EDIT2:
I took a look using a linux based machine outside the new firewall's network, but inside my own network, and nmap there reported much more believable results (according to my configs). I now get filtered udp ports, and similar results to the grc site. All I need to do now is figure out how to stealth the ident and ssh ports in an effective way. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|