Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IP Spoofing #269

Open
FirstBlood12 opened this issue Apr 9, 2021 · 4 comments
Open

IP Spoofing #269

FirstBlood12 opened this issue Apr 9, 2021 · 4 comments

Comments

@FirstBlood12
Copy link

FirstBlood12 commented Apr 9, 2021

I want to test how much users my website can handle. so I want to know how can I do IP Spoofing using SharpPcap in C#.
I made a client in C# for my website so how can I spoof the source IP so I can test how much users can my website handle?

        `static WebSocket test;`
        `test = new WebSocket("ws://example.com:8080");`
        `test.OnClose += OnClose;`
        `test.OnOpen += OnOpen;`
        `test.OnMessage += OnMessage;`
        `test.Compression = CompressionMethod.Deflate;`
        `test.Connect();`
@chmorgan
Copy link
Collaborator

This should be entirely possible to do and I think with sharppcap either using the libpcap or the WinDivert driver. If you can see how it works with those libraries directly you can apply the same approach with sharppcap. I don't know specifically how to do that but someone else may comment here with more info.

@FirstBlood12
Copy link
Author

@chmorgan you coded SharpPcap and I think you should know how can I do IP Spoofing using SharpPcap, for example I generate random IP in C# and I replace source IP of socket with the random generated IP and I sent the socket to the website and I do this for each connection to my website so each connection will come from different IP.
So how I could do this?
Can you provide me a example code of doing this?

@chmorgan
Copy link
Collaborator

@FirstBlood12 you expect me to know how to implement IP spoofing just because I developed the library? I'm aware of what IP spoofing is but I've yet to implement it. It would be more than a little presumptuous of me to think that I could just guess at how to do it and know as much as you might about the subject.

On the SharpPcap side you can call LibPcapLiveDevice.SendPacket() to send a raw packet.

On the PacketDotNet side you can create an IP packet like https://github.com/chmorgan/packetnet/blob/master/Examples/ConstructingPackets/Main.cs

once you created your packet on the PacketDotNet side you'd turn around and send it via SendPacket() like:

myLiveDevice.SendPacket(myPacket.Bytes);

@FirstBlood12
Copy link
Author

FirstBlood12 commented Apr 16, 2021

@chmorgan I want to spoof source IP for websockets not for packets because I am using websocket-sharp, So how I would do IP Address Spoofing for websockets using SharpPcap?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants