Tuesday, April 6, 2010

Firewall Settings from the command line in Snow Leopard

Maybe someday you need to shutdown or activate the firewall in your mac, and only have access to the command line, then these are the commands to be used.

To check the current status :

sudo defaults read /Library/Preferences/com.apple.alf globalstate

The result will print one of these numbers;

0 = de-activated

1 = on for specific services

2 = on for essential services

if you want to shut it down :

sudo defaults read /Library/Preferences/com.apple.alf globalstate -int 0

PS. Mac OS X comes with an even more powerful Firewall than the one in the system preferences. Open up the Terminal and type “man ipfw” to learn more about it. ;) enjoy

and to turn on for the specific services :

sudo defaults read /Library/Preferences/com.apple.alf globalstate -int 1

The password requested is your own password, and you have to have administrator access to the mac.

This was tested successfully on 10.6.2 (Snow Leopard).


PS. Mac OS X comes with an even more powerful Firewall than the one in the system preferences. Open up the Terminal and type “man ipfw” to learn more about it. :) enjoy

2 comments:

  1. I believe the write command is:

    sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 0

    To disable the firewall.

    Thanks.

    ReplyDelete
  2. Have tested this today, rubiojr is right you need "defaults write...." to set the value not read.

    Also you need to reboot before it will start.

    ReplyDelete

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...