Security. Computer Center, CS, NCTU 2 FreeBSD Security Advisories – (1) 

Slides:



Advertisements
Similar presentations
153 Configuring and Securing ARPA/Berkeley Services Version A.01 H3065S Module 13 Slides.
Advertisements

Linux’ Security Haifa Linux Club Orr Dunkelman.
Linux Security An overview notes from Linux Network Security HowTO.
Chapter 21 Security. Computer Center, CS, NCTU 2 Firewall (1)  Using ipfw 1.Add these options in kernel configuration file and recompile the kernel 2.Edit.
Securing Network using Linux. Lesson Outline Setting up a secure system TCP Wrapper configuration Firewalls in Linux Authentication Systems –NIS –Kerberos.
Homework 5b: Samba. Computer Center, CS, NCTU 2 Network-based File Sharing (1)  NFS (UNIX-based) mountd is responsible for mount request nfsd and nfsiod.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Information Networking Security and Assurance Lab National Chung Cheng University 1 A Real World Attack: wu-ftp.
TCP/IP - Security Perspective Upper Layers CS-431 Dick Steflik.
Chapter 3 Unix Overview. Figure 3.1 Unix file system.
CS 497C – Introduction to UNIX Lecture 35: - TCP/IP Networking Tools Chin-Chih Chang
1 Figure 5-4: Drivers of Performance Requirements: Traffic Volume and Complexity of Filtering Performance Requirements Traffic Volume (Packets per Second)
Penetration Testing Training Day Capture the Flag Training.
The Linux Operating System Lecture 7: Tonga Institute of Higher Education.
Linux Security Anthony Albrecht – Services & Accounts
Linux Security Chapter 21 (section 1-7) By Yanjun Zuo.
The Saigon CTT Chapter 16 Remote Connectivity. The Saigon CTT  Objectives  Explain : telnet rsh ssh  Configure FTP.
Secure Shell for Computer Science Nick Czebiniak Sung-Ho Maeung.
ITI-481: Unix Administration Meeting 3. Today’s Agenda Hands-on exercises with booting and software installation. Account Management Basic Network Configuration.
Chapter 21 Security. Computer Center, CS, NCTU 2 FreeBSD Security Advisories 
Maintain Installed Applications. Computer Center, CS, NCTU 2 In Ports Tree  / Makefile  COMMENT pkg-descr  WWW pkg-message  Shown after installed.
Bugs SATAN scans for It is interesting to look at the bugs SATAN scans for. They are easily detected by the scanners and therefore do not pose a threat.
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.
Linux Services Muhammad Amer. 2 xinetd Programs  In computer networking, xinetd, the eXtended InterNET Daemon, is an open-source super-server daemon.
1 Firewalls G53ACC Chris Greenhalgh. 2 Contents l Attacks l Principles l Simple filters l Full firewall l Books: Comer ch
User Access to Router Securing Access.
Linux Networking Security Sunil Manhapra & Ling Wang Project Report for CS691X July 15, 1998.
 FreeBSD firewalls › ipfw -- IP firewall and traffic shaper control program  ipfw(8) › ipf (IP Filter) - alters packet filtering lists for IP packet.
CIS 450 – Network Security Chapter 14 – Specific Exploits for UNIX.
System Administration HW2 Shell Script xclin. Computer Center, CS, NCTU 2 Requirements  Xferlog statistics (15%) use one-line command to show FTP transfer.
CHAPTER 9 Sniffing.
Security. Computer Center, CS, NCTU 2 FreeBSD Security Advisories 
1 Linux Security. 2 Linux is not secure No computer system can ever be "completely secure". –make it increasingly difficult for someone to compromise.
Dictionary Attack Chien-Chung Shen
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.
SECURITY - HARIPRIYA PURUSHOTHAMAN. SEVEN COMMON – SENSE RULES OF SECURITY Avoid putting files on the system that are likely to be interesting to hackers.
Phil Hurvitz Securing UNIX Servers with the Secure.
1 Security. 2 Linux is not secure No computer system can ever be "completely secure". –make it increasingly difficult for someone to compromise your system.
1 Securing Network Services. 2 How TCP Works Set up connection between port on source host to port on destination host Each connection consists of sequence.
Protocols COM211 Communications and Networks CDA College Olga Pelekanou
Linux Services Configuration
Daemons Ying Zhang CMSC691X, Summer02. Outline  Introduction  Init and Cron  System daemons  Print daemons and NFS daemons  Time synchronization.
Department of Computer Science Southern Illinois University Edwardsville Spring, 2008 Dr. Hiroshi Fujinoki FTP Protocol Programming.
Unix network Services. Configuring a network interface In Unix there are essentially two commands that are used to enable TCP/IP. ifconfig route.
Unix System Administration Chapter 31 Daemons. Out of the Goo, the Primordial Process l Init l Always the first process to run after system boot l Always.
SECURE SHELL MONIKA GUPTA COT OUTLINE What is SSH ? What is SSH ? History History Functions of Secure Shell ? Functions of Secure Shell ? Elements.
JLAB Password Security Ian Bird Jefferson Lab HEPiX-SLAC 6 Oct 1999.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
SSH. 2 SSH – Secure Shell SSH is a cryptographic protocol – Implemented in software originally for remote login applications – One most popular software.
Chapter 7: Using Network Clients The Complete Guide To Linux System Administration.
Microsoft OS Vulnerabilities April 1, 2010 MIS 4600 – MBA © Abdou Illia.
Secure services Unit-IV CHAP-1
LINUX ADMINISTRATION
SECURE SHELL MONIKA GUPTA COT 4810.
Chapter 21 (section 1-7) By Yanjun Zuo
Security.
Chapter 3 Rootly Powers.
Overview of Unix Jagdish S. Gangolly School of Business
IS3440 Linux Security Unit 6 Using Layered Security for Access Control
Chapter 27: System Security
Haifa Linux Club Orr Dunkelman
Lab 7 - Topics Establishing SSH Connection Install SSH Configure SSH
Security.
Linux Security.
Daemons & inetd Refs: Chapter 12.
Security.
Security.
Security.
Chapter 7 Network Applications
Presentation transcript:

Security

Computer Center, CS, NCTU 2 FreeBSD Security Advisories – (1) 

Computer Center, CS, NCTU 3 FreeBSD Security Advisories – (2)

Computer Center, CS, NCTU 4 FreeBSD Security Advisories – (3)  freebsd-security-notifications Mailing list

Computer Center, CS, NCTU 5 FreeBSD Security Advisories – (4)  Example compress

Computer Center, CS, NCTU 6 FreeBSD Security Advisories – (5)  CVE

Computer Center, CS, NCTU 7 FreeBSD Security Advisories – (6)  Example Problem Description

Computer Center, CS, NCTU 8 FreeBSD Security Advisories – (7)  Example Workaround

Computer Center, CS, NCTU 9 FreeBSD Security Advisories – (8)  Example Solution

Computer Center, CS, NCTU 10 Common Security Problems  Unreliable wetware Phishing site  Software bugs FreeBSD security advisor portaudit (ports-mgmt/portaudit)  Open doors Accounts’ password Disk share with the world

Computer Center, CS, NCTU 11 portaudit (1)  portaudit Checks installed ports against a list of security vulnerabilities portaudit –Fda  -F: Fetch the current database from the FreeBSD servers.  -d: Print the creation date of the database.  -a: Print a vulnerability report for all installed packages.  Security Output

Computer Center, CS, NCTU 12 portaudit (2)  portaudit -Fda  / auditfile.tbz 100% of 71 kB 92 kBps New database installed. Database created: Mon Dec 12 02:10:00 CST 2011 Affected package: gnutls Type of problem: gnutls -- client session resumption vulnerability. Reference: Affected package: apache-worker Type of problem: apache -- Range header DoS vulnerability. Reference: 2 problem(s) in your installed packages found. You are advised to update or deinstall the affected package(s) immediately.

Computer Center, CS, NCTU 13 Common trick  Tricks ssh scan and hack  ssh guard  sshit  … smtp-auth / pop3 / imap Phishing XSS & sql injection …  Objective Spam Jump gateway File sharing …

Computer Center, CS, NCTU 14 Process file system - procfs  Procfs A view of the system process table # mount –t procfs proc /proc

Computer Center, CS, NCTU 15 Simple SQL injection example  User/pass authentication  No input validation SELECT * FROM usrTable WHERE user = AND pass = ; SELECT * FROM usrTable WHERE user = ‘test’ AND pass = ‘a’ OR ‘a’ = ‘a’

Computer Center, CS, NCTU 16 setuid programs  passwd /etc/master.passwd is of mode 600 (-rw ) !  setuid executables are especially apt to cause security holes Minimize the number of setuid programs  /etc/periodic/security/100.chksetuid Disable the setuid execution on individual filesystems  -o nosuid zfs[~] -chiahung- ls -al /usr/bin/passwd -r-sr-xr-x 2 root wheel 8224 Dec 5 22:00 /usr/bin/passwd

Computer Center, CS, NCTU 17 rlogin – (1)  sudo  Trusted remote host and user name database /etc/hosts.equiv and ~/.rhosts Allow user to execute shell (rsh), login (rlogin) and copy files (rcp) between machines without passwords Format:  Simple: hostname [username]  Complex: Example  bar.com foo(trust user “ foo ” from host “ bar.com ” )  all from amd_cs_cc group)  ---s--x--x 2 root wheel /usr/local/bin/sudo

Computer Center, CS, NCTU 18 rlogin – (2)  Becoming other users A pseudo-user for services, sometimes shared by multiple users sudo –u wwwadm –s (?) /etc/inetd.conf  login stream tcp nowait root /usr/libexec/rlogind rlogind ~wwwadm/.rhosts  localhost pyhsu rlogin -l wwwadm localhost User_Alias wwwTA=pyhsu Runas_Alias WWWADM=wwwadm wwwTA ALL=(WWWADM) ALL Too dirty!

Computer Center, CS, NCTU 19 Security tools  nmap  john, crack  PGP  CA  …  Firewall  TCP Wrapper  …

Computer Center, CS, NCTU 20 TCP Wrapper – (1)  TCP Wrapper Provide support for every server daemon under its control  libwrap implements the actual functionality Before: inetd + tcpd with libwrap

Computer Center, CS, NCTU 21 TCP Wrapper – (2)  Now… $ ldd `which inetd` /usr/sbin/inetd: libutil.so.8 => /lib/libutil.so.8 (0x ) libwrap.so.6 => /usr/lib/libwrap.so.6 (0x ) libipsec.so.4 => /lib/libipsec.so.4 (0x80086a000) libc.so.7 => /lib/libc.so.7 (0x ) $ ldd `which sshd` /usr/sbin/sshd: libssh.so.5 => /usr/lib/libssh.so.5 (0x ) libutil.so.8 => /lib/libutil.so.8 (0x8007cb000) libz.so.5 => /lib/libz.so.5 (0x8008db000) libwrap.so.6 => /usr/lib/libwrap.so.6 (0x8009f0000) libpam.so.5 => /usr/lib/libpam.so.5 (0x800af9000).....

Computer Center, CS, NCTU 22 TCP Wrapper – (3)  libwrap – hosts_access(3) In sshd source code

Computer Center, CS, NCTU 23 TCP Wrapper – (4)  There are something that a firewall will not handle Sending text back to the source  TCP wrapper Provide support for every server daemon under its control Logging support Return message Permit a daemon to only accept internal connections  Configuration files /etc/hosts.allow, /etc/hosts.deny(optional)

Computer Center, CS, NCTU 24 Super Server – inetd  To see what daemons are controlled by inetd, see /etc/inetd.conf  In /etc/rc.conf inetd_enable="YES" #ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l #ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -l #telnet stream tcp nowait root /usr/libexec/telnetd telnetd #telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shell stream tcp nowait root /usr/libexec/rshd rshd #shell stream tcp6 nowait root /usr/libexec/rshd rshd login stream tcp nowait root /usr/libexec/rlogind rlogind #login stream tcp6 nowait root /usr/libexec/rlogind rlogind

Computer Center, CS, NCTU 25 /etc/hosts.allow – (1)  In /etc/hosts.allow Format: daemon : address : action  daemon is the daemon name which inetd started  address can be hostname, IPv4 addr, IPv6 addr, net/prefixlen  action can be “ allow ” or “ deny ”  Keyword “ ALL ” can be used in daemon and address fields to means everything  First rule match semantic Meaning that the configuration file is scanned in ascending order for a matching rule When a match is found, the rule is applied and the search process will stop

Computer Center, CS, NCTU 26 /etc/hosts.allow – (2)  Example  TCP wrapper should not be considered a replacement of a good firewall Instead, it should be used in conjunction with a firewall or other security tools Good at rpc based services ALL : localhost, : allow ptelnetd @linux_cc_cs : allow ptelnetd pftpd sshd: zeiss, chbsd, sabsd : allow identd : ALL : allow portmap : ALL : allow sendmail : ALL : allow rpc.rstatd : allow rpc.rusersd : allow ALL : ALL : deny

Computer Center, CS, NCTU 27 /etc/hosts.allow – (3)  Advance configuration External commands (twist option)  twist will be called to execute a shell command or script (exec) External commands (spawn option)  spawn is like twist, but it will not send a reply back to the client (fork/exec) # The rest of the daemons are protected. telnet : ALL \ : severity auth.info \ : twist /bin/echo "You are not welcome to use %d from %h." # We do not allow connections from example.com: ALL :.example.com \ : spawn (/bin/echo %a from %h attempted to access %d >> \ /var/log/connections.log) \ : deny

Computer Center, CS, NCTU 28 /etc/hosts.allow – (4) Wildcard (PARANOID option)  Match any connection that is made from an IP address that differs from its hostname  See hosts_access(5) hosts_options(5) # Block possibly spoofed requests to sendmail: sendmail : PARANOID : deny

Computer Center, CS, NCTU 29 tcpdmatch  In /etc/hosts.allow  tcpdmatch(8) example ALL : localhost [::1] : allow ALL : cshome2 : allow sshd : csduty linuxhome cshome : allow rpc.lockd : / : allow rpc.statd : / : allow rpcbind : / : allow ALL : ALL : deny $ tcpdmatch ssh warning: ssh: no such process name in /etc/inetd.conf client: address server: process ssh matched: /etc/hosts.allow line 12 option: deny access: denied

Computer Center, CS, NCTU 30 When you perform any change.  Philosophy of SA Know how things really work Plan it before you do it Make it reversible Make changes incrementally Test before you unleash it