NDIS resources

本文汇总了多个Windows防火墙及网络过滤项目的源代码和参考资料,包括基于NDIS和TDI的个人防火墙、包过滤防火墙等。涵盖从Windows NT4到XP不同版本的系统,并提供了详细的开发指南和技术文档。
[ 1] Simple NDIS Hooking Based Firewall for NT4/2000
   http://ntdev.h1.ru/ndis_fw.html
   http://ntdev.h1.ru/ndis_fw.zip

[ 2] Simple TDI-Based Open Source Personal Firewall for Windows NT4/2000/XP/2003
   http://sourceforge.net/projects/tdifw
   http://optusnet.dl.sourceforge.n ... ifw/tdifw-1.3.2.zip

[ 3] http://dream.net9.org/~driver/restrict/PCAUSA/pcausa.zip(非最新版)

[ 4] Firewall for Windows 9x/ME/NT/2000/XP - Vadim V.Smirnov
   http://www.ntkernel.com/articles/firewalleng.shtml

[ 5] How to implement a Firewall-Hook Driver(cool and undocumented)
   http://www.codeproject.com/internet/FwHookDrv.asp
   http://www.codeproject.com/internet/FwHookDrv/FwHookDrv_src.zip

[ 6] Windows Network Data And Packet Filtering Frequently Asked Questions(这里有一张Network Architecture Diagram)
   http://www.pcausa.com/resources/winpktfilter.htm

[ 7] Network Architecture in Windows NT-based Operating Systems
   http://plasmic.com/~vizzini/ntnetarch.html

[ 8] Ntpacket.exe: Updated Windows NT 4.0 NDIS 3.0 Packet Sample Available
   http://support.microsoft.com/default.aspx?scid=kb;EN-US;238652
   ftp://ftp.microsoft.com/Softlib/MSLFILES/Ntpacket.exe

  Bugs in the NT DDK Packet Protocol Driver Sample
   http://www.panix.com/~perin/packetbugs.html

[ 9] EthernetSpy
   http://telemat.det.unifi.it/book/EthernetSpy/EthernetSpy.zip

[10] BriProto NDIS Protocol Driver Project Files
   http://adaptive4.ucsd.edu/projec ... 2003.08.01.1218.zip
   http://adaptive4.ucsd.edu/projects/briproto_driver/doc/

[11] A RARP Server(source code)
   http://www.panix.com/~perin/rarpd.zip

[12] NDIS "Packet" Discussion(介绍了NDIS_PACKET、NDIS_BUFFER)
   http://www.pcausa.com/resources/ndispacket.htm
   http://www.pcausa.com/resources/ndispacket_decode.htm
   http://www.pcausa.com/resources/readonpacket.htm

  NDIS_PACKET Discussion Part 2 - NDIS_PACKET Reserved Areas
   http://www.ndis.com/papers/ndispacket/ndispacket2.htm

[13] Workaround To Circumvent ProtocolReceive Faults Caused By Some Faulty NDIS Miniport Drivers
   http://www.pcausa.com/support/KB03080201.htm

[14] Conditions Needed For ReceivePacketHandler To Be Called
   http://www.pcausa.com/support/KB07130001.htm

[15] http://www.rhyshaden.com/ethernet.htm(介绍了802.1p的帧格式)

[16] NDIS Driver Compile Flags - Stephan Wolf[2004-03-15]
   http://www.wd-3.com/031504/NDISCompile.htm

[17] KNOWLEDGE BASE LINKS STOP MESSAGES(理解BSOD)
   http://aumha.org/win5/kbestop.htm

[18] Stop 0x0000000A or IRQL_NOT_LESS_OR_EQUAL(介绍了Stop Message的四个参数)
   http://www.microsoft.com/resourc ... s/prmd_stp_hwpg.asp

[19] Kernel Driver Frequestly Asked Questions (FAQ)
   http://www.osronline.com/custom. ... rint.cfm&id=256

[20] INFO: Network Binding Analysis
   http://support.microsoft.com/default.aspx?scid=kb;en-us;192483

[21] Windows 2000 Filter-Hook Driver example
   http://ntdev.h1.ru/ipfilter.html
   http://ntdev.h1.ru/ipfilter_src.html

[22] 用VC开发Win2000/XP下的防火墙
   http://computer.sz.net.cn/2004-05-17/nw2004051700070.shtml
   http://computer.sz.net.cn/2004-05-17/nw2004051700071.shtml
   http://computer.sz.net.cn/2004-05-17/nw2004051700072.shtml
   http://dl2.mydown.com/code/more/DrvFltIp_FirewallFHK.rar

[23] Simple Packet Filtering Firewall - Deepthi Reddy, Ramya Balakumar, Vandana Bhardwaj
   http://www.csc.villanova.edu/~vbhardwa/netclass/firewall.ppt
   http://www.sju.edu/~vb189802/computerNet/fire.zip(source code)

  Simple packet Filter Firewall
   http://www.csc.villanova.edu/~vbhardwa/netclass/Firewall.htm

[24] Developing Firewalls for Windows 2000/XP
   http://www.codeproject.com/internet/drvfltip.asp
   http://www.codeproject.com/internet/drvfltip/FirewallFHK_src.zip
   http://www.codeproject.com/internet/drvfltip/DrvFltIp_source.zip

[25] Simple Packet - Filter Firewall
   http://www.codeproject.com/internet/smfirewall.asp
   http://www.codeproject.com/internet/smfirewall/fire.zip

[26] Hollis Technology Solutions IpHook Version 1 Release
   http://www.hollistech.com/Resources/IpHook/Release%20Notes.htm
   http://www.hollistech.com/Resources/IpHook/IpHook.msi(source code)

[27] An Easy Firewall Application - [2003-10-06]
   http://www.codeproject.com/tools/firewallpapi.asp
   http://www.codeproject.com/tools/firewallpapi/firewallpapisrc.zip
   http://www.codeproject.com/tools/firewallpapi/firewallpapi.zip

[28] NetCenturion is a TCP/IP packet filter for Windows 2000 and XP
   http://www.softsystem.co.uk/page5.html
   http://www.softsystem.co.uk/NetCenturion1204.zip
   http://www.softsystem.co.uk/NetCenturion1204src.zip

[29] Extending The Microsoft PassThru NDIS Intermediate Driver - Thomas F. Divine < wd-3.tdivine@pcausa.com> [2003-07-15]
  Part 1 Adding a DeviceIoControl Interface
   http://www.wd-3.com/archive/ExtendingPassthru.htm
   http://www.wd-3.com/downloads/ExtendingPassthru.zip

  Extending The Microsoft PassThru NDIS Intermediate Driver - James Antognini < antognini@mindspring.com> Thomas F. Divine < wd-3.tdivine@pcausa.com> [2003-12-15]
  Part 2 Two IP Address Blocking NDIS IM Drivers
   http://www.wd-3.com/archive/ExtendingPassthru2.htm
   http://www.wd-3.com/downloads/PassThru2.zip

[30] NDIS Driver Debugging Guidelines - [2003-05-05]
   http://www.microsoft.com/taiwan/ ... NDIS/ndisdebug.mspx
   http://download.microsoft.com/do ... /ndisWinHec2003.doc
  (用kd调试)

  Debugging NDIS Drivers
   http://msdn.microsoft.com/librar ... .xml.asp?frame=true

  NDIS Debug Tracing and Kernel Debugger Extensions - [2003-11-20]
   http://support.microsoft.com/kb/q248413/

  How to enable NDIS debug tracing - [2005-08-09]
   http://support.microsoft.com/kb/q164459/

  如何启用和使用NDIS验证程序 - [2005-12-23]
   http://support.microsoft.com/kb/q266403/

[31] Porting Miniport Drivers to NDIS 6.0 - [2005-04-19]
   http://www.microsoft.com/taiwan/ ... S/NDIS6drvport.mspx
   http://download.microsoft.com/do ... e6/NDIS6drvport.doc

[32] 基于PassThru的NDIS中间层驱动程序扩展 - Addylee < Addylee2004@163.com> [2006-05-02]
   http://www.xfocus.net/articles/200605/865.html

[33] PCAUSA Discussion List
   http://groups.yahoo.com/group/discussion-pcausa/

[34] Controlling Stacking Order of NDIS 5.0 Intermediate Drivers - [2003-12-17]
   http://support.microsoft.com/kb/250615

[35] NAT在NDIS中间层驱动中的实现 - thinking < thinkingfh@163.com> [2006-06-17]
   http://www.xfocus.net/articles/200606/870.html

[36] Raw Ethernet Packet Sending - miahrugger [2003-10-25]
   http://www.codeproject.com/cs/internet/sendrawpacket.asp
   http://www.codeproject.com/cs/in ... t/SendRawPacket.zip
  (用到了NDIS Protocol Driver)

转载于:https://www.cnblogs.com/Safe3/archive/2009/03/27/1422941.html

PCAUSA Test TCP (PCATTCP) Release Notes Printing Communications Associates, Inc. 4201 Brunswick Court Smyrna, GA 30080 USA TEL: (770) 432-4580 FAX: (770) 436-7246 E-Mail: tdivine@pcausa.com ====================================================================== Component Part No.: N/A Component Name : PCAUSA Test TCP (PCATTCP) ====================================================================== Component Version : 2.01.01.11 Release Date : February 4, 2010 1.) Now flush stderr/stdout for all exit paths. ====================================================================== Component Version : 2.01.01.10 Release Date : November 3, 2009 1.) Added new -a option to specifiy local host IP address. 2.) Now built using Visual Studio 2008 (for better or worse...). ====================================================================== Component Version : 2.01.01.07 Release Date : November 23, 2003 1.) Incorporated fix identified by Clarkson University that reduces hangs when ending the UDP transmitter test. See additional comments in TTCP_TransmitUDP module. ====================================================================== Component Version : 2.01.01.06 Release Date : April 5, 2003 1.) Fixed minor bug in TTCP transmitter. PCAUSA PCATTCP preamble was not inserted correctly when building transmit buffer. ====================================================================== Component Version : 2.01.01.05 Release Date : May 31, 2002 1.) Modification to allow SO_RVCBUF and SO_SNDBUF values of zero(0) to be handled. Original implementation did not set these options if their value was zero. 2.) Added -w write delay option. ====================================================================== Component Version : 2.01.01.04 Release Date : May 30, 2002 1.) Minor fix to test exit routines. ====================================================================== Component Version : 2.01.01.03 Release Date : May 29, 2002 Externally Visible Differences ------------------------------ 1.) Added -c "continuous" option: -c -t: send continuously -r: accept multiple connections sequentially 1.) Added -R multi-threaded concurrent TCP/UDP receiver option. 2.) Fixed error codes. Now fetch using WSAGetLastError instead of perror. The latter did not handle socket errors. 3.) Revised test output messages. 4.) New PCATTCP.chm HtmlHelp documentation. Implementation Differences -------------------------- Extensive rework to suit author's style. ====================================================================== Component Version : 1.00.00.02 Release Date : January, 2000 Fix setting of setsockopt call for TCP_NODELAY. ====================================================================== Component Version : 1.00.00.01 Release Date : April, 1999 Initial release of PCAUSA's port of TTCP to Windows.
PS C:\Users\Administrator> # 1. 修复系统映像(使用Windows Update源) PS C:\Users\Administrator> Write-Host "正在通过Windows Update修复系统映像..." -ForegroundColor Cyan 正在通过Windows Update修复系统映像... PS C:\Users\Administrator> DISM /Online /Cleanup-Image /RestoreHealth /Source:https://go.microsoft.com/fwlink/?LinkID=799472 /LimitAccess 部署映像服务和管理工具 版本: 10.0.22621.2792 映像版本: 10.0.22631.2861 错误: 87 未在此上下文中识别出 source:https://go.microsoft.com/fwlink/?linkid 选项。 有关详细信息,请参阅帮助。 可以在 C:\Windows\Logs\DISM\dism.log 上找到 DISM 日志文件 PS C:\Users\Administrator> PS C:\Users\Administrator> # 2. 修复.NET Core运行时 PS C:\Users\Administrator> Write-Host "修复.NET Core运行时..." -ForegroundColor Cyan 修复.NET Core运行时... PS C:\Users\Administrator> dotnet restore MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file. PS C:\Users\Administrator> dotnet build-server shutdown Shutting down MSBuild server... Shutting down VB/C# compiler server... VB/C# compiler server shut down successfully. MSBuild server shut down successfully. PS C:\Users\Administrator> dotnet nuget locals all --clear Clearing NuGet HTTP cache: C:\Users\Administrator\AppData\Local\NuGet\v3-cache Clearing NuGet global packages folder: C:\Users\Administrator\.nuget\packages\ Clearing NuGet Temp cache: E:\ai_temp\NuGetScratch Clearing NuGet plugins cache: C:\Users\Administrator\AppData\Local\NuGet\plugins-cache Local resources cleared. PS C:\Users\Administrator> PS C:\Users\Administrator> # 3. 正确配置驱动验证器 PS C:\Users\Administrator> Write-Host "配置驱动验证器..." -ForegroundColor Cyan 配置驱动验证器... PS C:\Users\Administrator> verifier /reset 没有更改任何设置。 PS C:\Users\Administrator> verifier /standard /all 验证程序标志: 0x001209bb 标准标志: [X] 0x00000001 特殊池。 [X] 0x00000002 强制 IRQL 检查。 [X] 0x00000008 池跟踪。 [X] 0x00000010 I/O 验证。 [X] 0x00000020 死锁检测。 [X] 0x00000080 DMA 检查。 [X] 0x00000100 安全检查。 [X] 0x00000800 杂项检查。 [X] 0x00020000 DDI 兼容性检查。 其他标志: [ ] 0x00000004 随机低资源模拟。 [ ] 0x00000200 强制挂起 I/O 请求。 [ ] 0x00000400 IRP 日志记录。 [ ] 0x00002000 堆栈的固定 MDL 检查。 [ ] 0x00004000 驱动程序的固定 MDL 检查。 [ ] 0x00008000 Power 框架延迟模糊处理。 [ ] 0x00010000 端口/微型端口接口检查。 [ ] 0x00040000 系统低资源模拟。 [ ] 0x00080000 DDI 兼容性检查(额外)。 [ ] 0x00200000 NDIS/WLAN 验证。 [ ] 0x00800000 内核同步延迟模糊处理。 [ ] 0x01000000 VM 开关验证。 [ ] 0x02000000 代码完整性检查。 内部标志: [X] 0x00100000 扩展的验证程序标志(内部)。 [X] 指示标志已启用。 引导模式: Persistent 规则: 所有规则都在使用默认设置 扩展: wdm: rules.default 验证的驱动程序: 所有驱动程序 需要重新引导系统才能使更改生效。 PS C:\Users\Administrator> verifier /querysettings 验证程序标志: 0x001209bb 标准标志: [X] 0x00000001 特殊池。 [X] 0x00000002 强制 IRQL 检查。 [X] 0x00000008 池跟踪。 [X] 0x00000010 I/O 验证。 [X] 0x00000020 死锁检测。 [X] 0x00000080 DMA 检查。 [X] 0x00000100 安全检查。 [X] 0x00000800 杂项检查。 [X] 0x00020000 DDI 兼容性检查。 其他标志: [ ] 0x00000004 随机低资源模拟。 [ ] 0x00000200 强制挂起 I/O 请求。 [ ] 0x00000400 IRP 日志记录。 [ ] 0x00002000 堆栈的固定 MDL 检查。 [ ] 0x00004000 驱动程序的固定 MDL 检查。 [ ] 0x00008000 Power 框架延迟模糊处理。 [ ] 0x00010000 端口/微型端口接口检查。 [ ] 0x00040000 系统低资源模拟。 [ ] 0x00080000 DDI 兼容性检查(额外)。 [ ] 0x00200000 NDIS/WLAN 验证。 [ ] 0x00800000 内核同步延迟模糊处理。 [ ] 0x01000000 VM 开关验证。 [ ] 0x02000000 代码完整性检查。 内部标志: [X] 0x00100000 扩展的验证程序标志(内部)。 [X] 指示标志已启用。 引导模式: Persistent 规则: 所有规则都在使用默认设置 扩展: wdm: rules.default 验证的驱动程序: 所有驱动程序 PS C:\Users\Administrator> PS C:\Users\Administrator> # 4. 重建性能计数器 PS C:\Users\Administrator> Write-Host "重建性能计数器..." -ForegroundColor Cyan 重建性能计数器... PS C:\Users\Administrator> cd $env:windir\System32 PS C:\Windows\System32> unlodctr /l 无法打开驱动程序 SYSTEM\CurrentControlSet\Services\/l。状态: 2 PS C:\Windows\System32> lodctr /r 信息: 成功地从系统备份存储中重建性能计数器设置 PS C:\Windows\System32> Start-Sleep -Seconds 5 PS C:\Windows\System32> PS C:\Windows\System32> # 5. 创建RuntimeBroker监控任务(优化版) PS C:\Windows\System32> $scriptContent = @" >> param($ProcessName = "RuntimeBroker") >> $procs = Get-Process $ProcessName -ErrorAction SilentlyContinue >> if($procs) { >> $procs | ForEach { >> $_.ProcessorAffinity = 1 >> $_.PriorityClass = "BelowNormal" >> } >> Start-Sleep -Seconds 5 >> $procs | Where { $_.CPU -gt 30 } | Stop-Process -Force >> } >> "@ >> $scriptContent | Set-Content -Path "$env:TEMP\FixRuntimeBroker.ps1" -Force >> PS C:\Windows\System32> $action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-ExecutionPolicy Bypass -File `"$env:TEMP\FixRuntimeBroker.ps1`"" PS C:\Windows\System32> $trigger = New-ScheduledTaskTrigger -Daily -At 3am PS C:\Windows\System32> Register-ScheduledTask -TaskName "RuntimeBrokerMonitor" -Action $action -Trigger $trigger -User "NT AUTHORITY\SYSTEM" -Description "RuntimeBroker资源监控" -Force TaskPath TaskName State -------- -------- ----- \ RuntimeBrokerMonitor Ready PS C:\Windows\System32> PS C:\Windows\System32> # 6. 最终验证 PS C:\Windows\System32> Write-Host "验证修复结果..." -ForegroundColor Green 验证修复结果... PS C:\Windows\System32> Repair-WindowsImage -Online -RestoreHealth Repair-WindowsImage : 还原操作失败。找不到修复来源,或者无法修复组件存储。 所在位置 行:1 字符: 1 + Repair-WindowsImage -Online -RestoreHealth + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Repair-WindowsImage], COMException + FullyQualifiedErrorId : Microsoft.Dism.Commands.RepairWindowsImageCommand PS C:\Windows\System32> Get-Counter -Counter "\Process(RuntimeBroker*)\% Processor Time" -SampleInterval 1 -MaxSamples 3 Timestamp CounterSamples --------- -------------- 2025/8/18 18:29:44 \\bf-202503252000\process(runtimebroker#4)\% processor time : 0 \\bf-202503252000\process(runtimebroker#3)\% processor time : 0 \\bf-202503252000\process(runtimebroker#2)\% processor time : 0 \\bf-202503252000\process(runtimebroker#1)\% processor time : 0 \\bf-202503252000\process(runtimebroker)\% processor time : 0 2025/8/18 18:29:45 \\bf-202503252000\process(runtimebroker#4)\% processor time : 0 \\bf-202503252000\process(runtimebroker#3)\% processor time : 0 \\bf-202503252000\process(runtimebroker#2)\% processor time : 0 \\bf-202503252000\process(runtimebroker#1)\% processor time : 0 \\bf-202503252000\process(runtimebroker)\% processor time : 0 2025/8/18 18:29:46 \\bf-202503252000\process(runtimebroker#4)\% processor time : 0 \\bf-202503252000\process(runtimebroker#3)\% processor time : 0 \\bf-202503252000\process(runtimebroker#2)\% processor time : 0 \\bf-202503252000\process(runtimebroker#1)\% processor time : 0 \\bf-202503252000\process(runtimebroker)\% processor time : 0 PS C:\Windows\System32> # 运行后检查系统状态 PS C:\Windows\System32> Get-ScheduledTask -TaskName "RuntimeBrokerMonitor" | Format-List * State : Ready Actions : {MSFT_TaskExecAction} Author : Date : Description : RuntimeBroker资源监控 Documentation : Principal : MSFT_TaskPrincipal2 SecurityDescriptor : Settings : MSFT_TaskSettings3 Source : TaskName : RuntimeBrokerMonitor TaskPath : \ Triggers : {MSFT_TaskDailyTrigger} URI : \RuntimeBrokerMonitor Version : PSComputerName : CimClass : Root/Microsoft/Windows/TaskScheduler:MSFT_ScheduledTask CimInstanceProperties : {Actions, Author, Date, Description...} CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties PS C:\Windows\System32> Get-Counter -ListSet *RuntimeBroker* | Select-Object -ExpandProperty Counter Get-Counter : 在 localhost 计算机上找不到任何与以下内容匹配的性能计数器集: *RuntimeBroker*。 所在位置 行:1 字符: 1 + Get-Counter -ListSet *RuntimeBroker* | Select-Object -ExpandProperty ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (:) [Get-Counter], Exception + FullyQualifiedErrorId : NoMatchingCounterSetsFound,Microsoft.PowerShell.Commands.GetCounterCommand PS C:\Windows\System32>
08-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值