473,327 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

http webrequest interception

Kevinyy
77
How would i go about intercepting a httpwebrequest sent from a browser (firefox/IE mainly) and then applying some code, then pass it through back to the browser for it to receive the altered request.
-Kevin
Jul 29 '08 #1
18 3038
Curtis Rutland
3,256 Expert 2GB
What have you tried so far?
Jul 29 '08 #2
Plater
7,872 Expert 4TB
That sounds like the task of a proxy server.
Investigate creating your own proxy servers and you will get lots of good ideas on how to do it.
Jul 29 '08 #3
Kevinyy
77
That sounds like the task of a proxy server.
Investigate creating your own proxy servers and you will get lots of good ideas on how to do it.
No, i would like to avoid proxy server, what im trying to do is intercept a httpwebrequest call from a browser for example, i type in www.google.com in my browser and my program catches the request processes it, and then sends the httpwebrequest(as if it were the browser sending the request originally.

I trying to draw out a plan, b4 investing time into to something that isnt rationale.

Using VC# w/ .NET 2.0 for this project.
Jul 29 '08 #4
Plater
7,872 Expert 4TB
Hmm, well you're going to have to use some Win32_API to do that I think.
You can either try at the network card level, like the way a packet sniffer would work, or you can try at the process level and find out what handles/tcp connections the desired program (IE, FF, etc) have active and try to attach onto them. I have no idea how to do either, I only know about the proxy server idea.
Jul 29 '08 #5
Kevinyy
77
Hmm, well you're going to have to use some Win32_API to do that I think.
You can either try at the network card level, like the way a packet sniffer would work, or you can try at the process level and find out what handles/tcp connections the desired program (IE, FF, etc) have active and try to attach onto them. I have no idea how to do either, I only know about the proxy server idea.
Yeah i was thinking about something like this, thanks

Any more input from other parties is welcome :D
Jul 29 '08 #6
Kevinyy
77
Is system.net.sockets namespace the lower level of the httpwebrequest? and if so, would i be able to use that instead of some win32API?
Jul 30 '08 #7
Plater
7,872 Expert 4TB
Well a socket is lower then httpwebrequest. Not sure its low enough to be usefull, but you might be able to attach onto other sockets with it.
Jul 30 '08 #8
Kevinyy
77
Well a socket is lower then httpwebrequest. Not sure its low enough to be usefull, but you might be able to attach onto other sockets with it.
Anything lower that comes to mind? for API use, Ive looked through pinvoke.net and i cant seem to find anything particular.
Jul 30 '08 #9
Frinavale
9,735 Expert Mod 8TB
Anything lower that comes to mind? for API use, Ive looked through pinvoke.net and i cant seem to find anything particular.
I would look into IIS ISAPI Filters....I seem to remember that you could implement one of these to modify requests sent to the server before it gets to your ASP.NET application.

This kind of thing is usually used for encrypting/decrypting data being sent between server and client...Since the ISAPI Filters sit between your application and the outside world, it leaves it up to them to do all of the heavy work.

There was an article on MSDN that explained how to do this...I don't have it bookmarked any more though. I think it falls under building secure web applications...or secure web services or something.

-Frinny
Jul 30 '08 #10
Kevinyy
77
I would look into IIS ISAPI Filters....I seem to remember that you could implement one of these to modify requests sent to the server before it gets to your ASP.NET application.

This kind of thing is usually used for encrypting/decrypting data being sent between server and client...Since the ISAPI Filters sit between your application and the outside world, it leaves it up to them to do all of the heavy work.

There was an article on MSDN that explained how to do this...I don't have it bookmarked any more though. I think it falls under building secure web applications...or secure web services or something.

-Frinny
Oh, im not trying to alter requests sent to my asp server, im trying to modify regualr http request sent by a browser. Trying to catch the request as it is being sent out, alter it, then, resume the send.
Jul 30 '08 #11
Plater
7,872 Expert 4TB
Oh, im not trying to alter requests sent to my asp server, im trying to modify regualr http request sent by a browser. Trying to catch the request as it is being sent out, alter it, then, resume the send.
And this boggles my mind that you don't want to be a proxy server.
Do you not want the browsers to have to be configured?
You could look into creating a plugin for FF and a browser helper object for IE?
Jul 30 '08 #12
Frinavale
9,735 Expert Mod 8TB
Oh, im not trying to alter requests sent to my asp server, im trying to modify regualr http request sent by a browser. Trying to catch the request as it is being sent out, alter it, then, resume the send.
It's confusing me as well....
You could look into using Tamper Data that is a plugin for FireFox....I use this all the time to test my websites.

I don't know what's out there for IE....

I didn't recommend this before because I'm not exactly sure what you are trying to do....
Jul 30 '08 #13
Kevinyy
77
And this boggles my mind that you don't want to be a proxy server.
Do you not want the browsers to have to be configured?
You could look into creating a plugin for FF and a browser helper object for IE?
It's confusing me as well....
You could look into using Tamper Data that is a plugin for FireFox....I use this all the time to test my websites.

I don't know what's out there for IE....

I didn't recommend this before because I'm not exactly sure what you are trying to do....
Ok all im trying to do is have my program delopy on a pc and Catch webrequest sent out by browsers, when it catches the request my program will do w/e to the requested address and continue to send the request as if the browser itself was sending it, then have the altered address show up in browser. ex. get ip from the address requested etc.....
No plugin's or anything like that, im trying to program this to work "out of the box" for the user.
Jul 30 '08 #14
Kevinyy
77
Hmm, ive been thinking about this all day, and here's an idea,
1. still need to intercept the URL requested by browsers and stop the request.
2. then i plan to get the ip of the request URL, add it to the hosts file (window>system32>drivers>etc>hosts) assigning a "new URL" name in the hosts file,
3. then shove that "new" URL into the browsers address bar send the new request.

Mainly, well, so far im like killing myself on finding a way to accomplish step 1. :[
Jul 31 '08 #15
Plater
7,872 Expert 4TB
Well the hosts file is frequently locked to keep just such programs as you are trying to write from tampering with it.
You continue to teeter over the line of usefull program into a program that is designed to hijack and tamper with a users computer.
If this is what you wish to accomplish, you will need to look elsewhere for help, as we do not provide that type of information.
MODERATOR
Jul 31 '08 #16
Kevinyy
77
Well the hosts file is frequently locked to keep just such programs as you are trying to write from tampering with it.
You continue to teeter over the line of usefull program into a program that is designed to hijack and tamper with a users computer.
If this is what you wish to accomplish, you will need to look elsewhere for help, as we do not provide that type of information.
MODERATOR
What im doing is writing a program that will bypass word based blockage at school. The students will have to run the program themselves. ive already bypassed it via host file, but i want to do it automated for other students, and to change the host file you have to open it and save it elsewhere the copy it back. im not changing the ip that i get from their webrequest, just changing the worded URL that is being used, the ip will still direct to the place they wanted.
for example, to do this manually you would have to ping www.youtube.com - and then get the ip: 208.65.153.238, then i would go into the host file and add to the bottom 208.65.153.238 www.schoolisawesome.com. Then when i type www.schoolisawesome.com into the web browser i would be going to youtube.com and therefore bypassing the word based block.
I am not at all trying or even attempting to direct them to malicious or harmful places.
Jul 31 '08 #17
Plater
7,872 Expert 4TB
Why not just type in http://208.65.153.238/ ?
And what you propose won't function on shared hosts. Some server farms rely on the Host: header to determine which web application to serve up. (i.e. multiple websites/domain names are hosted by the same server/ip address, so the web request header has to contain the host: header or it will reject it)
Jul 31 '08 #18
Curtis Rutland
3,256 Expert 2GB
I figured that this is what you were wanting to do back from your first question, how to make a client side proxy . I understand that your intent is not malicious, but subverting a school's internet filter is too close to a discussion of hacking. This is not allowed on this forum. Please abstain from any discussion of subverting security measures on this site.

This thread is now closed.

MODERATOR
Jul 31 '08 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Justin Malloy | last post by:
I am using the System.Net.Webclient to try and download an XML file from a website but am receiving a HTTP protocol error when running the DownloadFile() sub routine. I did a HTTP trace using...
1
by: Juan Dent | last post by:
Hi, The Request.SaveAs method stores in a file the complete HTTP request including the HttpVersion. However when I try to reproduce in memory the same thing, I cannot find the "HTTP/1.1"...
0
by: Owen | last post by:
Hello everyone, I am using VS.NET 2003(Trandition Chinese) Edition, and httpLook software for checking http requests. I found a problem that the following programs don't really "POST". These...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
1
by: Dan W. | last post by:
Does anyone have any experience with this problem. I am trying to post about 20 fields of information to another server using System.Net.WebClient.UploadData. This works fine for some servers but...
5
by: Tyler | last post by:
I am developing an application which will allow me to automatically sign into an external website. I can currently do a screen scrape using HTTPWEBREQUEST. However I want to just redirect to the...
3
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm trying to create a call to a web page to validate and register software. The code I'm using is: Private Sub OK_Click(ByVal sender As...
3
by: Gina_Marano | last post by:
Hey All, I need to download 1 or more files from a secure or unsecure website folder using HTTP. Here is what I have so far: public void GetHTTPImages() { WebClient HTTPClient = new...
1
by: Shashank | last post by:
Hi all, I am a new member of this community. I am making a http request to a html file placed on a Apache server. On this page there is an embeded perl statement which requires reading ...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
I am using ASP.Net 2.0 and VB.Net (although C#is ok also). I want to create an object/method/function that will take a URL as an input parameter and then return all of the HTML in that page. I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.