 |
|
 |
At first, thanks for your code, and I'm doing the packet filter on Win7. But using your code, it dosen't work at all. Besides, I looked others codes doing the same thing, and they all can't work.
If you has changed your code, and had done packet filter successfully, please reply me, or Email to me(davidchuhftu@yahoo.cn). Thank you once more!
|
|
|
|
 |
|
 |
Hi, dont you have the project ready for visual studio, I just cant get it compiled.
Thanks
|
|
|
|
 |
|
 |
Hi, loved your work its amazing, Ive been looking for something like this for a long time, I just wanted to know if there is a way to make a white-list of allowed ip address without adding all the blocked ips.
Thanks
|
|
|
|
 |
|
 |
I set up a project in Visual Studio 2008, made all the settings needed so the sources would compile(Downloading the SDK, setting up paths, etc), compiled, ran as administrator and...
Pinging the IP addresses added in the filter... works.
Accesing them over HTTP... works
Where is the filtering? What am I doing wrong?
|
|
|
|
 |
|
 |
I managed to resolv the problem, it was my fault. I got some compilation errors and forced some casts, that is why it did not work.
Note to others, if you get compilation erros like "cannot convert parameter 1 from 'char [2]' to 'STRSAFE_LPWSTR'" go to Project Properties -> Configuration Properties -> General and put "Not Set" at "Character Set" option.
|
|
|
|
 |
|
 |
hi mahesh.....m currently programming a firewall myself...wanted know if FWPS Structures could be used in normal wfp app without having to write kernel drivers.For example can i use fwps_callout0 in my user mode code. and if dev c++ could be used to compile wfp code..
thanx...desperately waiting for ur reply
|
|
|
|
 |
|
 |
Hi,
when i tried to execute PacketFilter.exe on vista, it is showing the below error:
Error starting firewall. GetLastError() 0x0
Press any key to stop firewall...
Can you please tell me, what went wrong?
Regards
|
|
|
|
 |
|
 |
Just run it as Administartor.
|
|
|
|
 |
|
 |
Hi, i get this error too and i am the administrator on my laptop. There's one account, ive checked the type and it says Administrator, password protected.
I'm using Win 7 Ultimate.
Any help would be greatly appreciated as this is such an interesting project!
|
|
|
|
 |
|
|
 |
|
 |
incomplete sample for the demo
|
|
|
|
 |
|
 |
my name is vivek and i am studying 4th year b.tech Information and Communication technology. i jus saw this article on this site regarding development of a firewall for vista. and i have a few questions regarding that and i hope you people can help me out.
i am working on development of a firewall and i am new to windows programming and so i thought i could start of with your code. i am going to restrict my self to the development of a packet filter for which i thought i could use this project as a template to learn more and build this into a graphical environment. but i face a few preoblems.
firstly i ran the sample code on my vista with the firewall turned on and it showed me an error on the console which said "error starting firewall", then i turned the firewall off but then it shows me the same error. the fireall doesn't start and i cannot check if its working.
i can understand the code and the api libraries on the windows website help me out with the documentation, but then its the compiling and executing part that seems to be the problem i hope you people can help me out by jus briefing me through the working and how you developed this application using windows sdk and visual studio and some resources for learning about visual c++
vivek
|
|
|
|
 |
|
 |
Hi,
I am trying to make a managed wrapper around the PacketFilter class using VC++, so that i can use in C#. Please help me in this regard.
|
|
|
|
 |
|
 |
Hi,
These articles might help you:
http://www.ondotnet.com/pub/a/dotnet/2003/01/13/intromcpp.html
http://www.ondotnet.com/pub/a/dotnet/2003/03/03/mcppp2.html
http://www.ondotnet.com/pub/a/dotnet/2004/03/29/mcpp_part3.html
http://swatrant.blogspot.com/
|
|
|
|
 |
|
 |
Thank u mahesh. Done my job.
Could u plz tell, How can i apply subnetmask along with the ipaddress??
Could u provide c++ code to that?
modified on Wednesday, September 24, 2008 6:42 AM
|
|
|
|
 |
|
 |
would you please provide me the souce code of the managed wrapper?
|
|
|
|
 |
|
 |
This is a really nice piece of code
I got one question; Is it possible to block all traffic, and rather add exceptions that are allowed?
Regards,
Thomas
|
|
|
|
 |
|
 |
Hi Thomas/Others,
This is gud question asked by Thomos,
Is there any way to do that??
Can others give there inputs on this
best regards
Suren
|
|
|
|
 |
|
 |
I have created a vcproj using these files and compiled using VS 2008 buty getting linking erros. Please let me know what libraries we need to include.]
Thanks,
Ankush
|
|
|
|
 |
|
 |
Hi,
Make sure that following things are properly configured project properties (Project Menu > Project Properties) in your solution/project workspace:
1. Navigate to Configuration Properties > C/C++ > General. Here, provide the path of Windows SDK headers files' directory in "Additional Include Directories" option. (For example, C:\Program Files\Microsoft SDKs\Windows\v6.1\Include)
2. Navigate to Configuration Properties > Linker > General. Here, provide the path of Windows SDK libraries' directory in "Additional Library Directories" option. (For example, C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib)
3. Next, navigate to Configuration Properties > Linker > Input. Here, in the "Additional Dependencies" option add following libraries:
Ws2_32.lib Fwpuclnt.lib Rpcrt4.lib
Fwpuclnt.lib is the library which contains WFP implementations.
http://swatrant.blogspot.com/
|
|
|
|
 |
|
 |
Thank you Mahesh, the idea presented in quit simple way as compared to complex MS examples.
I am looking for some url filtering sample in WFP which can be complied using VS2005/VS2008. All MS example require DDK/WDK to compile them. It will be great if you can provide the vcproj file along with source code.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |
|
 |
Hi Manish,
Thanks And, here are the contents of .vcproj file. You can save it as ProjectName.vcproj.
="1.0" ="Windows-1252"
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="PacketFilter"
ProjectGUID="{07A77A5F-3CC4-4B02-B6B2-BEA45FBDC8C9}"
RootNamespace="PacketFilter"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="C:\Program Files\Microsoft SDKs\Windows\v6.1\Include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Ws2_32.lib Fwpuclnt.lib Rpcrt4.lib "
LinkIncremental="1"
AdditionalLibraryDirectories="C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="false"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\PacketFilter.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\PacketFilter.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
http://swatrant.blogspot.com/
|
|
|
|
 |
|
 |
Thanks again. I am looking for a url filtering application in which I want a notification with url/ip data before connect, in this notification I want to decide if the url/ip is blocked or not. Is it possible by a user level WFP application or I need to develop some kernel level driver. In some cases I also need to change the url/ip.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
 |