Archive for November, 2007

h1

How to: Telnet server

November 24, 2007

Today i’ve done a telnet server in one of my computers… I’m conscious that telnet isn’t a safe way to access a server through, but i just wanted to learn something about this application , furthermore i did it into my LAN. Ok, lets go install it! (You must login as root user)

apt-get install telnetd netkit-inetd

Maybe, the system ask you to install “openbsd-inetd” or “inetutils-inetd, i chose the second and it works fine.

Before this, you should start the server

/usr/sbin/in.telnetd

Now the telnet server is running and you can access it through a telnet cliente like ssh in linux or PuTTy in Windows.

Here we’ve a screen capture of a Telnet login in Ethereal/Wireshark. 😉
ethereal_telnetjoin.jpg

Advertisements
h1

Redirecting a port to a local machine inside our network

November 22, 2007

If we want to redirect a port (Like the http port) to one of our network machine we should use this IPTables rule:

iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -j DNAT --to-destination 192.168.0.x

iptables -t nat -A POSTROUTING -p tcp -d 192.168.0.x --dport 80 -j SNAT --to-source 192.168.0.y

h1

Adding a UNIX user

November 22, 2007

useradd -c College_classmate -d /home/MyNewUser -u [user_ID] -g [Group] -p [Password] MyNewUser

See useradd –help for more information about “useradd” command.

h1

Searching files in Unix

November 20, 2007

A simple search

find [root_directory] [filename]

find / "*MyFile*"

Searching a application path

whereis [appname]

whereis ssh

Searching files by content in a directory

egrep -i "hello world" /home/[mydir]/*