<?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[portscanner funktioniert nicht]]></title><description><![CDATA[<p>Hi Leute<br />
ich hab ein bischen in Google nach quellcodes für portscanner gesuchtund auch was gefunden:</p>
<pre><code>/*--------------------
| if your using dev-c++
| you need to link
| -lws2_32
| to your application
---------------------*/

#include &lt;winsock2.h&gt;
#include &lt;iostream&gt;
using namespace std;

char IP[20];
int start, end, temp, err, nret;
SOCKET sock;
SOCKADDR_IN Info;
WSADATA wsadata;

int main()
{
   err = WSAStartup(MAKEWORD(2, 2), &amp;wsadata);
   if(err != 0)
   {
      cout &lt;&lt; &quot;Error with winsock. Will Now Exit.&quot; &lt;&lt; endl;
      cin.get();
      return 0;
   }

   cout &lt;&lt; &quot;Target IP: &quot;;
   cin&gt;&gt;IP;
   cout &lt;&lt; &quot;Starting Port: &quot;;
   cin&gt;&gt;start;
   cout &lt;&lt; &quot;End Port: &quot;;
   cin&gt;&gt;end;

   cin.ignore();

   cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; &quot;Starting Scan...&quot; &lt;&lt; endl &lt;&lt; endl;

   temp = start;
   while(temp &lt; end)
   {
      sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

      Info.sin_family = AF_INET;
      Info.sin_port = htons(start);
      nret = connect(sock, NULL, NULL);
      if(nret != SOCKET_ERROR)
      {
         cout &lt;&lt; &quot;Port &quot; &lt;&lt; temp &lt;&lt; &quot; - OPEN! &quot; &lt;&lt; endl;
      }
      temp++;
      closesocket(sock);
    }
    cout &lt;&lt; endl &lt;&lt; &quot;Finished With Scan...&quot; &lt;&lt; endl;

    cin.get();
    return 0;
}
</code></pre>
<p>(<a href="http://www.rohitab.com/discuss/lofiversion/index.php/t26652.html" rel="nofollow">http://www.rohitab.com/discuss/lofiversion/index.php/t26652.html</a>)<br />
bei mir gehts auch ohne lws2_32 zu linken...<br />
naja auf jeden fall hab ich denn code dan compiliert und ausgeführt... ich hab aber keine offenen Ports gefunden! obwohl ich wenn ich mit einem fertigen portscanner (Local port scanner) mehrere offene Ports finde...<br />
Eingaben hab ich folgende gemacht<br />
Target IP: 127.000.000.001<br />
Starting Port: 0<br />
End Port: 1000</p>
<p>Liegt das an dem Programm oder an was?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/218694/portscanner-funktioniert-nicht</link><generator>RSS for Node</generator><lastBuildDate>Thu, 08 Oct 2026 18:24:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/218694.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Jul 2008 19:03:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to portscanner funktioniert nicht on Wed, 23 Jul 2008 19:03:12 GMT]]></title><description><![CDATA[<p>Hi Leute<br />
ich hab ein bischen in Google nach quellcodes für portscanner gesuchtund auch was gefunden:</p>
<pre><code>/*--------------------
| if your using dev-c++
| you need to link
| -lws2_32
| to your application
---------------------*/

#include &lt;winsock2.h&gt;
#include &lt;iostream&gt;
using namespace std;

char IP[20];
int start, end, temp, err, nret;
SOCKET sock;
SOCKADDR_IN Info;
WSADATA wsadata;

int main()
{
   err = WSAStartup(MAKEWORD(2, 2), &amp;wsadata);
   if(err != 0)
   {
      cout &lt;&lt; &quot;Error with winsock. Will Now Exit.&quot; &lt;&lt; endl;
      cin.get();
      return 0;
   }

   cout &lt;&lt; &quot;Target IP: &quot;;
   cin&gt;&gt;IP;
   cout &lt;&lt; &quot;Starting Port: &quot;;
   cin&gt;&gt;start;
   cout &lt;&lt; &quot;End Port: &quot;;
   cin&gt;&gt;end;

   cin.ignore();

   cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; &quot;Starting Scan...&quot; &lt;&lt; endl &lt;&lt; endl;

   temp = start;
   while(temp &lt; end)
   {
      sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

      Info.sin_family = AF_INET;
      Info.sin_port = htons(start);
      nret = connect(sock, NULL, NULL);
      if(nret != SOCKET_ERROR)
      {
         cout &lt;&lt; &quot;Port &quot; &lt;&lt; temp &lt;&lt; &quot; - OPEN! &quot; &lt;&lt; endl;
      }
      temp++;
      closesocket(sock);
    }
    cout &lt;&lt; endl &lt;&lt; &quot;Finished With Scan...&quot; &lt;&lt; endl;

    cin.get();
    return 0;
}
</code></pre>
<p>(<a href="http://www.rohitab.com/discuss/lofiversion/index.php/t26652.html" rel="nofollow">http://www.rohitab.com/discuss/lofiversion/index.php/t26652.html</a>)<br />
bei mir gehts auch ohne lws2_32 zu linken...<br />
naja auf jeden fall hab ich denn code dan compiliert und ausgeführt... ich hab aber keine offenen Ports gefunden! obwohl ich wenn ich mit einem fertigen portscanner (Local port scanner) mehrere offene Ports finde...<br />
Eingaben hab ich folgende gemacht<br />
Target IP: 127.000.000.001<br />
Starting Port: 0<br />
End Port: 1000</p>
<p>Liegt das an dem Programm oder an was?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552624</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552624</guid><dc:creator><![CDATA[fragende]]></dc:creator><pubDate>Wed, 23 Jul 2008 19:03:12 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Wed, 23 Jul 2008 19:34:08 GMT]]></title><description><![CDATA[<p>Dein Aufruf der connect-Funktion ist totale Grütze. Du musst neben dem Socket der Funktion auch noch die Adresse deiner Structur, hier &quot;Info&quot;, und dessen größe übergeben. Also muss das wie folgt aussehen</p>
<pre><code class="language-cpp">nret = connect(sock, (struct sockaddr *) &amp;Info, sizeof(Info));
</code></pre>
<p>Dann klappt das auch mit dem Nachbarn <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="😉"
    /> Außerdem wird deine if-Abfrage</p>
<pre><code class="language-cpp">if(nret != SOCKET_ERROR)
</code></pre>
<p>nicht richtig ausgewertet. Wenn du statt &quot;SOCKET_ERROR&quot; &quot;0&quot; setzt läuft das ganze glatt.</p>
<p>EDIT:</p>
<blockquote>
<p>Target IP: 127.000.000.001</p>
</blockquote>
<p>Zudem weiß ich nicht, ob das wirklich gleichwertig mit 127.0.0.1 interpretiert wird. Ich bin was die Binärdarstellung da gerade nicht so fit. Also eher letzteres verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552632</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552632</guid><dc:creator><![CDATA[Berufspenner]]></dc:creator><pubDate>Wed, 23 Jul 2008 19:34:08 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Wed, 23 Jul 2008 19:38:02 GMT]]></title><description><![CDATA[<p>Die Ziel-Adresse sollte noch verwendet werden:</p>
<pre><code class="language-cpp">Info.sin_addr.s_addr = inet_addr(IP);
</code></pre>
<p>weiterhin wird immer der gleiche Port geprüft:</p>
<pre><code class="language-cpp">Info.sin_port = htons(start); // hier sollte temp statt start stehen
</code></pre>
<p>die while-Schleife könnte den letzten Port mit überprüfen:</p>
<pre><code class="language-cpp">while(temp &lt;= end)
{
...
}
</code></pre>
<p>und ein WSACleanup am Ende wäre auch nicht schlecht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552634</guid><dc:creator><![CDATA[Airdamn]]></dc:creator><pubDate>Wed, 23 Jul 2008 19:38:02 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Wed, 23 Jul 2008 19:59:03 GMT]]></title><description><![CDATA[<p>Berufspenner schrieb:</p>
<blockquote>
<p>Ich bin was die Binärdarstellung da gerade nicht so fit. Also eher letzteres verwenden.</p>
</blockquote>
<p>Dir ist schon klar, dass das eine IP-Adresse ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552646</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552646</guid><dc:creator><![CDATA[lol^^]]></dc:creator><pubDate>Wed, 23 Jul 2008 19:59:03 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Wed, 23 Jul 2008 20:14:10 GMT]]></title><description><![CDATA[<p>lol^^ schrieb:</p>
<blockquote>
<p>Berufspenner schrieb:</p>
<blockquote>
<p>Ich bin was die Binärdarstellung da gerade nicht so fit. Also eher letzteres verwenden.</p>
</blockquote>
<p>Dir ist schon klar, dass das eine IP-Adresse ist?</p>
</blockquote>
<p>Ich weiß gerade nicht, was du meinst. Erklärs mir bitte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552652</guid><dc:creator><![CDATA[Berufspenner]]></dc:creator><pubDate>Wed, 23 Jul 2008 20:14:10 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Thu, 24 Jul 2008 04:55:29 GMT]]></title><description><![CDATA[<p>der Berufspenner hat damit gemeint das er nich weis ober die IP in dem format 127.000.000.001 übergeben wird , auch als 172.0.0.1 interpretiert wird... der weis ganz sicher was ne IP is</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552735</guid><dc:creator><![CDATA[BorisDieKlinge]]></dc:creator><pubDate>Thu, 24 Jul 2008 04:55:29 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Thu, 24 Jul 2008 05:41:57 GMT]]></title><description><![CDATA[<p>...hat aber nix mit Binärdarstellung zu tun, da gibt es die Ziffern 2 und 7 nicht :p</p>
<p>Ein sehr ungeschickter IP-Adressen-Parser könnte die führende Null zum Anlass nehmen, die Zahlen oktal zu interpretieren, aber selbst das macht bei den Werten 0 und 1 keinen Unterschied.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552742</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552742</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Thu, 24 Jul 2008 05:41:57 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Thu, 24 Jul 2008 09:22:30 GMT]]></title><description><![CDATA[<p>BorisDieKlinge schrieb:</p>
<blockquote>
<p>der Berufspenner hat damit gemeint das er nich weis ober die IP in dem format 127.000.000.001 übergeben wird , auch als 172.0.0.1 interpretiert wird... der weis ganz sicher was ne IP is</p>
</blockquote>
<p>So siehts aus <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="😉"
    /> Danke, dass du das nocheinmal verdeutlicht hast <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>
<p>LordJaxom schrieb:</p>
<blockquote>
<p>...hat aber nix mit Binärdarstellung zu tun, da gibt es die Ziffern 2 und 7 nicht :p</p>
</blockquote>
<p>Hä? Wieso sollte es die Ziffern 2 und 7 in binärer Form nicht geben? Und ob das ganze was mit Binärzahlen zu tun hat. Intern werden die IP-Adressen als &quot;gepunktete Dezimalzahlen&quot; bzw. als Zeichenketten gehandhabt. Damit der Rechner damit überhaupt ordentlich arbeiten kann, wird diese Zeichenkette mit hilfe der Funktion</p>
<pre><code class="language-cpp">inet_addr()
</code></pre>
<p>in eine passende Binärform umgewandelt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552883</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552883</guid><dc:creator><![CDATA[Berufspenner]]></dc:creator><pubDate>Thu, 24 Jul 2008 09:22:30 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Thu, 24 Jul 2008 11:05:08 GMT]]></title><description><![CDATA[<p>Berufspenner schrieb:</p>
<blockquote>
<p>LordJaxom schrieb:</p>
<blockquote>
<p>...hat aber nix mit Binärdarstellung zu tun, da gibt es die Ziffern 2 und 7 nicht :p</p>
</blockquote>
<p>Hä? Wieso sollte es die Ziffern 2 und 7 in binärer Form nicht geben?</p>
</blockquote>
<p>Weil die binäre Darstellung nur die Ziffern 0 und 1 kennt. Die <strong>Zahlen</strong> 2 und 7 gibt es natürlich in binärer Darstellung. &lt;/haarespalt&gt;</p>
<blockquote>
<p>Und ob das ganze was mit Binärzahlen zu tun hat. Intern werden die IP-Adressen als &quot;gepunktete Dezimalzahlen&quot; bzw. als Zeichenketten gehandhabt.<br />
Damit der Rechner damit überhaupt ordentlich arbeiten kann, wird diese Zeichenkette mit hilfe der Funktion</p>
<pre><code class="language-cpp">inet_addr()
</code></pre>
<p>in eine passende Binärform umgewandelt.</p>
</blockquote>
<p>Das sagt aber nun garnichts darüber aus, was es mit der Binärdarstellung zu tun hat, ob &quot;127.000.000.001&quot; und &quot;127.0.0.1&quot; unterschiedlich interpretiert werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1552952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1552952</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Thu, 24 Jul 2008 11:05:08 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Thu, 24 Jul 2008 13:52:34 GMT]]></title><description><![CDATA[<p>lol laut dem ding sind bei mir alles ports offen xD</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1553054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1553054</guid><dc:creator><![CDATA[lollol]]></dc:creator><pubDate>Thu, 24 Jul 2008 13:52:34 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Thu, 24 Jul 2008 14:59:36 GMT]]></title><description><![CDATA[<p>Moin.<br />
000 und 0 sind in binärdarstellung definitv das selbe.<br />
Es ist wohl eher die Frage gestellt ob inet_addr() das richtig convertiert.<br />
Meines wissens ja.</p>
<p>Die Zahlen 2 und 7 gibt es nicht in der binärdarstellung. Dessen Wertigkeit ausm Decimalsystem aber schon. <a href="http://de.wikipedia.org/wiki/Stellenwertsystem" rel="nofollow">Schauste hier.</a></p>
<p>grüüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1553095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1553095</guid><dc:creator><![CDATA[zeusosc]]></dc:creator><pubDate>Thu, 24 Jul 2008 14:59:36 GMT</pubDate></item><item><title><![CDATA[Reply to portscanner funktioniert nicht on Fri, 25 Jul 2008 20:24:27 GMT]]></title><description><![CDATA[<p>OK super jetzt funktionierts</p>
<p>@lollol<br />
'lol laut dem ding sind bei mir alles ports offen xD'</p>
<p>man muss noch folgende if schleife ändern:</p>
<pre><code>if(nret == 0)   // zuvor war hier !=
      {
         cout &lt;&lt; &quot;Port &quot; &lt;&lt; temp &lt;&lt; &quot; - OPEN! &quot; &lt;&lt; endl;
      }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1553800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1553800</guid><dc:creator><![CDATA[fragende]]></dc:creator><pubDate>Fri, 25 Jul 2008 20:24:27 GMT</pubDate></item></channel></rss>