This essentially cannot be done, since the sender address is used by the server to send the response packets back to the client. If you fake the sender address, the TCP connection won't even get past the SYN-ACK phase (as the server will attempt to reply to the forwarders SYN packets with a FIN an ACK directly to the client - which will fail in most scenarios as the client won't have a half-open connection matching it). So - getting even the first payload into the server application would fail. This is why simple "spoof attacks" can only cause damage (unless the targets have seriously broken TCP/IP stacks) using connectionless protocols (UDP, ICMP etc). They can't get to any actual data using TCP.
Note that what you "Write()" to the TcpClient socket is NOT a packet. It is a payload. It will be sent in one or more actual packets over a connection established with a two-way initial packet exchange, each of which will be acknowledged or retransmitted by the sender - the client in this case. If you *really* want a one-way only packet transfer you can use UDP (but then you have to build your own acknowledgement/retransmit mechanism). Then, you could in theory spoof the sender IP (but like another poster noted, Windows and/or the framework will most likely not let you).
TCP-based application layer gateways (ALGs - such as those found in firewalls) handle it this way:
1. They keep track of their clients and forward the response traffic to the appropriate client based on the server IP and the port numbers used (as each client get their own sender port allocated by the forwarder - which becomes the receiver port in replies).
2. Some applications (FTP, for instance) insert the IP addresses in the packet payload (protocol commands). In this case, the ALG has to rewrite the commands (replacing the client's IP address and port(s) with its own) and then use method 1 as well.
Some protocols (such as SIP and other telephony applications) have more elaborate methods of handling ALGs - the ALGs become part of the protocol and actually tell the server that they're involved (as in "hi, this is me on this IP address, but I'm actually working on behalf of this guy on this private IP address that you can't see, so please let me know if you want to talk to him and I'll handle it for you"). This increases complexity by a factor of ten and explains why VoIP is sometimes such a royal pain in the a**... Even telephony operatores sometimes can't configure it correctly...
I'd advise writing a simple console app to test your new found knowledge. Good luck and enjoy!
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton
i need a client/server chat application that use it through internet (like Yahoo messenger),
i want to start server in my system and user(s) start client and chat together over internet, i want csharp code smaple and exe sample, can anybody help me (sample app or article)?
Iwont to Use The WorkFlow In C#.Net , but i dont konw any thing abut it , who i can learn abut it
if any boudy know any web application It hellp me tell me it .
or if any boudy have any sample about it give me it .
Thanks about any hellp me
well, it probably depends on your phone.
you can connect to most phones using SerialPort (e.g. via bluetooth or usb virtual COM drivers).
next you`ll have to check out the AT command subset your phone supports.
then send those commands to your phone and you're finished,
* dies & das - dot & net
I am writing a windows explorer toolbar that sets up a standard st of columns (like author, comments, etc..) so the user dosn't have to do it..(later will add more functions for handeling MS office documents etc..)
Now i have a working toolbar and have made my way through explorer to the lSysListView32 and using a LVCOLUMN managed to send the message that inserts the column..
But (allways a but) dose any one know how to tell explorer to populate the column with the info? I am only using standard columns (like author, comments, etc..)
Ok.. I get it... I am looked into IShellBrowser.GetViewStateStream, but carn't seem to get it working in c#, so now i am looking into the registery settings... HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU so i can make a button that aplies a template..
Filename,Author,subject,catagory, and comments.. are the column heading i want to set...