How can I spoof the sender IP address using curl?

前端 未结 3 1883
面向向阳花
面向向阳花 2020-12-08 00:31

I need to make a request with a spoofed IP address for testing purposes. What\'s the easiest way to do this?

3条回答
  •  情深已故
    2020-12-08 00:57

    You can't.

    In general, spoofing IP addresses for TCP is remarkably difficult. Unless you have control of a router quite near your target or near the IP you're spoofing, consider it impossible.

    The reply packets need a path back to you in order to complete even the three-way handshake. The most reliable way to do this is to have control over a router in the most common pathway between your target and your spoofed IP address: this would let you capture packets between the target and the spoofed address and forward them on to you.

    You could also try injecting bogus BGP route advertisements, but doing so would doubtless be noticed and cost you dearly when your peers drop you completely.

提交回复
热议问题