Services and Security ● Find out what's listening to the net ● Find out what services are running ● Find out what they do ● Disable or remove any that.

Slides:



Advertisements
Similar presentations
For Removal Info: visit
Advertisements

System Hardening Borrowed from the CLICS group. System Hardening How do we respond to problems? (e.g. operating system deadlock) Detect Detect (Detect.
Securing Network using Linux. Lesson Outline Setting up a secure system TCP Wrapper configuration Firewalls in Linux Authentication Systems –NIS –Kerberos.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Chapter 3 Unix Overview. Figure 3.1 Unix file system.
1 Network File System. 2 Network Services A Linux system starts some services at boot time and allow other services to be started up when necessary. These.
1.  The Linux system of permissions is much more difficult than that of Windows  System administrators are given more control with the use of three.
Linux Operations and Administration
1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise.
Microsoft Internet Information Services 5.0 (IIS) By: Edik Magardomyan Fozi Abdurhman Bassem Albaiady Vince Serobyan.
Network Services CSCI N321 – System and Network Administration Copyright © 2000, 2007 by Scott Orr and the Trustees of Indiana University.
Secure Shell for Computer Science Nick Czebiniak Sung-Ho Maeung.
Shell Protocols Elly Bornstein Hiral Patel Pranav Patel Priyank Desai Swar Shah.
ITI-481: Unix Administration Meeting 3. Today’s Agenda Hands-on exercises with booting and software installation. Account Management Basic Network Configuration.
Inetd...Server of Servers Looks at a number of ports Determines when a service is needed on any of those ports Calls the appropriate server Restarts new.
Postfix Mail Server Postfix is used frequently and handle thousands of messages. compatible with sendmail at command level. high performance program easier-
Linux Services Muhammad Amer. 2 xinetd Programs  In computer networking, xinetd, the eXtended InterNET Daemon, is an open-source super-server daemon.
Linux Networking Security Sunil Manhapra & Ling Wang Project Report for CS691X July 15, 1998.
Berkeley R Utilities & the new S Utilities The Unix (or Berkeley) r utilities provide an alternative to IP facilities telnet and ftp. Three programs: rlogin.
Other useful commands netstat ps tail kill. netstat Print network connections, routing tables, interface statistics, masquerade connections, and multicast.
Linux Security. Module 13 – Linux Security ♦ Overview Linux is more prone today to security loopholes and attacks, both inside and outside the network.
Core System Services. INIT Daemon The init process is the patron of all processes. first process that gets started in any Linux/ UNIX -based system.
Linux Overview Why Linux ? Not-so-ancient history –Torvalds, Linus Torvalds, 002 the Helsinki University, as a student, low budget, work home –rapid and.
ORAFACT The Secure Shell. ORAFACT Secure Shell Replaces unencrypted utilities rlogin and telnet rsh rcp Automates X11 authentication Supports tunneling.
Internet Services.  Basically, an Internet Service can be defined as any service that can be accessed through TCP/IP based networks, whether an internal.
Phil Hurvitz Securing UNIX Servers with the Secure.
Linux services troubleshooting. If you cannot connect to your service.. When you start service, check that it says ok (most services say that when starting.
Linux Services Configuration
Daemons Ying Zhang CMSC691X, Summer02. Outline  Introduction  Init and Cron  System daemons  Print daemons and NFS daemons  Time synchronization.
Unix network Services. Configuring a network interface In Unix there are essentially two commands that are used to enable TCP/IP. ifconfig route.
Protocols Monil Adhikari. Agenda Introduction Port Numbers Non Secure Protocols FTP HTTP Telnet POP3, SMTP Secure Protocols HTTPS.
1 Tips for the assignment. 2 Socket: a door between application process and end- end-transport protocol (UDP or TCP) TCP service: reliable transfer of.
Linux Operations and Administration Chapter Twelve Configuring a Mail Server.
Sys Admin Course Service Management Fourie Joubert.
Windows Server 2003 { First Steps and Administration} Benedikt Riedel MCSE + Messaging
Secure Communications ● Cleartext vs. encryption and encapsulation ● Protocols not to use ● SSH – scp/ftp – SSH tunnelling ● VPN.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
Secure services Unit-IV CHAP-1
Chap-I Network and System Configuration in Linux
Development Environment
Introduction to Operating Systems
Review End of Semester.
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer
Chapter 5 Linux Services
Two FTP connections from different hosts
LINUX ADMINISTRATION
FTP Lecture supp.
Programming Assignment #1
Onno W. Purbo Cracking Techniques Onno W. Purbo
LINUX ADMINISTRATION 1
Network Load Balancing
DHCP server & Client Objectives Contents
SUBMITTED BY: NAIMISHYA ATRI(7TH SEM) IT BRANCH
Web Server Administration
Client-Server Interaction
Network Services CSCI N321 – System and Network Administration
DHCP, DNS, Client Connection, Assignment 1 1.3
The Internet and HTTP and DNS Examples
Application layer Lecture 7.
Single Sign-on with Kerberos
CGS 3763 Operating Systems Concepts Spring 2013
Network Services.
COP 4343 Unix System Administration
Remote Computing Services Cloud connection Distributed system
Daemons & inetd Refs: Chapter 12.
First Level Incident Handling FAQ (For EAL)
MePS Manual Login Screen
Exceptions and networking
Presentation transcript:

Services and Security ● Find out what's listening to the net ● Find out what services are running ● Find out what they do ● Disable or remove any that you don't need ● References

What's Listening? ● As root, do netstat -tap > listening.services less listening.services Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 localhost.localdom:pop3 *:* LISTEN 708/xinetd tcp 0 0 *:x11 *:* LISTEN 1093/X tcp 0 0 *:ssh *:* LISTEN 696/sshd tcp 0 0 localhost.localdom:smtp *:* LISTEN 841/master tcp 0 0 localhos:x11-ssh-offset *:* LISTEN 3866/sshd tcp 0 0 du aitlabs.i:ssh mommy.ait.iastate:37882 ESTABLISHED 3864/sshd

How are services started? ● From scripts referenced in /etc/rc.d/rcN.d (or, in other distros, from /etc/rcN.d) ● From xinetd (or, in older distros, from inetd) – Xinetd monitors incoming network communications and launches the appropriate processes to handle them

What Services are Running? ● /sbin/chkconfig --list afs 0:off 1:off 2:off 3:on 4:off 5:on 6:off irqbalance 0:off 1:off 2:off 3:off 4:off 5:off 6:off diskacct 0:off 1:off 2:on 3:on 4:on 5:on 6:off smartd 0:off 1:off 2:off 3:off 4:off 5:off 6:off load 0:off 1:off 2:on 3:on 4:on 5:on 6:off xinetd based services: chargen-udp: off chargen: off daytime-udp: off daytime: on – The numbers refer to runlevels; the services below are started by xinetd ● Try /sbin/chkconfig --list | grep on

Without Chkconfig... ● Chkconfig is a Red Hat utility and may not be available in other distros (particularly Debian), even if they use System-V type init scripts ● Look in /etc/rc.d/rcN.d (or /etc/rcN.d in other distros) for scripts beginning with SNNservicename ● If you have to do this more than a couple of times...you'll go get the source for chkconfig. It will work under other SysV distros.

What are these services? ● The easy way to identify a service – if it has the information – is to use one of the "graphical" service management tools. – system-config-services – ntsysv ● If that doesn't work, or isn't available, then you use the fundamentals...

Using system-config-services ● Installed services are listed in the left- hand column ● Those set to run in the current runlevel are checked ● Highlight a service for a description and its current status

Using ntsysv ● /usr/sbin/ntsysv acts like system-config-services at a text console ● Use {Tab} and arrows to move cursor, {Space} to click, {F1} to see description, {Esc} to return to list

What if they can't tell me? ● Try man servicename ● Try whatis servicename ● Find and identify the executable – For ordinary services, look at the script "/etc/rc.d/init.d/servicename" – For xinetd services, look at config file "/etc/xinetd.d/servicename"

/etc/rc.d/init.d/atd start() { # Check if atd is already running if [ ! -f /var/lock/subsys/atd ]; then echo -n $"Starting $prog: " daemon /usr/sbin/atd RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/atd echo fi return $RETVAL } ● Look for the "start" section

/etc/xinetd.d/fisa-kpoprelay ● Look for the "server =" line service pop3 { disable = no id = fisa-kpoprelay socket_type = stream wait = no user = root server = /usr/sbin/kpoprelay server_args = -l only_from = /8 bind = }

What is this executable? ● Try rpm -qf filename – Identifies the RPM package (if any) that the file belongs to. – Then use rpm -qi packagename to display the package information ● Locate the executable with whereis filename; if necessary, parse with strings filename for clues

Services You Don't Want ● NFS and related services: nfsd, lockd, mountd, statd, portmapper, etc. – don't use on the Internet! ● r* services: rsh, rlogin, rexec, rcp, etc. – INSECURE! DON'T USE! – based on "trusted host" concept, but IP numbers can be spoofed ● inetd – Mostly older distros, replace with xinetd

More Services to Avoid ● telnetd: use sshd instead ● ftpd: use scp and sftp instead, or use only on a dedicated ftp server that can be monitored and secured ● BIND (named), DNS server packages – only for an authoritative name server for a domain, shouldn't be necessary on campus

Services to Avoid, Page 3 ● Mail transport agents: sendmail, exim, postfix, qmail – unless your machine will be acting as a mail server or handling mail locally, you don't need these; most UNIX mail clients can interact with POP3 and SMTP servers directly (though not often Kerberized POP3) and we have them readily available on campus

Disabling Services ● Use /sbin/chkconfig servicename off – Advantage: you can use --level 2345 to disable it in multiple runlevels ● OR rename the Snnservicename scripts to Kmmservicename – Use mm = 99 - nn ● Use service servicename stop to stop the service ● If necessary, take down the process with kill PID

Using system-config-services ● To disable at runlevel startup, uncheck the box ● Use Start and Stop buttons to start and stop the service ● Don't forget to click Save!

Using ntsysv ● /usr/sbin/ntsysv acts like system-config-services at a text console ● Use {Tab} to move cursor, {Space} to click, {F1} to see description

Exercises ● Get a list of services running on your machine ● Pick a service (preferably one you haven't seen) and find the executable that starts it ● Identify the service; what is it? ● How would you shut down the service? Restart it? Without X? With Red Hat?