Referer spoofing in webrequests with C#

Discuss the many weaknesses of browser security and ways to mitigate the threat

Referer spoofing in webrequests with C#

Post by dgsc1 on Mon Jul 19, 2010 9:53 am
([msg=42117]see Referer spoofing in webrequests with C#[/msg])

hey guys... I've been having a hard time changing the "Referer" header of my webrequests for obvious reasons (that it is a restricted header)... Every solution I have found online has already been eliminated by microsoft... does anybody know a way arround it?... (preferably in C# please)

I can't believe I can't send a simple edited string of my choice to a server... I mean thats all a web request is right?

(I tried inheriting the HttpRequestHeader class and overiding the set and get methods with methods that "addwithoutvalidate()"... my next attempt might be to just look up the source code for webrequest "build" my own class without all the annoying restictions)
dgsc1
New User
New User
 
Posts: 4
Joined: Mon Jul 19, 2010 9:39 am
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by Bren2010 on Mon Jul 19, 2010 10:06 am
([msg=42120]see Re: Referer spoofing in webrequests with C#[/msg])

You can't use microsoft software to hack microsoft software! It's just not right. The laws of the universe forbid it.
Last edited by Bren2010 on Mon Jul 19, 2010 12:35 pm, edited 1 time in total.
User avatar
Bren2010
Poster
Poster
 
Posts: 340
Joined: Fri Sep 19, 2008 3:23 pm
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by tremor77 on Mon Jul 19, 2010 10:10 am
([msg=42121]see Re: Referer spoofing in webrequests with C#[/msg])

It is incredibly easy and you don't need C#

A simple Google search should provide the greatest solution.

Decipher a code in this post to find the string to search.
Image
User avatar
tremor77
Contributor
Contributor
 
Posts: 884
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by Bren2010 on Mon Jul 19, 2010 10:17 am
([msg=42122]see Re: Referer spoofing in webrequests with C#[/msg])

@tremor77 - I think he's trying to write a script to do something, not download stuff.

@OP - PHP cURL lets you define your own referer. . . if that is what your going for.
User avatar
Bren2010
Poster
Poster
 
Posts: 340
Joined: Fri Sep 19, 2008 3:23 pm
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by dgsc1 on Mon Jul 19, 2010 12:30 pm
([msg=42137]see Re: Referer spoofing in webrequests with C#[/msg])

Bren2010 wrote:Your can't use microsoft software to hack microsoft software! It's just not right. The laws of the universe forbid it.


hahaha... that is a good point... none the less what about the web client class and the system.net.sockets classes... isn't there anythign I can do from those? I'll be looking into those myself but anything you guys can help me with would be much appreciated... considering I don't know the required data sent over a web request or how C# accesses the appropriate devices any information or references to reading I can do would be wonderful... and in case you guys are wondering the program im building is a very simple application that I can probably get online, but I would rather code for myself and learn to make my own tools... I'm making a selective browser that makes a request to a site of my choosing, shows me the source code, allows me to alter it, then parses that code... I know firefox has their apps for this and all but its much more fun to build it myself...
dgsc1
New User
New User
 
Posts: 4
Joined: Mon Jul 19, 2010 9:39 am
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by sanddbox on Mon Jul 19, 2010 1:07 pm
([msg=42139]see Re: Referer spoofing in webrequests with C#[/msg])

tremor77 wrote:It is incredibly easy and you don't need C#

A simple Google search should provide the greatest solution.

Decipher a code in this post to find the string to search.


That code was impossible to decipher...

See if you can decipher my top secret code!
Image

HTS User Composition:
95% Male
4.98% Female
.01% Monica
.01% Goat
User avatar
sanddbox
Expert
Expert
 
Posts: 2331
Joined: Sat Jul 04, 2009 5:20 pm
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by Bren2010 on Mon Jul 19, 2010 1:27 pm
([msg=42141]see Re: Referer spoofing in webrequests with C#[/msg])

@sanddbox - Gosh, that's even harder. :(

@dgsc1 - . . . Idk, try it.
User avatar
Bren2010
Poster
Poster
 
Posts: 340
Joined: Fri Sep 19, 2008 3:23 pm
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by dgsc1 on Mon Jul 19, 2010 1:34 pm
([msg=42142]see Re: Referer spoofing in webrequests with C#[/msg])

tremor77 wrote:It is incredibly easy and you don't need C#

A simple Google search should provide the greatest solution.

Decipher a code in this post to find the string to search.


right tamperData... thanks anyway for that... that's what my bro told me to do... but I am trying to code it into a browser of my own...

Man, thats why object oriented programing and I never got along... everything is built for you according to what they think you need so that when you actually need something made simple for you you end up having to build it yourself anyway cause it doesn't apply to your personal application...

sorry about the rant guys... I'm just a little annoyed about microsoft... I hope someone can shed some light on this while I look into this system.net.socket stuff
dgsc1
New User
New User
 
Posts: 4
Joined: Mon Jul 19, 2010 9:39 am
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by secdef9 on Mon Jul 19, 2010 1:49 pm
([msg=42143]see Re: Referer spoofing in webrequests with C#[/msg])

dgsc1 wrote:
right tamperData... thanks anyway for that... that's what my bro told me to do... but I am trying to code it into a browser of my own...

Man, thats why object oriented programing and I never got along... everything is built for you according to what they think you need so that when you actually need something made simple for you you end up having to build it yourself anyway cause it doesn't apply to your personal application...

sorry about the rant guys... I'm just a little annoyed about microsoft... I hope someone can shed some light on this while I look into this system.net.socket stuff


LibCurl is a C-based library that can send a request with a forged header in just a few lines. I know it's not C#, but it's worth looking into.

http://www.hackthissite.org/articles/read/1078

</shameless self promotion>
User avatar
secdef9
New User
New User
 
Posts: 9
Joined: Sat Jan 31, 2009 12:45 pm
Blog: View Blog (0)


Re: Referer spoofing in webrequests with C#

Post by tremor77 on Mon Jul 19, 2010 1:56 pm
([msg=42144]see Re: Referer spoofing in webrequests with C#[/msg])

I'm making a selective browser that makes a request to a site of my choosing, shows me the source code
, allows me to alter it, then parses that code...


how far along are you with the application? Do you have the gui in place? If you can give me an idea to what you have working at this point maybe I can help fill in the gaps. Personally I'm too lazy to gin up this type of software on my own but it's something I might be able to contribute a few lines of code to.

oh and sorry about my secret code.. I was utterly bored to hell.
Image
User avatar
tremor77
Contributor
Contributor
 
Posts: 884
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)


Next

Return to Web

Who is online

Users browsing this forum: No registered users and 0 guests

cron