Spoofing the origination IP address of an HTTP request

前端 未结 5 1873
故里飘歌
故里飘歌 2020-12-08 05:18

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

I have a load testing tool written in Python that basically blasts HTTP requests at a URL.

5条回答
  •  忘掉有多难
    2020-12-08 05:39

    You could just use IP aliasing on a Linux box and set up as many IP addresses as you want. The catch is that you can't predict what IP will get stamped in the the IP header unless you set it to another network and set an explicit route for that network. i.e. -

    current client address on eth0 = 192.168.1.10/24
    
    server-side:
    ifconfig eth0:1 172.16.1.1 netmask 255.255.255.0
    
    client-side:
    ifconfig eth0:1 172.16.1.2 netmask 255.255.255.0 
    route add -net 172.16.1.0/24 gw 172.16.1.1 metric 0
    

    Repeat for as many subnets as you want. Restart apache to set listeners on all the new alias interfaces and you're off and running.

提交回复
热议问题