Chapter 21 Security. Computer Center, CS, NCTU 2 FreeBSD Security Advisories 

Slides:



Advertisements
Similar presentations
DMZ (De-Militarized Zone)
Advertisements

DMZ (De-Militarized Zone)
Ipchains and Iptables Linux operating system natively supports packet-filtering rules: Kernel versions 2.2 and earlier support the ipchains command. Kernel.
153 Configuring and Securing ARPA/Berkeley Services Version A.01 H3065S Module 13 Slides.
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.
Chapter 3 Unix Overview. Figure 3.1 Unix file system.
CCNA2 Routing Perrine modified by Brierley Page 18/6/2015 Module 11 Access Control Non e0e1 s server.
1 Figure 5-4: Drivers of Performance Requirements: Traffic Volume and Complexity of Filtering Performance Requirements Traffic Volume (Packets per Second)
Packet Filtering. 2 Objectives Describe packets and packet filtering Explain the approaches to packet filtering Recommend specific filtering rules.
NetFilter – IPtables Firewall –Series of rules to govern what Kind of access to allow on your system –Packet filtering –Drop or Accept packets NAT –Network.
Karlstad University Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
Chapter 6: Packet Filtering
Chapter 10 Networking and the Internet ITSC 1458.
Linux Security Chapter 21 (section 1-7) By Yanjun Zuo.
Firewall Dave Grizzanti Steve Curti. What is an Internet Firewall? An Internet firewall is most often installed at the point where your protected internal.
SCSC 455 Computer Security Network Security. Control access to system Access control mechanisms in specific network programs  e.g. 1, wu-FTP server support.
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.
Packet Filtering Chapter 4. Learning Objectives Understand packets and packet filtering Understand approaches to packet filtering Set specific filtering.
Linux Services Muhammad Amer. 2 xinetd Programs  In computer networking, xinetd, the eXtended InterNET Daemon, is an open-source super-server daemon.
Firewalling With Netfilter/Iptables. What Is Netfilter/Iptables? Improved successor to ipchains available in linux kernel 2.4/2.6. Netfilter is a set.
Linux Security. See who's logged in 1) w (more information) 2) who (less information)
Linux security Taeho Oh
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Filtering Traffic Using Access Control Lists Introducing Routing and Switching.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Filtering Traffic Using Access Control Lists Introducing Routing and Switching.
 FreeBSD firewalls › ipfw -- IP firewall and traffic shaper control program  ipfw(8) › ipf (IP Filter) - alters packet filtering lists for IP packet.
System Administration HW2 Shell Script xclin. Computer Center, CS, NCTU 2 Requirements  Xferlog statistics (15%) use one-line command to show FTP transfer.
Security. Computer Center, CS, NCTU 2 FreeBSD Security Advisories 
Homework 02 NAT 、 DHCP 、 Firewall 、 Proxy. Computer Center, CS, NCTU 2 Basic Knowledge  DHCP Dynamically assigning IPs to clients  NAT Translating addresses.
1 Linux Security. 2 Linux is not secure No computer system can ever be "completely secure". –make it increasingly difficult for someone to compromise.
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.
Protocols COM211 Communications and Networks CDA College Olga Pelekanou
How to do NAT + DHCP + IPFW in FreeBSD. Firewalls.
Server Hardening Moses Ike and Paul Murley TexSAW 2015 Credit to Daniel Waymel and Corrin Thompson.
Security. Computer Center, CS, NCTU 2 FreeBSD Security Advisories – (1) 
Module 10: Windows Firewall and Caching Fundamentals.
Unix network Services. Configuring a network interface In Unix there are essentially two commands that are used to enable TCP/IP. ifconfig route.
CCNA4 Perrine / Brierley Page 12/20/2016 Chapter 05 Access Control Non e0e1 s server.
Chapter 7: Using Network Clients The Complete Guide To Linux System Administration.
Firewalls. A Firewall is: a) Device that interconnects two networks b) Network device that regulates the access to an internal network c) Program that.
NAT、DHCP、Firewall、FTP、Proxy
FIREWALL configuration in linux
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer
LINUX ADMINISTRATION
LINUX ADMINISTRATION 1
Chapter 21 (section 1-7) By Yanjun Zuo
Security.
Overview of Unix Jagdish S. Gangolly School of Business
IS3440 Linux Security Unit 6 Using Layered Security for Access Control
IIS.
Chapter 27: System Security
Haifa Linux Club Orr Dunkelman
Access Control Lists CCNA 2 v3 – Module 11
Lab 7 - Topics Establishing SSH Connection Install SSH Configure SSH
Setting Up Firewall using Netfilter and Iptables
Security.
Linux Security.
Daemons & inetd Refs: Chapter 12.
Security.
Security.
Security.
Chapter 7 Network Applications
Presentation transcript:

Chapter 21 Security

Computer Center, CS, NCTU 2 FreeBSD Security Advisories   Upcoming FreeBSD Security Advisory Announced on 12/1 Zero-day-exploit

Computer Center, CS, NCTU 3 FreeBSD Security Advisories  Advisory Security information  Where to find it freebsd-security-notifications Mailing list  Web page (Security Advisories Channel) 

Computer Center, CS, NCTU 4 FreeBSD Security Advisories  Example rtld

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

Computer Center, CS, NCTU 6 FreeBSD Security Advisories (5)  Example Workaround Solution

Computer Center, CS, NCTU 7 Common Security Problems  Unreliable wetware Phishing site  Software bugs FreeBSD security advisor portaudit  Open doors Account password Disk share with the world

Computer Center, CS, NCTU 8 Common trick  Tricks ssh scan and hack  ssh guard  sshit  … Phishing XSS & sql injection …  Objective Spam Jump gateway File sharing …

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

Computer Center, CS, NCTU 10 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 11 setuid program  /etc/passwd /etc/master.passwd is read only !  Setuid shell scripts are especially apt to cause security problems Minimize the number of setuid programs 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 /usr/bin/find / -user root –perm –print | /bin/mail –s “Setuid root files” username

Computer Center, CS, NCTU 12 Security issues  /etc/hosts.equiv and ~/.rhosts  Trusted remote host and user name DB Allow user to login (via 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)   Do not use this

Computer Center, CS, NCTU 13 Security tools  nmap  jhon, crack  PGP  CA  …

Computer Center, CS, NCTU 14 Firewall  FreeBSD firewalls ipfw -- IP firewall and traffic shaper control program  ipfw(8) ipf (IP Filter) - alters packet filtering lists for IP packet input and output  ipf(8) pf -- packet filter  pf(4)

Computer Center, CS, NCTU 15 Firewall (1)  Using ipfw 1.Add these options in kernel configuration file and recompile the kernel 2.IPFW is already installed as run time loadable module  Add firewall_enable=“YES” into /etc/rc.conf  Unless NAT functionally is required options IPFIREWALL options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE=5 options IPFIREWALL_DEFAULT_TO_ACCEPT # firewall firewall_enable="YES" firewall_script="etc/firewalls/rules"

Computer Center, CS, NCTU 16 Firewall (2) 3.Edit ipfw command script that you specify in rc.conf  Ex: /etc/firewall/rules 4.ipfw command  % sudo ipfw list(show current firewall rules)  % sudo ipfw flush(delete all firewall rules)  % ipfw add {pass|deny} {udp|tcp|all} from where to where

Computer Center, CS, NCTU 17 Firewall (3)  Example (Head part) #!/bin/sh fwcmd="/sbin/ipfw -q“ myip=“ ” ${fwcmd} -f flush ${fwcmd} add pass all from ${myip} to any # Allow TCP through if setup succeeded ${fwcmd} add pass tcp from any to any established ${fwcmd} add deny log all from any to any frag echo -n "Established “ # Allow icmp (ping only) ${fwcmd} add pass icmp from any to any icmptypes 0,3,8,11

Computer Center, CS, NCTU 18 Firewall (4)  Example (service part) # Allow SMB ${fwcmd} add pass tcp from /24 to ${myip} setup # Allow HTTP/HTTPS ${fwcmd} add pass tcp from any to ${myip} 80 setup ${fwcmd} add pass tcp from any to ${myip} 443 setup echo -n "HTTP/HTTPS " # SSH access control ${fwcmd} add pass tcp from any to any 22 setup echo -n "SSH "

Computer Center, CS, NCTU 19 Firewall (5)  Example (Tail part) # Default to deny ${fwcmd} add reset log tcp from any to any ${fwcmd} add reject udp from any to any ${fwcmd} add reject log icmp from any to any ${fwcmd} add deny log all from any to any

Computer Center, CS, NCTU 20 Firewall (6)  Manual reset firewall rules Edit the script and % sudo sh /etc/firewall/rules  When you install new service and wondering why it can not use … % sudo ipfw flush Delete all firewall rules to remove problems caused by firewall

Computer Center, CS, NCTU 21 Firewall (7)  Debug your system via log file /var/log/security Dec 25 11:25:36 sabsd last message repeated 2 times Dec 25 11:45:06 sabsd kernel: ipfw: Reset TCP : :5554 in via fxp0 Dec 25 11:45:07 sabsd kernel: ipfw: Reset TCP : :5554 in via fxp0 Dec 25 11:45:07 sabsd kernel: ipfw: Reset TCP : :1023 in via fxp0 Dec 25 11:45:08 sabsd kernel: ipfw: Reset TCP : :1023 in via fxp0 Dec 25 11:45:09 sabsd kernel: ipfw: Reset TCP : :9898 in via fxp0 Dec 25 12:05:44 sabsd kernel: ipfw: Reset TCP : :445 in via fxp0 Dec 25 12:05:45 sabsd last message repeated 2 times

Computer Center, CS, NCTU 22 TCP Wrapper  There are something that a firewall will not handle Sending text back to the source  TCP wrapper Extend the abilities of inetd  Provide support for every server daemon under its control Logging support Return message Permit a daemon to only accept internal connetions

Computer Center, CS, NCTU 23 TCP Wrapper  TCP Wrapper Provide support for every server daemon under its control

Computer Center, CS, NCTU 24 TCP Wrapper  To see what daemons are controlled by inetd, see /etc/inetd.conf  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 #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 TCP Wrapper  To use TCP wrapper 1.inetd daemon must start up with “-Ww” option (default) Or edit /etc/rc.conf Edit /etc/hosts.allow  Format:daemon:address:action –daemon is the daemon name which inetd started –address can be hostname, IPv4 addr, IPv6 addr –action can be “ allow ” or “ deny ” –Keyword “ ALL ” can be used in daemon and address fields to means everything inetd_enable="YES" inetd_flags="-wW"

Computer Center, CS, NCTU 26 /etc/hosts.allow  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  example 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  Advance configuration External commands (twist option)  twist will be called to execute a shell command or script External commands (spawn option)  spawn is like twist, but it will not send a reply back to the client # 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 Wildcard (PARANOID option)  Match any connection that is made from an IP address that differs from its hostname  See man 5 hosts_access man 5 hosts_options # Block possibly spoofed requests to sendmail: sendmail : PARANOID : deny