![]() ![]() Protocol. vbs - A Windows VBScript to test TCP Service Response. Today I’m going to introduce you to a handy script I made to provide a Transmission Control Protocol (TCP) . I distribute this to my server estate so I always have something to hand which can punch that little bit harder than telnet for my TCP port testing. If you are into service monitoring, it has uses here too. The script’s advanced mode allows you to test beyond a basic TCP port ping to perform a preliminary protocol test. In such cases, running this as a scheduled task can alert you to those any TCP services which might be running but actually no longer responding as anticipated. ![]() I have to say right now that I class this as an advanced tool. Using it beyond its most basic mode requires knowledge of TCP protocols. ![]() Further, its dependence on 3. WOW layer). Sections to this article are,1. Installing the Script. Protocol. vbs and OS architecture considerations. Protocol. vbs command- line Arguments. Basic Port Testing. Testing for Open Ports with Telnet. Testing for Open Ports With Protocol. More Advanced Service Testing. How to Tell if a Service is Running. This article tells how to diagnose and test Transmission Control Protocol/Internet Protocol (TCP/IP) or NetBIOS network configurations. NOTE: To see additional options of the Ping.exe tool, type ping /? Common TCP/IP Tools (with Demos) command prompt ipconfig ping Tracert The Windows command prompt is Microsoft’s version of a command-line interface or CLI. Enhanced Ping Tool Description - Ping a Target using ICMP, UDP or TCP Packets. Overview Purpose ICMP Ping UDP Ping. This tool brings TCP Ping to the Windows platform. TCP Ping uses either SYN or ACK packets to elicit a responding TCP packet The. Free Ping and Traceroute Tool Want to know if your servers are up and running? Try ManageEngine Free Ping Tool! Monitor the availability of servers, routers, switches, websites, mail servers and trace route server/host. Using this tool fetch Round trip time, packet. TCP/IP Builder is a windows socket testing tool. You will be able to build your socket by hand. Description: TCP/IP Builder is a Windows Socket testing tool. You will be able to create a socket manually, connect it (or listen for connections), send and.Good tool for testing socket connections? It should listen on a configurable port, show me when a client connects and what the client. TCP/IP Forum UDP Ping utility for windows thread581-1549395 Forum Search FAQs Links MVPs UDP Ping utility for windows UDP Ping utility for windows JayNEC (IS/IT--Management) (OP) 20 May 09 07:43 Does anyone know of a UDP ping utility for. This tool analyzes network traces of Transmission Control Protocol (TCP) connections. Given a Microsoft Network Monitor trace, the analyzer provides various performance statistics and visualizations for the captured TCP connection. Included are plots of the time-sequence graph, round-trip time. To test TCP/IP connections by using the ping and net view commands 1. To test TCP/IP connectivity by using the ping command, use the display of the ipconfig command to ensure that your network adapter is not in a. Using Protocol. vbs to Check IIS on a Notification Server. Using Protocol. vbs to Check the DB Manager Service on DS6. Identifying the TCP port of a Process. Using Wireshark to capture Traffic. Caveats and Further Thoughts. Performance Counters. Log Files and Event Logs. Workload Simulation. Installing the Script. Attached to this article you’ll find a zip archive holding the following files,Protocol. This vbscript performs the protocol tests. Protocol. vbs and OS architecture considerations. One of the drawbacks of using scripts rather than fully compiled code is that it introduces a complication on 6. On 6. 4- bit machines, we must therefore explicitly ensure that we take advantage of the Windows- On- Windows subsystem by either,Calling cscript. Sys. WOW6. 4\cmd. Calling 3. 2- bit cscript from the 6. Sys. WOW6. 4\cscript. If do by chance forget to call the script in a 3. I have ideas about how to work around this, or but that adds a complexity which is better left for a later version). In all the examples from this point on, cscript. If you are using a 6. Protocol. vbs command- line Arguments. In order to see what the script can do, let’s take a look at the command- line arguments it accepts. To view the argument options you can use either of the /? Or the /help switches. All rights reserved. Simple Protocol Testing script for TCP troubleshooting. Usage: /ip: < Remote IP> /port: < tcp port> /timeout: < seconds> (optional)/send: < string to send> (optional)/test: < response substring> (optional)/log: < Logfile> (optional)/debug (optional)/help or /? For the local machine, type 1. This is the TCP port number for the service under test. If we need to actually test a TCP port with a request and sample a response, we require two additional arguments,/send: < protocol string> This is the string which we want to send to the remote TCP port to test the protocol. In the case of an HTTP protocol test, it might be a GET command for a web page or file. Note that protocols may require special characters and to that end this string supports the following substring substitutions at runtime, *NULL* - the NULL character. Hexadecimal x. 0*CR* - a carriage return. Hexadecimal x. 0D*LF* - a line feed. Hexadecimal x. 0A*CRLF* - a carriage return followed by a line feed. Hexadecimal x. 0D0. A)/test: < substring> This string is used to test the response of the server to the request. In the case of an HTTP protocol request this could simply be an HTTP OK response, or a known string in the file being requested. The other optional arguments are,/timeout: < n> This is the timeout in seconds which the script should use when waiting for a response to the TCP handshake and/or protocol sent string. The default value is 3. Filename> If you specify a file without a folder path, the logfile will be created in the same folder as the script. Note that as these filenames will have a day string added to ensure logs are rotated./debug. This is simply a logfile- to- screen switch which exposes the internal steps the script executes for troubleshooting purposes. The return is of protocol. The number n is the script’s return code and the text after the colon is the human readable string for that return code. The possible return codes for protocol. Basic Port Testing. When troubleshooting TCP- based services, one of the most common tasks to perform is a TCP port ping. This is possible with telnet as it can be used to initiate TCP sessions on ports other than 2. TCP port number after the IP address. For example if we want to know if TCP port 4. SMB over TCP/IP) is open on a remote machine at IP 1. C: \> telnet 1. If the connection is successful, the command window will suddenly be cleared, leaving a flashing cursor to signify that the target machine is awaiting a command. At this point you can type a plain text protocol command (although they aren’t echoed) or simply exit out with CRTL+. Although this can be a bit cumbersome to use, it is ubiquitously available on the Windows platforms so is extraordinarily useful. Testing for Open Ports With Protocol. Let’s now try the equivalent test to the telnet function above by opening TCP port 4. The telnet replacement command is therefore going to look like,c: \bin> cscript /nologo protocol. Success. Here we can see the instant response that this TCP port ping met with 0: Success and thus we know that there is a client- server process attached on the target machine to that port. If however the TCP handcshake fails (perhaps the host has a firewall which blocks the connection), the script output would let us know as shown below,c: \bin> cscript /nologo protocol. No response. 5. More Advanced Service Testing. Advanced testing can be required in scenarios where a simple TCP port ping isn’t a sufficient test of a running service. This can become complex, as understanding whether a Windows service is running can often require more than seeing if a service executable is loaded into memory. What we sometimes need to know is whether the service is actually doing useful work. Let’s take a look at the common techniques employed for service monitoring and discuss the pros and cons before seeing how protocol. How to Tell if a Service is Running. In many instances, a quick TCP port ping coupled with the knowledge that the remote box has the service running is all that’s required to be confident all is well for consumers of your TCP service. The most common test which decides whether a service is running on a server (TCP service or not) is to check its status. You can use a WMI call using the Win. One problem however is the definition of . You see a Windows Service is really a program like any other; it’s susceptible to bugs and unintended consequences just like any other piece of code. It is therefore possible for services to fall into coding black- holes (from which there is no escape) and cul- de- sacs (where you might be able to do something to get the service turned around without restarting it). These geographical features in the coding landscape can render services powerless to perform useful work even though they are still technically . There doesn’t seem to be a unified framework for services whereby the Windows service manager can at some point later just ask services the question “Are you still alright?”. Here lays my core motivation for writing this protocol script. I wanted to test TCP ports at the service protocol level rather than just with a TCP handshake. A nicely documented example of how telnet can be used to troubleshoot a TCP server is Microsoft’s article “XFOR: Telnet to Port 2. Test SMTP Communication”. I recommend that all server administrators try this out to get a feel for not only how protocols are built, but also how we can . To manually test Microsoft’s Internet Information Services (IIS) on my Notification Server I simply fire up a webpage and ask for the root webpage. IIS will respond to this HTTP GET request by presenting me the . This can monitor the packets exchanged during my web browser’s session to the Altiris Server, and re- assemble the conversation as plain text. Below is a Wireshark capture of one such conversation. It shows the HTTP request as sent by the client (highlighted in red below) and the server response (highlighted in blue),GET / HTTP/1. Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x- shockwave- flash, application/x- ms- application, application/x- ms- xbap, application/vnd. Accept- Language: en- gb. User- Agent: Mozilla/4. MSIE 8. 0; Windows NT 5. Trident/4. 0; . NET CLR 1. NET CLR 2. 0. 5. 07. MS- RTC LM 8; . NET CLR 3. NET CLR 3. 5. 3. 07. NET4. 0. C; . NET4. E)Accept- Encoding: gzip, deflate. Host: altiris. it. Connection: Keep- Alive. Cookie: ASP. NET. With a bit of playing around it seems the request data critical to the exchange is this,GET / HTTP/1. Host: altiris. it. And, of course, the only text critical to us in the response is the HTTP OK message,HTTP/1. OKThis reduced exchange permits us to test the server using the protocol script. Here the sending string will be,GET / HTTP/1. CRLF*Host: altiris. CRLF**CRLF*. The process I generally go through is,Identify the process tcp port. Wireshark the TCP port to capture traffic. Isolate a new conversation and attempt to replicate with protocol. So, let’s proceed now to cover how I do this. Note that the phrase “there is more than one way to skin a cat” applies well here! First on the server I do a quick WMI command- line query so I can get the service information (I could just use the GUI, but that’s no fun). The following table is a prettied up version of what you see when you use WMIC to present the pathnames for all the services which begin with the string “Altiris”. The wildcard here is useful as it stops you having to remember exactly what the service is called. C: \> wmic service where .
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
September 2016
Categories |