فهم شبكات Windows_WFP
Categories:
- فهم شبكات Windows_WFP
فهم شبكات Windows
- فهم شبكات Windows
WFP
تفسير المصطلحات
https://learn.microsoft.com/en-us/windows/win32/fwp/object-model https://learn.microsoft.com/en-us/windows/win32/fwp/basic-operation https://learn.microsoft.com/en-us/windows-hardware/drivers/network
callout: A callout provides functionality that extends the capabilities of the Windows Filtering Platform. A callout consists of a set of callout functions and a GUID key that uniquely identifies the callout. callout driver: A callout driver is a driver that registers callouts with the Windows Filtering Platform. A callout driver is a type of filter driver. callout function: A callout function is a function that is called by the Windows Filtering Platform to perform a specific task. A callout function is associated with a callout. filter: A filter is a set of functions that are called by the Windows Filtering Platform to perform filtering operations. A filter consists of a set of filter functions and a GUID key that uniquely identifies the filter. filter engine: The filter engine is the component of the Windows Filtering Platform that performs filtering operations. The filter engine is responsible for calling the filter functions that are registered with the Windows Filtering Platform. filter layer: A filter layer is a set of functions that are called by the Windows Filtering Platform to perform filtering operations. A filter layer consists of a set of filter layer functions and a GUID key that uniquely identifies the filter layer.
يتم تشغيل رد نداء قائمة انتظار المرسل (Dispatcher queue) في أسرع وقت ممكن، دون الحاجة إلى انتظار امتلاء القائمة، مما يلبي متطلبات الوقت الفعلي. عندما يكون رد نداء المستخدم بطيئًا، يتم إدراج الحزم المحظورة قدر الإمكان في القائمة التالية، مع حد أقصى للقائمة يبلغ 256. يتم تخزين المزيد من الحزم المحظورة مؤقتًا بواسطة النظام، وقدرة التخزين المؤقت في الاختبار التقريبي هي 16500، وقد تختلف قدرة التخزين المؤقت للنظام بناءً على أداء الجهاز وتكوينه. عند معالجة رد نداء المستخدم للحزم، يوجد كيانان للحزمة: حزمة النواة، يتم تحريرها معًا بعد انتهاء رد النداء من معالجة القائمة. لذا عندما يكون رد النداء بطيئًا، سيقوم تنفيذ رد نداء واحد بقفل ما يصل إلى 256 حزمة من قدرات التخزين المؤقت للنظام. النسخة الموجودة داخل رد النداء، يتم تحريرها فورًا بعد معالجة حزمة واحدة.
في FwppNetEvent1Callback، يتم إجراء نسخ وتجميع للحزم، ولا يتم التلاعب بالحزمة الأصلية، مما لا يؤثر على العمل.
يمكن للاشتراكات استخدام مرشحات القوالب لتقليل عدد الحزم التي تحتاج إلى المعالجة:
filterCondition
An array of FWPM_FILTER_CONDITION0 structures that contain distinct filter conditions (duplicated filter conditions will generate an error). All conditions must be true for the action to be performed. In other words, the conditions are AND’ed together. If no conditions are specified, the action is always performed.
لا يمكن استخدام نفس المرشح (filter) العلاقة بين جميع المرشحات هي “AND” (و)، مما يعني الحاجة إلى استيفاء جميع الشروط. تظهر مستندات Microsoft أن هناك ثمانية أنواع من المرشحات مدعومة، ولكن في الواقع هناك المزيد من المرشحات المدعومة.
FWPM_CONDITION_IP_PROTOCOL
The IP protocol number, as specified in RFC 1700. FWPM_CONDITION_IP_LOCAL_ADDRESS
The local IP address. FWPM_CONDITION_IP_REMOTE_ADDRESS
The remote IP address. FWPM_CONDITION_IP_LOCAL_PORT
The local transport protocol port number. For ICMP, the message type. FWPM_CONDITION_IP_REMOTE_PORT
The remote transport protocol port number. For ICMP, the message code. FWPM_CONDITION_SCOPE_ID
The interface IPv6 scope identifier. Reserved for internal use. FWPM_CONDITION_ALE_APP_ID
The full path of the application. FWPM_CONDITION_ALE_USER_ID
The identification of the local user. عند تعداد الاشتراكات المسجلة في النظام، تم العثور على اشتراكين بالفعل، ولم يتم التأكد من جهة التسجيل من خلال التحقق من مفتاح الجلسة (sessionKey) GUID، ولكن من خلال تحليلها، وجد أن كل اشتراكين ينفذان الوظائف التالية:
اشترك في جميع حزم بيانات FWPM_NET_EVENT_TYPE_CLASSIFY_DROP، وقام بإحصاء جميع الحزم التي تم إسقاطها. اشترك في جميع حزم بيانات FWPM_NET_EVENT_TYPE_CLASSIFY_ALLOW، ويمكن استخدامه لإجراء إحصائيات حركة المرور. إن مرشح الشرط (condition filter) المستخدم في كلا الاشتراكين هو FWPM_CONDITION_NET_EVENT_TYPE (206e9996-490e-40cf-b831-b38641eb6fcb)، مما يشير إلى أن المرشحات القابلة للتطبيق ليست فقط الثمانية المذكورة في مستندات Microsoft.
كشفت المزيد من الأبحاث أن واجهة الاستدعاء في وضع المستخدم يمكنها فقط التقاط أحداث الإسقاط (drop)، بينما تتطلب الأحداث غير المسقطة استخدام وضع النواة للحصول عليها، لذلك لا يمكن لعزل الخدمات الدقيقة (Micro-segmentation) استخدام FWPM_CONDITION_NET_EVENT_TYPE للحصول على الأحداث.