<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: TCP Socket connection checking. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624151#M39348</link>
    <description>You can either finish your C program, or use something like nmap in a script:&lt;BR /&gt;&lt;BR /&gt;"A utility for port scanning large networks. It works fine for single hosts. It incorporates virtually every scanning technique, but specifically it supports TCP connect scanning, TCP SYN and FIN (stealth), bounce attack scanning, ICMP and ping scanning and yet more ... "&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/nmap-2.53/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/nmap-2.53/&lt;/A&gt;</description>
    <pubDate>Mon, 03 Dec 2001 18:30:55 GMT</pubDate>
    <dc:creator>Christopher Caldwell</dc:creator>
    <dc:date>2001-12-03T18:30:55Z</dc:date>
    <item>
      <title>TCP Socket connection checking.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624150#M39347</link>
      <description>Dear all,&lt;BR /&gt;&lt;BR /&gt;Does anyone know of a reliable and preferably easy method of checking port status from within a script. I know this can be done from telneting to a port, although automating it from a script seems to produce mixed results.&lt;BR /&gt;&lt;BR /&gt;I've routed out some C code that sounds like it would do the trick perfectly, although it doesn't want to compile and I could write all I know about C on the back of a postage stamp.&lt;BR /&gt;&lt;BR /&gt;Any pointers, tips suggestions warmly received (as ever!!)&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;-ChaZ-&lt;BR /&gt;&lt;BR /&gt; #include &lt;STRING.H&gt;                                                            &lt;BR /&gt;     #include &lt;SYS&gt;                                                     &lt;BR /&gt;     #include &lt;SYS&gt;                                                    &lt;BR /&gt;     #include &lt;NETINET&gt;                                                    &lt;BR /&gt;                                                                                &lt;BR /&gt;     #define DEST_IP   "1.1.1.1" // changed IP                                          &lt;BR /&gt;     #define DEST_PORT 1022                                                     &lt;BR /&gt;                                                                                &lt;BR /&gt;     int main()                                                                 &lt;BR /&gt;     {                                                                          &lt;BR /&gt;         int sockfd;                                                            &lt;BR /&gt;         struct sockaddr_in dest_addr;   // will hold the destination addr      &lt;BR /&gt;                                                                                &lt;BR /&gt;         sockfd = socket(AF_INET, SOCK_STREAM, 0); // do some error checking!   &lt;BR /&gt;                                                                                &lt;BR /&gt;         dest_addr.sin_family = AF_INET;          // host byte order            &lt;BR /&gt;         dest_addr.sin_port = htons(DEST_PORT);   // short, network byte order  &lt;BR /&gt;         dest_addr.sin_addr.s_addr = inet_addr(DEST_IP);                        &lt;BR /&gt;         memset(&amp;amp;(dest_addr.sin_zero), '\0', 8);  // zero the rest of the struct&lt;BR /&gt;                                                                                &lt;BR /&gt;         // don't forget to error check the connect()!                          &lt;BR /&gt;         connect(sockfd, (struct sockaddr *)&amp;amp;dest_addr, sizeof(struct sockaddr));&lt;BR /&gt;}                                                                               &lt;BR /&gt;&lt;/NETINET&gt;&lt;/SYS&gt;&lt;/SYS&gt;&lt;/STRING.H&gt;</description>
      <pubDate>Mon, 03 Dec 2001 17:39:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624150#M39347</guid>
      <dc:creator>Charles Harris</dc:creator>
      <dc:date>2001-12-03T17:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: TCP Socket connection checking.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624151#M39348</link>
      <description>You can either finish your C program, or use something like nmap in a script:&lt;BR /&gt;&lt;BR /&gt;"A utility for port scanning large networks. It works fine for single hosts. It incorporates virtually every scanning technique, but specifically it supports TCP connect scanning, TCP SYN and FIN (stealth), bounce attack scanning, ICMP and ping scanning and yet more ... "&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/nmap-2.53/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/nmap-2.53/&lt;/A&gt;</description>
      <pubDate>Mon, 03 Dec 2001 18:30:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624151#M39348</guid>
      <dc:creator>Christopher Caldwell</dc:creator>
      <dc:date>2001-12-03T18:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: TCP Socket connection checking.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624152#M39349</link>
      <description>Another really easy way to check is as follows:&lt;BR /&gt;&lt;BR /&gt;echo "^]close" | telnet IP.ADD.OF.HOST PORT&lt;BR /&gt;status=$?&lt;BR /&gt;&lt;BR /&gt;#status = 0 means host is listening on TCP port PORT&lt;BR /&gt;#status = 1 means host port is closed on that host.&lt;BR /&gt;&lt;BR /&gt;by the way, in order to generate the telnet escape character, you have to use:&lt;BR /&gt;ctrl+v followed by ctrl+]&lt;BR /&gt;it is not visible on a command line but in vi it will show as an ^]&lt;BR /&gt;&lt;BR /&gt;good luck.&lt;BR /&gt;BTW I am assuming that the status checking you want done is to determine wheather or not it is listening on the port right?  this does not necessarily mean that the daemon is DOING what it is supposed to.</description>
      <pubDate>Mon, 03 Dec 2001 18:56:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624152#M39349</guid>
      <dc:creator>Kofi ARTHIABAH</dc:creator>
      <dc:date>2001-12-03T18:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: TCP Socket connection checking.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624153#M39350</link>
      <description>Thanks for the nice port scan on a line Kofi!!! - Perfect, exactly what I was after!!!&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-ChaZ-&lt;BR /&gt;&lt;BR /&gt;Ps. I'm well versed in the art of NMAP, although our network boys and security auditors aren't keen on having the app freely availible on our production servers!!! - Thanks all the same!!&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Dec 2001 20:15:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624153#M39350</guid>
      <dc:creator>Charles Harris</dc:creator>
      <dc:date>2001-12-03T20:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: TCP Socket connection checking.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624154#M39351</link>
      <description>I know points have been assigned, but thought I would through my two cents in.&lt;BR /&gt;&lt;BR /&gt;Socket connections can be determined by running netstat -an, it will show udp and tcp information as well. This may be a suitable option for some to telneting to a port, plus you can check udp traffic.&lt;BR /&gt;&lt;BR /&gt;C</description>
      <pubDate>Mon, 03 Dec 2001 23:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624154#M39351</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-12-03T23:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: TCP Socket connection checking.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624155#M39352</link>
      <description>I thought you didn't want to telnet to the port :-(.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 03 Dec 2001 23:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624155#M39352</guid>
      <dc:creator>Christopher Caldwell</dc:creator>
      <dc:date>2001-12-03T23:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: TCP Socket connection checking.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624156#M39353</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;Thanks for the additional comments, Christopher, - sorry, I should have made my question clearer, I had no objection to telnet other than I didn't want to pipe seperate files into the command to get it to check the ports (bit messy) the GURU style ctrl key combo was exactly what I was after! - Thanks for your comments though!&lt;BR /&gt;&lt;BR /&gt;Craig, cheers, netstat -an is okay locally, but this was for a remote checking exercise, so the telnet option is a better bet. Again thanks for the support!!&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;-ChaZ-&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Dec 2001 16:14:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/tcp-socket-connection-checking/m-p/2624156#M39353</guid>
      <dc:creator>Charles Harris</dc:creator>
      <dc:date>2001-12-04T16:14:12Z</dc:date>
    </item>
  </channel>
</rss>

