Check for Trojans

This tip was submitted to the SearchWin2000.com tip exchange by member Tim Fenner. Please let other users know how useful it is by rating it below.

This tip will show you how to scan your system for Trojans using the built-in netstat utility.

First, go to this site and get a copy of the most commonly used ports used by Trojans.

Next, start netstat and see if any of those ports are open: netstat -a.

You can run netstat from the command prompt or the run box along with a series of arguements as follows:

-a -- Displays all connections and listening ports.
-e -- Displays Ethernet Statistics. This may be combined with the -s option.
-n -- Displays addresses and port numbers in numerical form.
-p proto -- Shows connections for the protocol specified by proto; proto may be TCP or UDP. If used with the -s option to display per-protocol statistics, proto may be TCP, UDP, or IP.
-r -- Displays the routing table.
-s -- Displays per-protocol statistics. By default, statistics are shown for TCP, UDP and IP; the -p option may be used to specify a subset of the default.
interval -- Redisplays selected statistics, pausing interval seconds between each display. Press Ctrl+C to stop redisplaying statistics. If omitted, Netstat will print the current configuration information once.

Now, don't freak out right away if one of the Trojan ports are open on your system. You may have an open application using that port for legitimate reasons. You can cross-check this site to see what ports are commonly used and by what.

Netstat generates a lot of text, sometimes too much to see in a single command window. Type: 'netstat -an >c:windowsdesktoplog.txt' or whatever directory you wish. Netstat will create a text based file insert the results into it. This is handy because you can use your text editing program to "Find" or "Search" for the port numbers in the document.

Finally, you can use this Web site to perform a free probe of your ports to see what is exposed to the public Internet.

This was first published in July 2003

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.