Modifying or Replacing an incoming packet?

What's the best way to setup a home network? Why should I care about BGP?

Modifying or Replacing an incoming packet?

Post by EpicFailer on Thu Sep 16, 2010 5:47 pm
([msg=45898]see Modifying or Replacing an incoming packet?[/msg])

Hi guys.
Can you help me find out a way to replace or modify an incoming packet to the system?

(Please forgive my lack of knowledge in my explanation)

I've tried getting the Source IP and adding this to my Windows hosts file, but for some reason when I type the IP into my browser it doesn't load the page I tell it to - it loads the original.

What I know about the packet:
My system sends a request to the server using the TCP protocol.
The server replies using TCP.
My system sends another two TCP packets.
(Until here they seem to be encrypted, SSL?)
My system sends a HTTP Get request.
Server replies via TCP. (Encrypted Again)
Server replies again via a HTTP 200.

When 200 is returned, it carries the data I wish to modify.
So is there anything I can do to modify the return packet, or replace it with one I crafted myself?


Thanks for reading, your responses are highly appreciated.

-- Fri Sep 17, 2010 5:01 pm --

I forgot to add:
The request is coming from a device connected through the laptop wired LAN port.
The LAN connection is bridged with the wireless connection so that the device connected to the laptop using LAN can connect to the internet through the laptop's wireless.

Operating system: Windows 7 64-bit


Any help guys?
User avatar
EpicFailer
New User
New User
 
Posts: 9
Joined: Thu Feb 18, 2010 9:38 am
Blog: View Blog (0)


Re: Modifying or Replacing an incoming packet?

Post by Rijnzael on Fri Sep 17, 2010 4:39 pm
([msg=45987]see Re: Modifying or Replacing an incoming packet?[/msg])

Your post is not very clear. You give a description of what you *think* you want to be done; not what you hope the end result will be. What exactly is it you intend to accomplish?
Rijnzael
Poster
Poster
 
Posts: 164
Joined: Sun Apr 13, 2008 10:12 am
Location: 128.0.0.0/8
Blog: View Blog (0)


Re: Modifying or Replacing an incoming packet?

Post by EpicFailer on Fri Sep 17, 2010 7:10 pm
([msg=45991]see Re: Modifying or Replacing an incoming packet?[/msg])

I'm sorry about that.

The device is connecting to the internet to check for updates. Because I can't edit the hosts file to return a fake update list what I wish to do is edit the packet containing the update information to say that what I'm running is the latest version.
This way my device will not be forced to update before it can connect to its online services.

The device is connected to my laptop using a LAN cable, and the LAN port shares the internet connection from my wireless card; this gives the device internet access.

About the packet:

The Packet may look like the following for example:
Code: Select all
Server: Apache
ETag: "1129ee63ad519844b0f3ff9baf6cd352:1283828834"
Last-Modified: Tue, 07 Sep 2010 03:07:14 GMT
Accept-Ranges: bytes
Content-Length: 491
Content-Type: text/plain
Date: Thu, 16 Sep 2010 21:12:25 GMT
Connection: keep-alive

currentFW=6.7000;imageName=a03f6


And I would wish to edit the packet to look like this:
Code: Select all
Server: Apache
ETag: "1129ee63ad519844b0f3ff9baf6cd352:1283828834"
Last-Modified: Tue, 07 Sep 2010 03:07:14 GMT
Accept-Ranges: bytes
Content-Length: 491
Content-Type: text/plain
Date: Thu, 16 Sep 2010 21:12:25 GMT
Connection: keep-alive

currentFW=6.4000;imageName=b860g



Please let me know if you need any more details.
User avatar
EpicFailer
New User
New User
 
Posts: 9
Joined: Thu Feb 18, 2010 9:38 am
Blog: View Blog (0)


Re: Modifying or Replacing an incoming packet?

Post by mischief on Fri Sep 17, 2010 7:36 pm
([msg=45993]see Re: Modifying or Replacing an incoming packet?[/msg])

if its using dns, you can run a dns server on your laptop to redirect the device to your machine. you can then run a webserver and set up a script to generate the correct responses. alternatively, you could write your own tiny server to emulate the proper responses for the device.
The whole secret of existence is to have no fear. Never fear what will become of you, depend on no one. Only the moment you reject all help are you freed.
--Buddha
User avatar
mischief
Poster
Poster
 
Posts: 355
Joined: Wed Jan 07, 2009 4:16 pm
Blog: View Blog (0)


Re: Modifying or Replacing an incoming packet?

Post by EpicFailer on Sat Sep 18, 2010 8:52 am
([msg=46036]see Re: Modifying or Replacing an incoming packet?[/msg])

Will a DNS server work for this?
The device is requesting a specific IP address, not a domain. (E.g 123.456.78.910 not http://www.example.com)
Because the IP is already known, wouldn't it not check the DNS table?

As for the proxy, I'd highly appreciate more details on this.
I've had an idea though:
What I was thinking is that if I set up Windows to use a proxy and set up a separate computer to be that proxy. Then the proxy computer could check the requests against the IP I wish to fake/redirect, and if it matches then connect to a custom remote server instead of their remote server?

Do you think the above would work?
(I can't even begin test it until tonight)
User avatar
EpicFailer
New User
New User
 
Posts: 9
Joined: Thu Feb 18, 2010 9:38 am
Blog: View Blog (0)


Re: Modifying or Replacing an incoming packet?

Post by dellex on Sat Sep 18, 2010 10:40 am
([msg=46041]see Re: Modifying or Replacing an incoming packet?[/msg])

What happens if you're not connected to the internet? will the device work properly?.... 'cause I was thinking if you can use a firewall, blocking the outgoing connections to that particular IP.


ps. sorry if my idea is stupid... i'm a noob! ;)
User avatar
dellex
New User
New User
 
Posts: 34
Joined: Tue Jun 01, 2010 7:36 am
Blog: View Blog (0)


Re: Modifying or Replacing an incoming packet?

Post by EpicFailer on Sat Sep 18, 2010 11:01 am
([msg=46045]see Re: Modifying or Replacing an incoming packet?[/msg])

Thanks for the suggestion, but completely blocking the IP is as good as just leaving it alone.

The device can still connect through web browser, but blocks other facilities.

I've had an idea to use Windows "route" command, I'll let everyone know how that works out.

-- Sun Sep 19, 2010 8:17 pm --

Well the route command isn't working.. now I'm trying to figure out how to set my linux box up as a proxy..
User avatar
EpicFailer
New User
New User
 
Posts: 9
Joined: Thu Feb 18, 2010 9:38 am
Blog: View Blog (0)



Return to Networking

Who is online

Users browsing this forum: No registered users and 0 guests