views:

1110

answers:

8

I'm writing a tcp/ip client and I would need a "test server" to be able to test easily. It should listen on a configurable port, show me when a client connects and what the client sent, allow me to manually enter text to send to the client. It should work on Windows.

Normally I would have use the simple but powerfull nc.exe (alias "Netcat" available as well on Unix as on Windows) but the antivirus detects it as an "hacker tool" so that my system administrator doesn't want me to use it at work.

Does anyone use another tool to test socket connections and is happy with it?

+1  A: 

Try Wireshark or WebScarab second is better for interpolating data into the exchange (not sure Wireshark even can). Anyway, one of them should be able to help you out.

If his sysadmin is nagging him about netcat he's probably going to have fits about wireshark.
krosenvold
It doesn't seem to be exactly waht I'm looking for:WebScarac seems to be limited to HTTP.Wireshark seems to allow to capture the traffic but doesn't act as a test server, where I could input an answer for the client manually.
Name
I'm not sure but I think WebScarab has kind of grown bigger than it's orignal intended purpose. From how I've used it I think it could monitor any traffic sent through the port it's watching. Still all this stuff is a security concern.
+4  A: 

netcat (nc.exe) is the right tool. I have a feeling that any tool that does what you want it to do will have exactly the same problem with your antivirus software. Just flag this program as "OK" in your antivirus software (how you do this will depend on what type of antivirus software you use).

Of course you will also need to configure your sysadmin to accept that you're not trying to do anything illegal...

j_random_hacker
Well, netcat in bad hands could actually be used as an hacker tool, because you can easilly redirect the socket to a shell and use it as telnet server. If a tool would just display what it receives in a window, it couldn't be used so easilly as an hacker tool.
Name
Good point Name. You can remove this possibility by making sure that the only execute file permissions on nc.exe are for your Windows user. (I assume you are worried about an intruder compromising your machine, rather than your sysadmin worrying that YOU trying something sneaky!)
j_random_hacker
+1  A: 

I would go with netcat too , but since you can't use it , here is an alternative : netcat :). You can find netcat implemented in three languages ( python/ruby/perl ) . All you need to do is install the interpreters for the language you choose . Surely , that won't be viewed as a hacking tool .

Here are the links :

Perl implementation

Python implementation

Ruby Implementation

Geo
It would be quite ideal if it worked. I tested the 3 versions and got error messages with all. The perl version was at least partly usable. Could it be that those scripts were wrotten on Unix and have small difficulties on Windows?
Name
I'll try them and come back with a comment. Can you specify what were the arguments you ran the script with ?
Geo
One Server: -l -p 9988And one client: -c -r localhost -p 9988
Name
I tried to run the python script on linux , but it didn't work .
Geo
+4  A: 

Hercules is fantastic. It's a fully functioning tcp/udp client/server, amazing for debugging sockets. More details on the web site.

patros
Good tool! It actually does exactly what I need and is listed on big freeware-sites (like CNET) so that the sysadmin shouldn't see it as a problem. The only small issue is the need to publish a link on the software for professional use (see the licence), but it is quite fair.
Name
A: 

In situations like this, why not write your own? A simple server app to test connections can be done in a matter of minutes if you know what you're doing, and you can make it respond exactly how you need to, and for specific scenarios.

David Anderson
Because you then have a client + a server to debug instead of just a client! And why write a software to do something that other software can already do really good?
Name
Because you will learn something in the process.
Aaron Hinni
+1  A: 

I also found a tool called TCP/IP Test Server which seems to do what I need too. But I didn't try it because it is not listed on big freeware-sites (like CNET...) and no source code is published so that it won't reassure a paranoid sysadmin.

Name
A: 

Another tool is tcpmon. This is a java open-source tool to monitor a TCP connection. It's not directly a test server. It is placed in-between a client and a server but allow to see what is going through the "tube" and also to change what is going through.

Name
A: 

There is also a good tool to test SOAP Connections: soapui. But it isn't for general TCP connections.

Name