欺骗HTTP请求的始发IP地址 [英] Spoofing the origination IP address of an HTTP request

查看:224
本文介绍了欺骗HTTP请求的始发IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这只需要在单个子网上工作,不会被恶意使用。

This only needs to work on a single subnet and is not for malicious use.

我有一个用Python编写的负载测试工具,它基本上会在URL上发出HTTP请求。我需要针对基于IP的负载均衡器运行性能测试,因此请求必须来自一系列IP。大多数商业性能工具都提供此功能,但我想将其构建为我自己的。

I have a load testing tool written in Python that basically blasts HTTP requests at a URL. I need to run performance tests against an IP-based load balancer, so the requests must come from a range of IP's. Most commercial performance tools provide this functionality, but I want to build it into my own.

该工具使用Python的urllib2进行传输。是否可以为构成请求的数据包发送带有欺骗性IP地址的HTTP请求?

The tool uses Python's urllib2 for transport. Is it possible to send HTTP requests with spoofed IP addresses for the packets making up the request?

推荐答案

这是对HTTP的误解。 HTTP协议基于 TCP 。 TCP协议依赖于3次握手来初始化请求。

This is a misunderstanding of HTTP. The HTTP protocol is based on top of TCP. The TCP protocol relies on a 3 way handshake to initialize requests.

alt text http://upload.wikimedia.org/wikipedia/commons/archive/c/c7/20051221162333!300px-Tcp-handshake.png

毋庸置疑,如果您欺骗原始IP地址,您将永远不会超过同步阶段,也不会发送任何HTTP信息(服务器可以不要将它发送给合法的主机。

Needless to say, if you spoof your originating IP address, you will never get past the synchronization stage and no HTTP information will be sent (the server can't send it to a legal host).

如果你需要测试一个IP负载均衡器,这不是这样做的方式。

If you need to test an IP load balancer, this is not the way to do it.

这篇关于欺骗HTTP请求的始发IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆