<?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[Komplex !? Packet-Programming]]></title><description><![CDATA[<p>Hallo,</p>
<p>es geht darum, dass ich die Packete die ein Programm senden<br />
will, emulieren möchte, ich habe den Header auch schon vorbereitet:</p>
<p><strong>Bei dem Protokoll handelt es sich um TCP</strong></p>
<pre><code class="language-cpp">/*                 ADRESS     (an den Router)                */
	/* set mac destination */
	//packet[i]=0;
	packet[i++]=0;
	packet[i++]=4;
	packet[i++]=226;
	packet[i++]=87;
	packet[i++]=59;
	packet[i++]=248;

	/* set mac source */
	packet[i++]=0;
	packet[i++]=16;
	packet[i++]=220;
	packet[i++]=229;
	packet[i++]=41;
	packet[i++]=51;

	/*                 Header                  */
	/* Type: (we want IP!!) */
	packet[i++]=8;
	packet[i++]=0;
	/* Version: It's &quot;4&quot;    */
	packet[i++]=69;
	/* Different Services (not needed!) */
	packet[i++]=0;                // packet 16 (i = 15)
    /* Total Length */
	packet[i++]=0;
	packet[i++]=52;
	/* IDENTIFICATION!!!??? */
	packet[i++]=207;
	packet[i++]=169;	
	/* Flags: We need to choose &quot;dont fragment&quot; */
	packet[i++]=64;
	packet[i++]=0; // &lt;- Offset
	packet[i++]=128; // &lt;- Timeout
	packet[i++]=6; // &lt;- PROTOCOLL: TCP
	/* Header: CHECKSUM!!!! */
	packet[i++]=40;
	packet[i++]=50;        // Only for the header!!!

	/* Adress: IP NOW! */
	//source
	packet[i++]=192;
	packet[i++]=168;
	packet[i++]=2;
	packet[i++]=4;    // my IP
	//destination
	packet[i++]=213;
	packet[i++]=248;
	packet[i++]=106;
	packet[i++]=67;    // DESTINATION IP

	/*  TRANSMISSIOM CONTROL PROTOCOL */
	//Source Port:
	packet[i++]=10;   // Source Port
	packet[i++]=22;  //  = 2582
	//Destination Port:
	packet[i++]=23;   // Destination Port
    packet[i++]=224; // = 6112
    //Sequence number:0!? (relative number)
    packet[i++]=57;
	packet[i++]=163;
	packet[i++]=122;
	packet[i++]=211;
	//Acknowledgement number:0!? (relative number)
    packet[i++]=222;
	packet[i++]=216;
	packet[i++]=165;
	packet[i++]=35;
	//Header Length
	packet[i++]=80; //20 bytes
	//Flags (0x0018) [PSH, ACK]
	packet[i++]=24;
	//Window size (65151)
	packet[i++]=254;
	packet[i++]=127;
	//Checksum
	packet[i++]=230;
	packet[i++]=139;

	//2 Packets buffer
	packet[i++]=0;
	packet[i++]=0;
</code></pre>
<p>Leider funktioniert das noch nicht so ganz, da zu meinem Schreck einige Sachen variabel sind!</p>
<p>Ich habe auch schon ermittelt welche:</p>
<p><a href="http://upload.wikimedia.org/wikipedia/de/8/80/UDP.PNG" rel="nofollow">http://upload.wikimedia.org/wikipedia/de/8/80/UDP.PNG</a></p>
<pre><code class="language-cpp">Header:
IP Header:
Checksum               &lt;-Variabel ( Weil die Identification Number Variabel ist )

Identification Number  &lt;-Variabel

UDP Header:
Sequence Number         &lt;-Variabel

Acknowledgement Number   &lt;-Variabel

Window size  &lt;-Variabel

Checksum²         &lt;-Variabel  ( Weil einige Sachen auch Variabel ist )
</code></pre>
<p>Und genau an diesem Punkt brauche ich eure Hilfe weil ich echt nicht mehr weiterweiß <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>
<p>Es gibt ein Programm namens &quot;Winsock Packet Editor&quot;, das kommt auch schon mit den Angaben zurecht, was in dem Packet stehen soll,<br />
wie komme ich denn jetzt an eine gültige Identification, Sequence, Acknowledgement und Window size, number.</p>
<p>Außerdem verstehe ich noch nicht wie sich in solchen Packeten die &quot;Checksum&quot; errechnet.</p>
<p>Vielen Dank schonmal,<br />
bitte bedenkt, dass ich gerade erst mit &quot;Packeten&quot;<br />
anfange, mein Wissen ist also nicht zu groß <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/161531/komplex-packet-programming</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 21:41:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/161531.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 07 Oct 2006 16:23:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Komplex !? Packet-Programming on Sat, 07 Oct 2006 17:35:41 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>es geht darum, dass ich die Packete die ein Programm senden<br />
will, emulieren möchte, ich habe den Header auch schon vorbereitet:</p>
<p><strong>Bei dem Protokoll handelt es sich um TCP</strong></p>
<pre><code class="language-cpp">/*                 ADRESS     (an den Router)                */
	/* set mac destination */
	//packet[i]=0;
	packet[i++]=0;
	packet[i++]=4;
	packet[i++]=226;
	packet[i++]=87;
	packet[i++]=59;
	packet[i++]=248;

	/* set mac source */
	packet[i++]=0;
	packet[i++]=16;
	packet[i++]=220;
	packet[i++]=229;
	packet[i++]=41;
	packet[i++]=51;

	/*                 Header                  */
	/* Type: (we want IP!!) */
	packet[i++]=8;
	packet[i++]=0;
	/* Version: It's &quot;4&quot;    */
	packet[i++]=69;
	/* Different Services (not needed!) */
	packet[i++]=0;                // packet 16 (i = 15)
    /* Total Length */
	packet[i++]=0;
	packet[i++]=52;
	/* IDENTIFICATION!!!??? */
	packet[i++]=207;
	packet[i++]=169;	
	/* Flags: We need to choose &quot;dont fragment&quot; */
	packet[i++]=64;
	packet[i++]=0; // &lt;- Offset
	packet[i++]=128; // &lt;- Timeout
	packet[i++]=6; // &lt;- PROTOCOLL: TCP
	/* Header: CHECKSUM!!!! */
	packet[i++]=40;
	packet[i++]=50;        // Only for the header!!!

	/* Adress: IP NOW! */
	//source
	packet[i++]=192;
	packet[i++]=168;
	packet[i++]=2;
	packet[i++]=4;    // my IP
	//destination
	packet[i++]=213;
	packet[i++]=248;
	packet[i++]=106;
	packet[i++]=67;    // DESTINATION IP

	/*  TRANSMISSIOM CONTROL PROTOCOL */
	//Source Port:
	packet[i++]=10;   // Source Port
	packet[i++]=22;  //  = 2582
	//Destination Port:
	packet[i++]=23;   // Destination Port
    packet[i++]=224; // = 6112
    //Sequence number:0!? (relative number)
    packet[i++]=57;
	packet[i++]=163;
	packet[i++]=122;
	packet[i++]=211;
	//Acknowledgement number:0!? (relative number)
    packet[i++]=222;
	packet[i++]=216;
	packet[i++]=165;
	packet[i++]=35;
	//Header Length
	packet[i++]=80; //20 bytes
	//Flags (0x0018) [PSH, ACK]
	packet[i++]=24;
	//Window size (65151)
	packet[i++]=254;
	packet[i++]=127;
	//Checksum
	packet[i++]=230;
	packet[i++]=139;

	//2 Packets buffer
	packet[i++]=0;
	packet[i++]=0;
</code></pre>
<p>Leider funktioniert das noch nicht so ganz, da zu meinem Schreck einige Sachen variabel sind!</p>
<p>Ich habe auch schon ermittelt welche:</p>
<p><a href="http://upload.wikimedia.org/wikipedia/de/8/80/UDP.PNG" rel="nofollow">http://upload.wikimedia.org/wikipedia/de/8/80/UDP.PNG</a></p>
<pre><code class="language-cpp">Header:
IP Header:
Checksum               &lt;-Variabel ( Weil die Identification Number Variabel ist )

Identification Number  &lt;-Variabel

UDP Header:
Sequence Number         &lt;-Variabel

Acknowledgement Number   &lt;-Variabel

Window size  &lt;-Variabel

Checksum²         &lt;-Variabel  ( Weil einige Sachen auch Variabel ist )
</code></pre>
<p>Und genau an diesem Punkt brauche ich eure Hilfe weil ich echt nicht mehr weiterweiß <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>
<p>Es gibt ein Programm namens &quot;Winsock Packet Editor&quot;, das kommt auch schon mit den Angaben zurecht, was in dem Packet stehen soll,<br />
wie komme ich denn jetzt an eine gültige Identification, Sequence, Acknowledgement und Window size, number.</p>
<p>Außerdem verstehe ich noch nicht wie sich in solchen Packeten die &quot;Checksum&quot; errechnet.</p>
<p>Vielen Dank schonmal,<br />
bitte bedenkt, dass ich gerade erst mit &quot;Packeten&quot;<br />
anfange, mein Wissen ist also nicht zu groß <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151097</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151097</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Sat, 07 Oct 2006 17:35:41 GMT</pubDate></item><item><title><![CDATA[Reply to Komplex !? Packet-Programming on Sat, 07 Oct 2006 16:36:41 GMT]]></title><description><![CDATA[<p>schon mal in erwaegung gezogen, strukturen zu benutzen?<br />
und warum verschickst du nicht einfach ein udp-paket mit einer netzwerk-api deiner wahl?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151104</guid><dc:creator><![CDATA[hellihjb]]></dc:creator><pubDate>Sat, 07 Oct 2006 16:36:41 GMT</pubDate></item><item><title><![CDATA[Reply to Komplex !? Packet-Programming on Sat, 07 Oct 2006 16:39:29 GMT]]></title><description><![CDATA[<p>hellihjb schrieb:</p>
<blockquote>
<p>schon mal in erwaegung gezogen, strukturen zu benutzen?<br />
und warum verschickst du nicht einfach ein udp-paket mit einer netzwerk-api deiner wahl?</p>
</blockquote>
<p>das ist keine netzwerk-api meiner wahl,<br />
die habe ich vorher mit Etheral aufgezeichnet,<br />
ich möchte einfach ein vorher aufgezeichnetes Packet,<br />
nochmals senden!</p>
<p>Die Basis dieses Codes ist von der Winpcap Seite,<br />
wenn ich den &quot;Mechanismus&quot; verstehen würde, würde ich das<br />
vielleicht effizienter schreiben.</p>
<p>Bis jetzt ist es nur ein Sammeln von Daten,<br />
und Analysieren <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151106</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Sat, 07 Oct 2006 16:39:29 GMT</pubDate></item><item><title><![CDATA[Reply to Komplex !? Packet-Programming on Sat, 07 Oct 2006 17:16:06 GMT]]></title><description><![CDATA[<p>dein beispiel ist aber kein udp sondern tcp <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
hier haste ein tutorial für sowas: <a href="http://www.vijaymukhi.com/vmis/ethtcp.htm" rel="nofollow">http://www.vijaymukhi.com/vmis/ethtcp.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151127</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Sat, 07 Oct 2006 17:16:06 GMT</pubDate></item><item><title><![CDATA[Reply to Komplex !? Packet-Programming on Sat, 07 Oct 2006 17:35:27 GMT]]></title><description><![CDATA[<p>net schrieb:</p>
<blockquote>
<p>dein beispiel ist aber kein udp sondern tcp <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
hier haste ein tutorial für sowas: <a href="http://www.vijaymukhi.com/vmis/ethtcp.htm" rel="nofollow">http://www.vijaymukhi.com/vmis/ethtcp.htm</a></p>
</blockquote>
<p>Sorry, du hast natürlich recht es ist tcp,<br />
werde mir das mal angucken, danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151139</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151139</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Sat, 07 Oct 2006 17:35:27 GMT</pubDate></item><item><title><![CDATA[Reply to Komplex !? Packet-Programming on Sun, 08 Oct 2006 11:33:36 GMT]]></title><description><![CDATA[<p>dh du willst so tun als wuerde das paket von einem anderen rechner verschickt?<br />
in wie weit das uberhaupt sinnvoll ist, kommt darauf an, was genau du vor hast; aber in dem fall musst du tatsaechlich den paket-header selber erzeugen.<br />
und anstatt da mit einzelnen bytes rumzukaspern waere doch eine struktur zur abbildung eines <a href="http://de.wikipedia.org/wiki/TCP-Header#Aufbau_des_TCP-Headers" rel="nofollow">tcp-pakets</a> ganz geistreich und weniger fehleranfaellig.<br />
nachdem der header existiert kannst du die nutzdaten eines &quot;aufgezeichneten&quot; pakets ja einfach 1:1 uebernehmen.<br />
berechnung der checksumme geht <a href="http://www.netfor2.com/tcpsum.htm" rel="nofollow">so</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151384</guid><dc:creator><![CDATA[hellihjb]]></dc:creator><pubDate>Sun, 08 Oct 2006 11:33:36 GMT</pubDate></item></channel></rss>