Old 2nd May 2007, 19:30   #1
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
NSIS Simple Firewall Plugin

Hi,

I´ve created a firewall plugin to confiurate the windows firewall. This plugin works with Windows XP SP2, Windows 2003 and Windows Vista.

Here the function list:

Quote:
SimpleFC::EnableDisableFirewall
SimpleFC::IsFirewallEnabled
SimpleFC::AllowDisallowExceptionsNotAllowed SimpleFC::AreExceptionsNotAllowed
SimpleFC::EnableDisableNotifications
SimpleFC::AreNotificationsEnabled
SimpleFC::StartStopFirewallService SimpleFC::IsFirewallServiceRunning
SimpleFC::AddPort
SimpleFC::IsPortAdded
SimpleFC::RemovePort
SimpleFC::IsPortEnabled
SimpleFC::EnableDisablePort
SimpleFC::AddApplication
SimpleFC::IsApplicationAdded
SimpleFC::RemoveApplication
SimpleFC::IsApplicationEnabled SimpleFC::EnableDisableApplication
I think this plugin uses the most functions of the windows firewall.

Heres is a detailed description of the plugin

Any comments, suggestions and questions are welcome...

Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 3rd May 2007, 18:05   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Very nice
Have you made a Wiki page?

Stu
Afrow UK is offline   Reply With Quote
Old 3rd May 2007, 18:37   #3
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Hi,

thank you. I´ve made a page. On the first post there is a link, but you can use this

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 4th May 2007, 09:43   #4
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
nice, thanks for sharing!
Backland is offline   Reply With Quote
Old 4th May 2007, 19:04   #5
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Nice...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 4th May 2007, 20:26   #6
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Certainly I wouldn't feel happy while running an installer on my machine to alter my firewall settings behind my back.
Hopefully this plugin it's able to do its tricks on the weak integrated windows firewall but unable to affect Comodo in my case.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 4th May 2007, 20:51   #7
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 681
>> I wouldn't feel happy

Same thoughts here...

>> but unable to affect Comodo in my case.

Secure it with a passwort - it would say that is a must for
firewalls and virus scanners to prevent general abuse - also
for 3rd persons.

Greets, Brummelchen
Brummelchen is offline   Reply With Quote
Old 4th May 2007, 21:08   #8
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
>> Secure it with a passwort

I can assure you that I'm doing all what it needs up to the point that the one who's gonna hack my system should be a REAL good one and not every amateur out there who loves playing with M$ "secured" systems.
Therefore the question is why the REAL good one would ever care about hacking a system like mine?

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 5th May 2007, 00:50   #9
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 681
a simple user machine is not for interests...
so i turned off teh crappy window wall...
i am well protected as you - if someone hack me it will be from inside ^^

Greets, Brummelchen
Brummelchen is offline   Reply With Quote
Old 5th May 2007, 17:43   #10
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
can't see your points:

either any software you run can alter your firewall settings or none. (because you're not using an admin enabled account or secured the fw with a password)

any nsis installer could do that with system.dll as well, the plugin just makes it easier.

Quote:
a simple user machine is not for interests...
maybe not for an experienced hacker, but for script kiddies trying out their exploits. or for hordes of trojans trying to enlarge their respective botnet.


windows firewall won't protect you against serious attacks, though it can protect you very well against the automated exploitation hacks of trojans and worms.
Comm@nder21 is offline   Reply With Quote
Old 5th May 2007, 22:58   #11
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Quote:
Originally posted by Comm@nder21
can't see your points:
I'm not surprised...

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 5th July 2007, 20:23   #12
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Hi,

now NSIS Firewall Plugin 1.01 is released. This is a minor update because there are only documentation issues changed. So the plugin DLL is unchanged and it is not really necessary to update this version.

You can download this here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin

Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 2nd August 2007, 22:03   #13
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
New Release 1.10

Hi,

I´ve released a new version of the firewall plugin. This plugin provides more than 10 firewall functions like add icmp exception and so on.

It also supports the Windows Firewall with Advanced Security on Windows Vista operating system now. So now you can add/remove special firewall rules for your application.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin

If you have any questions or comments please let me now.

Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 7th August 2007, 21:40   #14
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
New Version 1.11

Hi,

I´ve released a new version of the firewall plugin. This version is a bugfix release and fixes a possible endless loop bug.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 7th August 2007, 23:37   #15
ClayDowling
Junior Member
 
Join Date: Nov 2005
Location: Flint, MI
Posts: 21
Send a message via AIM to ClayDowling
This is a very cool plugin, and I'll be pointing a co-worker to it shortly. While there's plenty of opportunity for abuse with a plugin like this, it is nice to be able to ask the user if they would like the installer to make necessary adjustments.
ClayDowling is offline   Reply With Quote
Old 13th November 2007, 22:12   #16
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Version 1.12 released

Hi,

I´ve released a new version of the firewall plugin. This version is a release to improve the documentation on the website and in the Readme.txt.

The website provides now a common functions sample script. I think these functions in the section are the most needed functions to create filewall exception in a setup.

The plugin file is unchanged. If you are using version 1.11 you don´t need to update it, except you want the improved documentation .

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 29th January 2008, 22:43   #17
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Version 1.13 released

Hi,

I´ve released a new version of the firewall plugin. This version is a release to add the changes from the service manager due to the new changes of the NSIS Simple Service Plugin.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 5th February 2008, 19:43   #18
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Version 1.14 released

Hi,

I´ve released a new version of the firewall plugin. This version is a release to add the changes from the service manager due to the new changes of the NSIS Simple Service Plugin.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 18th August 2008, 21:19   #19
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Version 1.15 released

Hi,

I´ve released a new version of the firewall plugin. This version is a minor release without any bugfixes or new features. But it is compiled without optimazation to avoid a false-positive virusscan.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 13th April 2009, 12:09   #20
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Version 1.16 released

Hi,

I´ve released a new version of the firewall plugin. This version is a minor release without any bugfixes or new features. Only the changes from the NSIS Simple Service Plugin are added.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 5th September 2009, 18:00   #21
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Version 1.17 released

Hi,

I´ve released a new version of the firewall plugin. This version is a minor release with some bugfixes.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 29th November 2010, 16:38   #22
akatik
Junior Member
 
Join Date: May 2010
Posts: 19
Does it work with 2008 Server?
akatik is offline   Reply With Quote
Old 26th June 2014, 09:39   #23
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
I have a problem with this plug-in together with NSIS V3.00 and Unicode support.
Without Unicode (Unicode false) the plug-in works fine and returns 0. Here is the code:
PHP Code:
SimpleFC::AddApplication "App name" "C:\My Path\MyApp.exe" 0 2 "" 1
Pop 
$
But when I enable Unicode support (Unicode true), the same code returns 1.
Is there any chance this plug-in to be updated?
TrifonovS is offline   Reply With Quote
Old 26th June 2014, 20:38   #24
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Ole Ole,

Germany has won this fight this evening That are good news... but the bad news are - I'm sorry - there is no chance to update this plugin to Unicode. If you want you can do this on your own... the source code is available

Kind regards

Speed78
Speed78 is offline   Reply With Quote
Old 1st July 2014, 11:36   #25
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
I changed this plug-in with liteFirewall and I solved my problems, because liteFirewall has an Unicode version.
TrifonovS is offline   Reply With Quote
Old 26th September 2014, 13:25   #26
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
I got a problem with liteFirewall plug-in under Windows XP 32-bit version (I haven't tested it under 64-bit version). It simply crashes. This doesn't happen on the other OS above Windows XP. Is there any solution?
TrifonovS is offline   Reply With Quote
Old 28th September 2014, 09:23   #27
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
I had a quick look at the source, but it's in Pascal which is a language I don't know or use. If it was in C I might have had a crack at unicode support.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 28th September 2014, 18:26   #28
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Quote:
Originally Posted by TrifonovS View Post
I got a problem with liteFirewall plug-in under Windows XP 32-bit version (I haven't tested it under 64-bit version). It simply crashes. This doesn't happen on the other OS above Windows XP. Is there any solution?
So it seems your solution would be to modify SimpleFC yourself to work with Unicode I'm afraid. Either that or find out why liteFirewall is crashing using a debugger.

Stu
Afrow UK is offline   Reply With Quote
Old 29th September 2014, 15:07   #29
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
I think that I found the reason for the crash of liteFirewall under Windows XP. It was a mistake in my scripts. The path to the applications that I want to exclude from Firewall was wrong. Somehow this cases crash only under Windows XP. When I fixed it, I see no more crashed. But unfortunately I found that the needed applications are still blocked from the Firewall (on all OS). I see the new rules in the Firewall exclude list, but they don't work. I couldn't find the reason (I don't exclude a possibility that I'm doing something wrong).
Meantime I saw that nsisFirewall also have a Unicode version. I used it instead of liteFirewall and now all works well.
For now I have a solution and I won't make more trials.
Thank you for the opinions.
TrifonovS is offline   Reply With Quote
Old 9th October 2014, 13:11   #30
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
Just a short update from me. nsisFirewall does his job well, but now I need something more that this plug-in doesn't support. A need to enable not specific application, but just a TCP port. So it is really necessary to come back to the SimpleFC. And again, the problem is that it doesn't support Unicode and I'm not good with Pascal. I was desperate and I tried to search in Internet for a solution. Suddenly I found the following http://forums.winamp.com/showthread.php?p=2706895 topic.
There is a macro that converts Unicode to ANSI and can be used like a workaround. Here it is the macro once more:

Quote:
!define Unicode2Ansi "!insertmacro Unicode2Ansi"

!macro Unicode2Ansi String outVar
System::Call 'kernel32::WideCharToMultiByte(i 0, i 0, w "${String}", i -1, t .s, i ${NSIS_MAX_STRLEN}, i 0, i 0) i'
Pop "${outVar}"
!macroend
After some tests I see no problems to work with existing ANSI variant of this plug-in.
And I have to admit that SimpeFC is the best plug-in for managing the Firewall, it is just pity that his creator don't want to continue with its further development. Anyway, congratulations for the job he have already done...
TrifonovS is offline   Reply With Quote
Old 9th October 2014, 15:33   #31
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,418
Have you tried http://nsis.sourceforge.net/CallAnsiPlugin_plug-in ?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th October 2014, 11:38   #32
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
No! I'm wandering how I couldn't find this plug-in . I will try it in suitable time, because now my installer is stable.
Thank you for the idea!!!
TrifonovS is offline   Reply With Quote
Old 6th December 2014, 12:49   #33
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Version 1.20 released

Hi,

I've released a new version of the firewall plugin. This version is a minor release with one addion in the "AdvAddRule" function.

The can find the complete changelog, documentation and download file here:

http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin


Best regards

Rainer
Speed78 is offline   Reply With Quote
Old 11th December 2014, 11:41   #34
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
Still there is no Unicode support ... I hope in next version...
TrifonovS is offline   Reply With Quote
Old 29th March 2015, 20:55   #35
Andreasx
Junior Member
 
Join Date: Mar 2015
Posts: 2
Hi,

I have a problem using the plug-in for adding a program in the firewall:
It doesn't work correct, because it only adds a rule for the private network not for the public network.
This is what i wrote:
SimpleFC::AddApplication "Program-Name" "$INSTDIR\program-name.exe" 0 2 "" 1

Am I doing something wrong?
Andreasx is offline   Reply With Quote
Old 30th March 2015, 19:07   #36
Speed78
Senior Member
 
Join Date: Jul 2003
Location: Germany
Posts: 114
Dear Andreas,

this belongs to the "old" MS firewall support e.g. for XP. You you are using >= Vista please use "AdvAddRule". Take a look at the "Important Notes"!

Kind regards

Rainer
Speed78 is offline   Reply With Quote
Old 3rd April 2015, 17:40   #37
Andreasx
Junior Member
 
Join Date: Mar 2015
Posts: 2
Quote:
Originally Posted by Speed78 View Post
this belongs to the "old" MS firewall support e.g. for XP. You you are using >= Vista please use "AdvAddRule". Take a look at the "Important Notes"!
OK,
it is was bid more complicated, but it worked!

Thank you!!
Andreasx is offline   Reply With Quote
Old 11th June 2015, 08:11   #38
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
Hi!

I need some support again. I use the function AdvAddRule and I'm trying to set a rule for all protocols. According to the documentation:

Quote:
1 - ICMPv4
6 - TCP
17 - UDP
58 - ICMPv6
256 - Any protocol
I have to use value 256 for any protocol. When I call the function it returns 0 (success), but looking in the Firewall settings, I see that the protocol is actually set to 2 (IGMP). I cannot guess what I'm doing wrong. When I try with specific protocol all is OK. Can you help, please?
TrifonovS is offline   Reply With Quote
Old 11th June 2015, 09:12   #39
TrifonovS
Senior Member
 
Join Date: Apr 2009
Location: Bulgaria
Posts: 192
Short update... I found the problem, but I don't understand it. I'm compiling my installer with Unicode option. We already know that this plug-in doesn't support Unicode, therefore I used the macro that converts Unicode string to ANSI as it was posted above. But I don't do this conversion for values. I thought that it is not necessary, therefore I pass this specific parameter to the function directly... and it didn't work. Now I covert it with the macro and then pass it to the function... and it works well...
I see also another problem. I can not define a group. If I use an empty string, it works. But if I try to define something else (even if I convert it with the macro from Unicode to ANSI), I always get an error from the function. Any ideas?
TrifonovS is offline   Reply With Quote
Old 12th June 2015, 07:59   #40
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
All variables in NSIS are strings. Therefore all values are passed to plug-ins as strings. The plug-in then converts those values to integer if it needs to.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump