Introduction To Networking | Services

Introduction to Services

Its another Monday and I am feeling moody. So instead of something that require me to think , such as programming , I am going to talk about something I am more familiar with , networking in general and services. If you have read the About Me , I am also a CCNA.

So what can I say about networking that has not been said a thousand times? Maybe something that is interesting. Ports. Of course , we all know what are ports. Don’t you? If were to go to this location on your Windows machine ,

C:WindowsSystem32driversetc

and open up the file called “services“. No extension , use notepad to open the file.

or on Linux do this,

cat /etc/services

and you shall see both files have the same information , for most parts. They both should look like this ,

echo                7/tcp
echo                7/udp
discard             9/tcp    sink null
discard             9/udp    sink null
systat             11/tcp    users                  #Active users
systat             11/udp    users                  #Active users
daytime            13/tcp
daytime            13/udp
qotd               17/tcp    quote                  #Quote of the day
qotd               17/udp    quote                  #Quote of the day
chargen            19/tcp    ttytst source          #Character generator
chargen            19/udp    ttytst source          #Character generator
ftp-data           20/tcp                           #FTP, data
ftp                21/tcp                           #FTP. control
ssh                22/tcp                           #SSH Remote Login Protocol
telnet             23/tcp
smtp               25/tcp    mail                   #Simple Mail Transfer Protocol
time               37/tcp    timserver
time               37/udp    timserver
rlp                39/udp    resource               #Resource Location Protocol
nameserver         42/tcp    name                   #Host Name Server
nameserver         42/udp    name                   #Host Name Server
nicname            43/tcp    whois
domain             53/tcp                           #Domain Name Server
domain             53/udp                           #Domain Name Server
bootps             67/udp    dhcps                  #Bootstrap Protocol Server
bootpc             68/udp    dhcpc                  #Bootstrap Protocol Client
tftp               69/udp                           #Trivial File Transfer
gopher             70/tcp
finger             79/tcp
http               80/tcp    www www-http           #World Wide Web

Of course , there will be Windows services not available in Linux and so on but you will also find common ports such as http , ftp , smtp , telnet , ssh , domain , finger and so on.

telnet and finger services should be disabled on your machine , whether be it Linux or Windows. Here is why.

[root@plato ~]# finger root
Login: root                             Name: root
Directory: /root                        Shell: /bin/bash
On since Sun Sep  4 23:52 (EDT) on pts/0 from [IP-ADDRESS]
No mail.
No Plan.

Take a look at the information about root from a finger command. Btw , the IP address is a real ip address and I have edited to make sure you can’t see it. Of course there are a lot of information missing from it , such as my email , what kind of plans and so on. Any one of them could be used to plan an attack on the server. For example , you could check when was the last time I have logged in for a few days and figure out that I may be on leave.

As for telnet ,it is simply because it is insecure and there is a much better protocol available , ssh @ port 22. And interestingly enough , one of the first tasks that you should do as an admin is to change the default ports for some of the common programs. For example , ssh , it should never be on port 22. Because it is very common and so widely known that it is mist likely to be one of the first place start attacking. By changing its port , the hacker or cracker , would have have a much harder time.

Conclusion to Services

Hope this is a great help to you. Cya!

A Tribute To Linux | minix

From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroups: comp.os.minix
Subject: What would you like to see most in minix?
Summary: small poll for my new operating system
Message-ID:
Date: 25 Aug 91 20:57:08 GMT
Organization: University of Helsinki

Hello everybody out there using minix -

I’m doing a (free) operating system (just a hobby, won’t be big and
professional like gnu) for 386(486) AT clones. This has been brewing
since april, and is starting to get ready. I’d like any feedback on
things people like/dislike in minix, as my OS resembles it somewhat
(same physical layout of the file-system (due to practical reasons)
among other things).

I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work.
This implies that I’ll get something practical within a few months, and
I’d like to know what features most people would want. Any suggestions
are welcome, but I won’t promise I’ll implement them :-)

Linus (torvalds@kruuna.helsinki.fi)

PS. Yes – it’s free of any minix code, and it has a multi-threaded fs.
It is NOT protable (uses 386 task switching etc), and it probably never
will support anything other than AT-harddisks, as that’s all I have :-( .

Unzipping .rar Files In Linux

Alrighty , we all know to unzip or to unrar a .rar file in Windows , we use winrar but what about in Linux? There is a program called ‘unrar’ in Linux that does exactly that.

To install it , depends on which distro are you on.

If you are on RPM-based distros , such as Fedora or RHEL ,

yum install unrar

If you are on Debian-based distros , such as Debian and Ubuntu ,

yum install unrar

Of course , in Ubuntu , you will be doing

sudo yum install unrar

So how do you use it? I am very tempted to say RTFM but its not my style. So here are some of the useful unrar commands you would be using.

To unrar or to unpack a .rar file ,

unrar e file-name.rar

Pls note that the option/flag ‘e’ does NOT have a dash in front unlike most other Linux commands. If you were to type ‘unrar -e’ , it won’t work. In contrast , tar will accept both. If you type ‘tar -zxvf’ or ‘tar zxvf’ , it doesn’t matter.

To list the files in the .rar file ,

unrar l file-name.rar

To unpack the files in full path ,

unrar x file-name.rar

As usual , pls check out the man page for the unrar by using ‘man unrar’ for more information. Have fun!

Manipulating files in *nix

Lets say you want to unzip/unrar/delete/rename files with a particular extension in Linux/Unix shells. It is tempting to try using


[root@sqlhack.net ~]#unzip *.zip

but you are bound to get an error. There are a couple of ways to do it.

Here is one way to do it.


[root@sqlhack.net ~]#for z in *.zip;do unzip $z;done

What I have just done is to go through all the files ending with .zip and unzip each file individually instead of doing it manually. Of course this could be extended to other tasks. Hope it helps!

Setting up this SQLHack.net.

Lets talk briefly about how SQLHack.net was installed and then configured. SQLHack.net is running on linux , fedora 15 , latest fedora as of the time. Here are the installed apps…

  1. Apache
  2. Mysql
  3. Dovecot
  4. Squirrelmail
  5. Courier-imap
  6. Bind
  7. Phpmyadmin

Here are some of the installation guides used…

Here are a few general things to consider when looking at those articles

  1. Don’t mix them! If you are following one guide , follow it to the end. Don’t jump to another guide in the middle of the configuration.
  2. Read entirely before starting. ( Personally , I just start typing the commands but I always ended up with problems later. )
  3. Don’t be afraid to ask. Keep in mind of your own configuration when you are asking for help. It will make things easier for you and also for the people helping you.
  4. Test along the way. Don’t do all in one chunk.
  5. Be patient. Things will screw up. You are not the only one.
  6. Finally , good luck!