Hello, eddyNOR.
$ sudo ufw status verbose
Status: active
Logging: on (full)
Default: deny (incoming), allow (outgoing)
New profiles: skip
Apart from the fact that you turnt on fully detailled logging this is the same configuration as mine:
Allow all outgoing connections. UFW will permit you to open connections to any target on any port.
Deny any incoming connections. UFW will reject any attempt from other computers to open a connection on any port on your machine.
Therefore, the additonal rules
23 DENY IN 22
445 DENY IN Anywhere
139 DENY IN 139
139 DENY IN 137
135,139,445/tcp DENY IN Anywhere
137,138/udp DENY IN Anywhere
22 DENY IN Anywhere (log)
do not seem to make any difference from my point of view. They just confirm for a list of named ports what has been configured for all ports anyway: do not allow any incoming traffic.
So why does it say that 445, 139, 138 etc are open when i do a portscan??
Who shows open ports? And open in which direction? Remember UFW has been instructed to permit all outgoing connections on any port.
Which command did you use to find out open ports? Can you post the screen output of this programme so that it is possible to find out if any ports are open and if this is true for incoming or for outgoing connections?
Even if a commandline like
- Code: Select all
netstat -a | grep tcp | grep LISTEN
displays a list of ports which your machine is listening on this does not mean that they can be contacted from the outside world, because UFW will intercept any request to connect to such a port from the outside world.
About the ufw.log:
iam not sure i can read the log at all
Hm. Why did you activate full logging then?

At least here, where UFW logging has been restricted to "low", it is pretty simple to find out whether anything passed UFW by.
UWF will log any blocked attempt to connect to the machine from outside and state "[UFW BLOCKED]". Therefore all lines which do not contain the string "UFW BLOCKED" might be worth checking:
- Code: Select all
grep -v "UFW BLOCKED" /var/log/ufw.log
This command yields 0 hits here. I.e. here UFW blocks 100% of all attempts to connect to my machine from outside.
And note:
Most attempts of other machines to establish a connection to your machine may not even be evil. But UFW should block them all.
Provided you establish the connection to your internet provider directly from your machine, e.g. with the help of a DSL modem, you may check whether your machine can be contacted from outside and if so on which ports by performing several test here:
www.grc.com => Shieldsup.
If your machine is connected to a DSL router and the router establishes the connection to the internet provider, performing the ShieldsUp test will not reveal how well your machine is protected, but how well your router protects you from attackers.
Kind regards,
Karl
--
Corrected / added:Saturday, April 14th, 2012Seems as if different versions of UFW use a slightly different string to state they have blocked an action.
UFW on Ubuntu 10.04.4 writes "[UFW BLOCKED]". UFW on Mint 12, however, writes "[UFW BLOCK]".
Therefore the commandline given above,
- Code: Select all
grep -v "UFW BLOCKED" /var/log/ufw.log
will work on Ubuntu 10.04.4 and yield the expected result.
However, on Linux Mint 12 the commandline should actually read
- Code: Select all
grep -v "UFW BLOCK" /var/log/ufw.log
in order to have the same effect.
Sorry, such things may happpen if you are logged on to Unbuntu 10.04.4 and explain what to do on Mint 12.
