Delphiでロードできた特定のドライバー(ファイアウォールドライバー)がありますが、プログラム内で彼の関数を呼び出す方法がわかりません。ドライバでのこの関数の仕様は次のようになります: ファイアウォール関数は DeviceIoControl (DDoSflt) で呼び出すことができます IoControl コード (DeviceIoControl に必要) は次のとおりです:
0x2220c0 = IOCTL_START
Input: none
Output: none
ドライバーをロードした後、この関数を呼び出してファイアウォール フックをインストールします。
0x2220c4 = IOCTL_STOP
Input: none
Output: none
アンロードせずにファイアウォールを無効にするには、この関数を呼び出します。
0x2220c8 = IOCTL_DDOSADDIP
Input: a DWORD containing an IP address
Output: none
この機能は、DDoS 攻撃が進行中であることをファイアウォールに通知し、IP を DDoS フィルターに追加します。IOCTL_DDOSSTOP が呼び出されるまで、DDoS フィルターに含まれる IP からのすべてのトラフィックがフィルター処理されます。
0x2220cc = IOCTL_DDOSSTOP
Input: none
Output: none
この機能は、DDoS 攻撃が停止したことをファイアウォールに通知し、DDoS フィルターを削除します。
0x2220d0 = IOCTL_BAN0
Input: two DWORDs containing an IP range
Output: none
この関数は、IP 範囲に禁止を設定します。
0x2220d4 = IOCTL_GETFLT
Input: none
Output: DWORD
この関数は、DDoS フィルターで見つかった IP から送信され、フィルター処理された TCP/SYN パケットの数を返します。2. ファイアウォールが使用する構造
2.1. FirewallParametersInfo
typedef struct _FirewallParametersInfo{
WORD pcapFlags; // bit 0 = WinPCap is enabled, bit 1 = detection of adapters was completed (this WORD is not used by version 1.03 of DDoSflt)
WORD pcapAdapters; // mask of enabled / disabled adapters used by WinPCap procedures (this WORD is not used by version 1.03 of DDoSflt)
DWORD pcapTimer; // timeout for capturing packets using WinPCap procedures (not used by version 1.03 of DDoSflt)
BYTE pcapSyn; // maximum number of TCP/SYN packets per second allowed from one IP
BYTE pcapUdp; // maximum number of UDP packets per second allowed from one IP
BYTE pcapIcmp; // maximum number of ICMP packets per second allowed from one IP
BYTE firewallFlags; // bit 0 = firewall is registered
// bit 1 = firewall is started
// bit 2 = maximum SYN/second on hub's registered ports will be checked
// bit 3 = maximum SYN/second on unregistered ports will be checked
// bit 4 = ICMP traffic will be blocked
// bit 5 = TCP/RST packets will not be sent (will be filtered)
// bit 6 = if flood is detected, the application will call the firewall to set a _ban0_ (not used by firewall)
// bit 7 = if flood is detected, a notification message will be sent in opchat (not used by firewall)
WORD hubSyn; // maximum SYN rate allowed for one of registered hub's ports
WORD otherSyn; // maximum SYN rate allowed for non-registered ports
} FirewallParametersInfo;
2.2. ポート情報
typedef struct _port_info{
WORD port; // port value in network byte order
int synRate; // maximum number of TCP/SYN packets per second allowed from all users
} port_info;
これは ...