Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python-将应用程序层信息转换为IP层信息_Python_Httprequest_Packet Capture - Fatal编程技术网

Python-将应用程序层信息转换为IP层信息

Python-将应用程序层信息转换为IP层信息,python,httprequest,packet-capture,Python,Httprequest,Packet Capture,在Python中,通过拦截和阻止web请求,我可以获得有关web请求的所有信息。我有URL,网站的URL,请求的下一个URL,Get/Post,导航类型,资源类型等,在字典中,如: Info = {"url": "https://www.google.com", ....} 我需要将其转换为IP结构的数据包(TCP(原始(…))并发送它们(可能使用Scapy的send/sendp/sr/srp),同时修改dest IP。我无法直接截获数据包,因为我无法找到阻止、修改数

在Python中,通过拦截和阻止web请求,我可以获得有关web请求的所有信息。我有URL,网站的URL,请求的下一个URL,Get/Post,导航类型,资源类型等,在字典中,如:

Info = {"url": "https://www.google.com",
             ....}
我需要将其转换为IP结构的数据包(TCP(原始(…))并发送它们(可能使用Scapy的
send/sendp/sr/srp
),同时修改dest IP。我无法直接截获数据包,因为我无法找到阻止、修改数据包,然后在上重新发送数据包的方法

在Python中,我将如何将我的应用程序级web请求转换为数据包

我使用的是Windows10和Python3.8,我可以使用任何第三方模块