Table of Contents
1.  远程捕获
1.1.  远程捕获运行模式
1.2.  配置远程后台程序(rpcapd)
1.3.  安装远程后台程序
1.4.  在远程主机上启动捕获
1.5.  在UNIX上安装远程后台捕获程序
1.6.  已知的BUG
Home Database Mysql Tutorial WinPcap 中文技术文档(4.1.2)第五章

WinPcap 中文技术文档(4.1.2)第五章

Jun 07, 2016 pm 03:25 PM
Chinese capture Remotely

1.远程捕获 由于应用程序使用WinPcap的常规(normal)方式和推荐(suggested)方式是通过wpcap.dll完成的,所以我们不保证packet.dll的API不会在未来的WinPcap的发行版中被修改,并且我们不提供这个API的支持。由于这个原因,在这个指南中不会含有有关Packet.dll

1.  远程捕获

由于应用程序使用WinPcap的常规(normal)方式和推荐(suggested)方式是通过wpcap.dll完成的,所以我们不保证packet.dll的API不会在未来的WinPcap的发行版中被修改,并且我们不提供这个API的支持。由于这个原因,在这个指南中不会含有有关Packet.dll的文档。用户可以自行使用Doxygen来创建它们,或者阅读代码中的注释。

WinPcap拥有远程捕获的能力。这个高级特性能够捕获在远程网络上传输的数据包。

它需要一个远程后台程序(remotedaemon) (被称为rpcapd) ,它进行捕获然后把捕获到的数据发回。一个本地客户端会发送合适的命令并接收捕获到的数据。

WinPcap扩展了标准的WinPcap代码,这样,基于WinPcap的工具可以拥有远程捕获的能力。例如:远程后台程序被加入到客户软件中,我们并不需要另外修改,就能使程序拥有远程捕捉的能力。反之亦然,远程后台程序必须被安装(和配置)在远程机器上。

1.1.  远程捕获运行模式

远程捕获协议 (RPCAP) 可以在两种模式下工作:

1)  被动模式(PassiveMode) (默认): 客户机 (比如 a network sniffer) 连接到远程后台程序, 它发送一些合适的命令,并开始捕获。

2)  主动模式(ActiveMode): 远程后台程序试图连接到客户机 (比如 the network sniffer); 然后,客户机发送一些合适的命令,并开始捕获。 主动这个词的来历是因为远程后台程序 主动建立连接,而不是 等待 新的连接。

主动模式是有用的,除了当远程后台程序遇到了防火墙的阻止而不能访问外部网络时。在这种情况下,远程后台程序可以被配置成允许与已知的主机建立连接,而那个主机,只需要配置成等待连接即可。在连接建立完成之后,协议会继续自己的工作,这些工作在主动模式和被动模式下几乎是一样的。

Analyzer(http://analyzer.polito.it/30alpha/) 有一系列的命令 (在 Capture 菜单中) 。这些命令允许你接收一个远程连接,然后再远程设备上启动捕获。由于Analyzer需要一些代码上的修正,所以目前,它仅能工作在主动模式下。

1.2.  配置远程后台程序(rpcapd)

远程后台程序是一个标准的Win32可执行进程,它可以运行于受控模式或作为一个服务器。可执行进程可以在进入WinPcap文件夹后,使用下列语法找到它:

        rpcapd [-b

] [-p] [-6] [-l ] [-a ]

               [-n] [-v] [-d] [-s ][-f ]

后台进程也可以在Linux平台上编译并运行

以下是可用命令的简要描述

-b

 设置所绑定的程序的地址 (数字或文字的都行)。默认情况下,它将绑定所有的本地IPv4和IPv6地址。

-p

 设置所绑定的程序的端口,默认为2002

-4

 只绑定IPv4地址。默认:IPv4和IPv6被用于等待的sockets

-l

 它指明了一个包含允许程序连接的主机列表的文件(如果有多个,那么每行表示1个)。我们建议使用文字(而不是用数字)来描述,因为这样可以避免与IPv4或IPv6的地址发生误会。

-n

 它允许 NULL 的认证 (通常和 '-l' 一起使用, 这样能保证只有被允许的主机才能连接到程序)。默认情况下,用于身份认证的用户名/密码是必须的。

-a

 它强制程序运行在主动模式下,并在port端口,与主机host建立连接。这个并不标明,后台程序就不能运行在被动模式下了。

-v

 它强制程序只能运行于主动模式下。(默认情况:程序总是接受主动连接,即使指定了-a)

-d

 强制程序在后台运行,例如,作为一个后台程序(仅Unix)或作为一个服务程序(仅Win32)。警告(Win32):当WinPcap将这个程序安装进了Win32的服务中时,这个交换是自动提供的。(控制面板->管理工具->服务)

-s

 把当前配置保存到文件

-f

 从文件中加在配置信息。所有由命令行参数指明的交换都将会被忽略,代替它的,是文件内的设置

-h

 在屏幕上打印帮助信息

1.3.  安装远程后台程序

在安装WinPcap时,远程后台程序被自动安装。这个安装过程将rpcapd文件放入WinPcap文件夹中。这个文件可以用命令行方式执行,也可以作为一个服务。例如,安装过程更新了可用服务的列表,并创建了一个新的项目(远程数据包捕获协议 v.0 (试验中))。为了避免安全问题,服务是不激活的,它需要手工启动它。(控制面板->管理工具->服务->启动)

这个服务有一组 "标准" 的参数, 例如:使用"-d"标志和"-frpcapd.ini"标志启动(为了让它作为一个服务运行)。用户可以在与可执行进程相同的目录下,创建一个名为rpcapd.ini的文件,然后把配置命令放在里面。为了让服务执行这些命令,你需要重启服务。(初始化文件只会在开始运行的时候被揭西)。反之亦然,Unix版本的rpcapd在发送kill -HUP标志时,读取配置文件。在这种情况下,所有的已存在的连接都会保留原有配置,而新的连接则会根据新的配置参数创建。

万一用户不想手工创建配置文件,它可以使用加上了"-s filename"的请求参数来启动rpcapd。远程后台程序会解析所有的参数,并把它们保存到指定的配置文件中。

启动远程后台程序,作为一个标准执行进程

rpcapd可以直接启动,比如,它可以运行在前台(不作为后台程序或服务)。不走很简单,你需要从命令行启动程序,并输入所有必要的参数,除了"-d"标志。这样,捕获服务会在前台启动。

1.4.  在远程主机上启动捕获

如果你使用的工具已经知道如何进行远程捕获(比如Analyzer),那么一切都是简单的。捕获向导会帮助你在远程机器上建立合适的接口。

如果你喜欢那些还没有远程捕获功能的工具,你仍然可以进行远程捕获。在这里,你需要阅读下一节的内容。

特别小心: 捕获服务 (rpcapd)必须启动并在远程机器上运行。

用于选择接口的新字符串标识

如果你喜欢的工具还没有远程捕获功能,你必须做的唯一一件事,就是插入一个你想要连接的远程主机。可以使用以下形式:

适配器字符串

描述

file://filename

打开一个本地文件

rpcap://host.foo.bar/adaptername

打开一个远程适配器,host用文字来指明,没有端口号(即使用默认RPCAP端口)

rpcap://host.foo.bar:1234/adaptername

作用和上面的一样,只是指定了端口号

rpcap://10.11.12.13/adaptername

打开一个远程适配器,只是,主机由一个IPv4地址给出,没有端口号(使用RPCAP默认端口)

rpcap://10.11.12.13:1234/adaptername

作用和上面的一样,只是指定了端口号

rpcap://[10.11.12.13]:1234/adaptername

作用和上面的一样,只是将地址写入了方括号中,这样,更像是IPv6地址的表示方式

rpcap://[1:2:3::4]/adaptername

打开一个远程适配器,只是,主机由一个IPv6地址给出,没有端口号(使用RPCAP默认端口)。你必须使用方括号来表示一个IPv6地址。

rpcap://[1:2:3::4]:1234/adaptername

作用和上面的一样,只是指定了端口号

rpcap://adaptername

打开一个本地适配器,不使用RPCAP协议

adaptername

打开一个本地适配器,尽管它可行,但我们强烈不鼓励使用。

(NULL)

它将打开第一个本地适配器。尽管它是可行的,但我们强烈不鼓励使用。

以下形式是不对的:

适配器字符串

描述

rpcap://

它不能打开第一个本地适配器

rpcap://hostname/

它不能打开第一个本地适配器

1.5.  在UNIX上安装远程后台捕获程序

WinPcap程序同样可以在UNIX上进行编译。目前,远程捕获已经在Linux和BSD上经过了测试。你需要做的,有以下这些事情:

1)下载WinPcap源文件

2)解压缩源文件 ?我们建议使用 unzip-a 命令来将DOS文件转换成UNIX的

3)转到 libpcap 文件夹

4)输入命令:

./configure

警告: 万一上一个步骤出现了错误,请使用automake(需要2.50以上版本)命令重新生成配置文件

make

1)  转到 rpcapd 文件夹

2)  输入 make

在默认情况下,远程捕获功能在Linux和FreeBSD上是打开的。万一你不想使用远程捕获功能,你可以在配置的时候,输入:

    ./configure --disable-remote

当你输入 ./configure--help,所有的可以使用的参数将列出来。

你刚刚已经得到了:

1)  一个库文件(libpcap.a), 它可以连接到其他应用程序 (比如 tcpdump) 以便为他开启远程捕获。

2) 一个远程的可执行程序 (rpcapd)

警告: 为了运行远程捕获程序(rpcapd daemon), 程序必须符合下列中的一条:

1) 以root权限运行 (或)

2) 以user身份运行,但它必须属于root,并且必须有SUIDroot (chmod u+s rpcapd)

1.6.  已知的BUG

FreeBSD: 你第一次调用pcap_stat()时,函数会过段时间才返回。因此,像Analyzer这样的程序,在开始捕捉的时候,会停滞20-30秒。 (if this is done with BSD as a remote probe). 我们正在调查并试图解决这个问题。

如有任何问题,请访问 WinPcap 的帮助页面。

 

本文档已完成并且整理成pdf文件,需要者请从http://download.csdn.net/detail/fan_hai_ping/4584041处下载。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Remote Desktop cannot authenticate the remote computer's identity Remote Desktop cannot authenticate the remote computer's identity Feb 29, 2024 pm 12:30 PM

Windows Remote Desktop Service allows users to access computers remotely, which is very convenient for people who need to work remotely. However, problems can be encountered when users cannot connect to the remote computer or when Remote Desktop cannot authenticate the computer's identity. This may be caused by network connection issues or certificate verification failure. In this case, the user may need to check the network connection, ensure that the remote computer is online, and try to reconnect. Also, ensuring that the remote computer's authentication options are configured correctly is key to resolving the issue. Such problems with Windows Remote Desktop Services can usually be resolved by carefully checking and adjusting settings. Remote Desktop cannot verify the identity of the remote computer due to a time or date difference. Please make sure your calculations

How to set Chinese in Call of Duty: Warzone mobile game How to set Chinese in Call of Duty: Warzone mobile game Mar 22, 2024 am 08:41 AM

Call of Duty Warzone is a newly launched mobile game. Many players are very curious about how to set the language of this game to Chinese. In fact, it is very simple. Players only need to download the Chinese language pack, and then You can modify it after using it. The detailed content can be learned in this Chinese setting method introduction. Let us take a look together. How to set the Chinese language for the mobile game Call of Duty: Warzone 1. First enter the game and click the settings icon in the upper right corner of the interface. 2. In the menu bar that appears, find the [Download] option and click it. 3. Select [SIMPLIFIEDCHINESE] (Simplified Chinese) on this page to download the Simplified Chinese installation package. 4. Return to the settings

Setting up Chinese with VSCode: The Complete Guide Setting up Chinese with VSCode: The Complete Guide Mar 25, 2024 am 11:18 AM

VSCode Setup in Chinese: A Complete Guide In software development, Visual Studio Code (VSCode for short) is a commonly used integrated development environment. For developers who use Chinese, setting VSCode to the Chinese interface can improve work efficiency. This article will provide you with a complete guide, detailing how to set VSCode to a Chinese interface and providing specific code examples. Step 1: Download and install the language pack. After opening VSCode, click on the left

How to set Excel table to display Chinese? Excel switching Chinese operation tutorial How to set Excel table to display Chinese? Excel switching Chinese operation tutorial Mar 14, 2024 pm 03:28 PM

Excel spreadsheet is one of the office software that many people are using now. Some users, because their computer is Win11 system, so the English interface is displayed. They want to switch to the Chinese interface, but they don’t know how to operate it. To solve this problem, this issue The editor is here to answer the questions for all users. Let’s take a look at the content shared in today’s software tutorial. Tutorial for switching Excel to Chinese: 1. Enter the software and click the "File" option on the left side of the toolbar at the top of the page. 2. Select "options" from the options given below. 3. After entering the new interface, click the “language” option on the left

How to display Chinese characters correctly in PHP Dompdf How to display Chinese characters correctly in PHP Dompdf Mar 05, 2024 pm 01:03 PM

How to display Chinese characters correctly in PHPDompdf When using PHPDompdf to generate PDF files, it is a common challenge to encounter the problem of garbled Chinese characters. This is because the font library used by Dompdf by default does not contain Chinese character sets. In order to display Chinese characters correctly, we need to manually set the font of Dompdf and make sure to select a font that supports Chinese characters. Here are some specific steps and code examples to solve this problem: Step 1: Download the Chinese font file First, we need

An effective way to fix Chinese garbled characters in PHP Dompdf An effective way to fix Chinese garbled characters in PHP Dompdf Mar 05, 2024 pm 04:45 PM

Title: An effective way to repair Chinese garbled characters in PHPDompdf. When using PHPDompdf to generate PDF documents, garbled Chinese characters are a common problem. This problem usually stems from the fact that Dompdf does not support Chinese character sets by default, resulting in Chinese content not being displayed correctly. In order to solve this problem, we need to take some effective ways to fix the Chinese garbled problem of PHPDompdf. 1. Use custom font files. An effective way to solve the problem of Chinese garbled characters in Dompdf is to use

How to set the language of Windows 7 to Chinese How to set the language of Windows 7 to Chinese Dec 21, 2023 pm 10:07 PM

Some friends may accidentally set it to English when installing the system. As a result, all the interfaces are changed to English and they cannot be understood. In fact, we can set the language in the control panel and change the language to Chinese. Let’s take a look at how to change it. How to change the language in win7 to Chinese 1. First click the button in the lower left corner of the screen, and then select "Control Panel" 2. Find "Changedispalylanguage" under "Clock, Language, and Region" 3. Click "English" below to select from the drop-down menu Simplified Chinese. 4. After confirmation, click "Logoffnow" to log out and restart the computer. 5. After coming back

Will wwe2k24 have Chinese? Will wwe2k24 have Chinese? Mar 13, 2024 pm 04:40 PM

"WWE2K24" is a racing sports game created by Visual Concepts and was officially released on March 9, 2024. This game has been highly praised, and many players are eagerly interested in whether it will have a Chinese version. Unfortunately, so far, "WWE2K24" has not yet launched a Chinese language version. Will wwe2k24 be in Chinese? Answer: Chinese is not currently supported. The standard version of WWE2K24 in the Steam Chinese region is priced at 199 yuan, the deluxe version is 329 yuan, and the commemorative edition is 395 yuan. The game has relatively high configuration requirements, and there are certain standards in terms of processor, graphics card, or running memory. Official recommended configuration and minimum configuration introduction:

See all articles