Jump to content

A question about raw sockets and ip spoofing in C.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Kuto

Kuto

    Learning Programmer

  • Members
  • PipPipPip
  • 49 posts
Hi everyone, i am working on raw sockets and i am changing part of source ip of the tcp packet. so ip spoofing.
But i wonder something, as far as i know,when i send a packet to router, router delete it's source ip and write wan ip.

So i am changing source ip to hide my ip but router change again and write wan ip. How should i create the tcp packet for ip spoofing, what should i do? :confused:

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
I'm pretty sure it's just the MAC address in the Ethernet header that's modified, not the IP address.
sudo rm -rf /

#3
Kuto

Kuto

    Learning Programmer

  • Members
  • PipPipPip
  • 49 posts

dargueta said:

I'm pretty sure it's just the MAC address in the Ethernet header that's modified, not the IP address.

Yes modifies ethernet header but modifies ip header also. Because when we send a packet to router, its source ip is lan ip, like "192.168.1.12". Then router modifies its source ip and write wan ip, like "207.25.66.222". Sorry if i am wrong.

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
Well, it depends on the configuration, actually. If you have network address translation then the edge router will rely on the port to figure out which computer to send it to. Otherwise the IP has to remain intact for the incoming packets to return back to the originating computer, no?

I used to know this stuff... Crap. I really should remember this.
sudo rm -rf /