Configurable testing server

Configurable testing server

Post by jpruden » Wed, 18 May 2011 17:32:32



Hi!

I'm teaching firewalls on Linux.

I'm looking for a program that can take two arguments:
--port portnumber [listening port number]
--tcp or --udp [choose the protocol]

Several instances can be running on different port.
Clients can connect through telnet and the server is echoing telnet
input.

This program is aimed for students. They can add some iptables rules
on machine and test if they still can access their servers from
outside world.

Yes, I'm too lazy to write one myself.

Thanks!

 
 
 

Configurable testing server

Post by Jorgen Grah » Wed, 18 May 2011 17:58:25



> Hi!

> I'm teaching firewalls on Linux.

> I'm looking for a program that can take two arguments:
> --port portnumber [listening port number]
> --tcp or --udp [choose the protocol]

> Several instances can be running on different port.
> Clients can connect through telnet and the server is echoing telnet
> input.

> This program is aimed for students. They can add some iptables rules
> on machine and test if they still can access their servers from
> outside world.

> Yes, I'm too lazy to write one myself.

- netcat, aka 'nc'

- the tcp 'echo' service provided by inetd; you can probably
  configure it to listen on any number of ports and not just
  the standard echo port (port 7, IIRC)

/Jorgen

--

\X/     snipabacken.se>   O  o   .

 
 
 

Configurable testing server

Post by pk » Wed, 18 May 2011 18:12:12



> Hi!

> I'm teaching firewalls on Linux.

> I'm looking for a program that can take two arguments:
> --port portnumber [listening port number]
> --tcp or --udp [choose the protocol]

> Several instances can be running on different port.
> Clients can connect through telnet and the server is echoing telnet
> input.

> This program is aimed for students. They can add some iptables rules
> on machine and test if they still can access their servers from
> outside world.

> Yes, I'm too lazy to write one myself.

I suppose something like

socat 'TCP-LISTEN:1234' 'EXEC:cat'

suitably wrapped to parametrize the protocol and port, would get you close.

 
 
 

Configurable testing server

Post by jpruden » Wed, 18 May 2011 19:30:09




> > Hi!

> > I'm teaching firewalls on Linux.

> > I'm looking for a program that can take two arguments:
> > --port portnumber [listening port number]
> > --tcp or --udp [choose the protocol]

> > Several instances can be running on different port.
> > Clients can connect through telnet and the server is echoing telnet
> > input.

> > This program is aimed for students. They can add some iptables rules
> > on machine and test if they still can access their servers from
> > outside world.

> > Yes, I'm too lazy to write one myself.

> I suppose something like

> socat 'TCP-LISTEN:1234' 'EXEC:cat'

> suitably wrapped to parametrize the protocol and port, would get you close.

Great! netcat is exactly what I needed.
socat seems more complete (i just had a glance on doc)

Thanks!