Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 13:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Hook HttpWebRequest

Discussion on Hook HttpWebRequest within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Hook HttpWebRequest

Hello Community.
How to hook for instance HttpWebRequest functions? Hooking C++ functions is quite easy but hooking .NET Framework functions does not work for me. The dll's cannot be injected. Do you have any solutions for my problem? I want to inject a native dll into a managed process.

Greetings,

qkuh
qkuh is offline  
Old 09/27/2013, 02:18   #2


 
Jeoni's Avatar
 
elite*gold: 966
Join Date: Apr 2010
Posts: 1,105
Received Thanks: 681
Well, it's just theory, as I never get in touch with hooking managed function. And I guess you can't hook managed code with a native module.
But the managed code is just a layer over the native code. The .net runtime (CLR) has to JIT-compile or interpret the .net bytecode to execute it. So whenever an managed application sends out a HttpWebRequest there have to be a native packet sent by a native socket (most likely over the native winapi). So your native dll could hook these functions (which is quite easy, just like you said) and log / analyse them.
Of course you can play around a bit and see if a winapi call to send a packet always comes from the same location (mscoree.dll maybe, I don't know) so you would know which .net function equivalent it is or if one HttpWebRequest instance always has the same socket. Maybe these things could be usefull for you.
I hope that I was able to help you at least a bit
Jeoni
Jeoni is offline  
Old 09/27/2013, 02:35   #3
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Yea, HttpWebRequest uses WSAConnect but how should I hook it? Because it's inside the ws2_32.dll which is loaded by the .net application.
qkuh is offline  
Old 09/27/2013, 09:22   #4
 
elite*gold: 100
Join Date: Aug 2005
Posts: 595
Received Thanks: 208
There are some ways todo it, jeonis approach is working normaly. Could you give us a bit more information about what you want to do ?

Iam a bit suprised btw, detouring ws2_32.dll functions should work
dready is offline  
Old 09/28/2013, 14:34   #5
 
elite*gold: 0
Join Date: Jun 2009
Posts: 132
Received Thanks: 37
dasschild is offline  
Old 09/28/2013, 15:30   #6
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Quote:
Originally Posted by dasschild View Post
That does not help me. I do not have access to the sourcecode. Thanks anyway.
qkuh is offline  
Old 09/28/2013, 16:10   #7
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
code in fremden .net code zu injecten sollte ja wohl kein problem sein. also wirste wohl auch das oben nutzen können

sonst wie schon gesagt einfach winsock hooken
tolio is offline  
Reply


Similar Threads Similar Threads
c# httpwebrequest Travian
12/07/2017 - .NET Languages - 2 Replies
Gude Leute ich hätt da mal ein anliegen ich will mir ein kleines Tool zur vereinfachten bedinung von Travian schreiben nur leider bekomme ich das irgendwie nicht auf die Reihe. da mein Code nicht so recht funktioniert hat habe ich mir den code von jemand anderes mal geklaut aber der ergibt das gleiche problem. Das Probleme ist er zeigt die Seite nicht richtig an und er baut keine truppen wenn ich auf Button1 click. wenn mir einer das vielleicht mal flicken könnte oder mir erklären...
[VB.net] HttpWebRequest URL Shrinker
09/11/2013 - Coding Tutorials - 1 Replies
Hey. Noch ein simples Tutorial, da ich die WebBrowser URL shrinker echt nicht mehr sehen kann, zeig ich euch mal wie das mit HttpWebRequest geht. Es handelt sich um ein simples Programm. Um das zu kaschieren werde ich es sehr ausführlich machen. Zuerst kümmern wir uns um die Imports und die Form. Habe die Objekte um des C&P's Willen nicht verändert. Imports System.IO Imports System.Net Die Form: http://i.epvpimg.com/8VB0c.png
C# httpwebrequest
08/16/2013 - .NET Languages - 1 Replies
Hallo leute ich hab mal ne frage ich versuche ein Programm zu schreiben was durch die POST methode beispielsweise ein Ereigniss auf einer Webseite auslöst (zb abmelden auf elietepvpers klicken) nun habe ich leider keine ahnung wie ich herausfinde was ich in den POST string eintragen soll hier mein bisheriger code ich weis ist das Microsoft beispiel // Create a request using a URL that can receive a post. WebRequest request = ...
AHK -> [C#] HttpWebRequest
06/24/2013 - .NET Languages - 3 Replies
Hey, habe ein Programm mit AHK geschrieben, welches eine Login Form hat. Nun habe ich mich länger mit C# beschäftigt und habe auch erfolgreich einen MySQL Login local durchgeführt. Allerdings wurde mir jetzt im Nachhinein bewusst, dass viele Hoster keinen externen Programmzugriff zulassen. Deshalb muss man dies mit HttpWebRequest machen. Aus diesem Grund wollte ich fragen, ob mir vielleicht jemand diesen AHK Code in C# umschreiben könnte. Wäre sehr nett! LG Login: gui, Submit,...
HTTPWebRequest???
02/19/2013 - .NET Languages - 2 Replies
Hey ich wollte einen Bot erstellen (FlaschenBot für Pennergame). ann wollt ich eben EIn Addon runterladen . Also einen HTTP Header.. Doch dann kam dass raus. http://www.fotos-hochladen.net/thumbnail/unbenann tk38c6smev2_thumb.jpg bitte Helft mir.



All times are GMT +1. The time now is 13:24.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.