Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Monday, May 28, 2012

Hacknotes Linux And Unix Security Portable Reference






NITESH DHANJANI
CONTENTS
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Reference Center
Common Commands . . . . . . . . . . . . . . . . . . . . . . . . . . RC 2
Common Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 7
IP Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 9
Dotted Decimal Notation . . . . . . . . . . . . . . . . . . RC 9
Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 9
Subnet Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 11
CIDR (Classless Inter-Domain Routing) . . . . . RC 12
Loopback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 12
Private Addresses . . . . . . . . . . . . . . . . . . . . . . . . RC 12
Protocol Headers . . . . . . . . . . . . . . . . . . . . . . . . . RC 12
Online Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 15
Hacking Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 15
Web Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 18
Mailing Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 19
Conferences and Events . . . . . . . . . . . . . . . . . . . RC 19
Useful Netcat Commands . . . . . . . . . . . . . . . . . . . . . . RC 20
ASCII Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 22
HTTP Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 28
Impotant Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC 30
Part I
Hacking Techniques and Defenses
■ 1 Footprinting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Search Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Domain Registrars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Regional Internet Registries . . . . . . . . . . . . . . . . . . . . . 12
DNS Reverse-Lookups . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Mail Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Zone Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Traceroute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
■ 2 Scanning and Identification . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Pinging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Ping Sweeping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
TCP Pinging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Port Scanning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
TCP Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
TCP SYN/Half-Open . . . . . . . . . . . . . . . . . . . . . . 26
FIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Reverse Ident . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
XMAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
NULL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
RPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
IP Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
ACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Fingerprinting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
■ 3 Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Enumerate Remote Services . . . . . . . . . . . . . . . . . . . . . 36
FTP (File Transfer Protocol): 21 (TCP) . . . . . . . . 37
SSH (Secure Shell): 22 (TCP) . . . . . . . . . . . . . . . . 38
Telnet: 23 (TCP) . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
SMTP (Simple Mail Transfer Protocol):
25 (TCP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
DNS (Domain Name System):
53 (TCP/UDP) . . . . . . . . . . . . . . . . . . . . . . . . . 41
Finger: 79 (TCP) . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
HTTP (Hypertext Transfer Protocol): 80 (TCP) 43
POP3 (Post Office Protocol 3): 110 (TCP) . . . . . . 45
Portmapper: 111 (TCP) . . . . . . . . . . . . . . . . . . . . . 45
NNTP (Network News Transfer
Protocol): 119 (TCP) . . . . . . . . . . . . . . . . . . . . . 47
Samba: 137 to 139 (TCP and UDP) . . . . . . . . . . . 48
IMAP2/IMAP4 (Internet Message Access
Protocol 2/4): 143 (TCP) . . . . . . . . . . . . . . . . . 49
SNMP (Simple Network Management
Protocol): 161, 162 (UDP) . . . . . . . . . . . . . . . . 50
HTTPS (Secure Hypertext Transfer
Protocol): 443 (TCP) . . . . . . . . . . . . . . . . . . . . . 51
NNTPS (Secure Network News Transfer
Protocol): 563 (TCP) . . . . . . . . . . . . . . . . . . . . . 52
IMAPS (Secure Internet Message Access
Protocol): 993 (TCP) . . . . . . . . . . . . . . . . . . . . . 52
POP3S (Secure Post Office Protocol 3):
995 (TCP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
MySQL: 3306 (TCP) . . . . . . . . . . . . . . . . . . . . . . . . 53
Automated Banner-Grabbing . . . . . . . . . . . . . . . . . . . . 54
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
■ 4 Remote Hacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Remote Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Intrusion Tactics . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Remote Service Vulnerabilities . . . . . . . . . . . . . . 62
Application Vulnerabilities . . . . . . . . . . . . . . . . . 103
Nessus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Obtaining a Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Port Redirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Cracking /etc/shadow . . . . . . . . . . . . . . . . . . . . . . . . . 109
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
■ 5 Privilege Escalation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Exploiting Local Trust . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Group Memberships and Incorrect File Permissions 112
“.” in PATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Software Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . . . 115
Kernel Flaws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Local Buffer Overflows . . . . . . . . . . . . . . . . . . . . . 116
Improper Input Validation . . . . . . . . . . . . . . . . . 116
Symbolic Links . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Core Dumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Misconfigurations . . . . . . . . . . . . . . . . . . . . . . . . . 118
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
■ 6 Hiding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Clean Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Shell History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Cleaning /var . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Backdoors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Setuid and Setgid Shells Owned by root . . . . . . 123
Changing a Local Account’s uid to 0 . . . . . . . . . 123
.rhosts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
SSH’s authorized_keys . . . . . . . . . . . . . . . . . . . . . 125
Trojans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Rootkits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Part II
Host Hardening
■ 7 Default Settings and Services . . . . . . . . . . . . . . . . . . . . . . . . 131
Set Password Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Remove or Disable Unnecessary Accounts . . . . . . . . . 132
Remove “.” from the PATH Variable . . . . . . . . . . . . . 132
Check the Contents of /etc/hosts.equiv . . . . . . . . . . . 133
Check for .rhosts Files . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Disable Stack Execution . . . . . . . . . . . . . . . . . . . . . . . . . 133
Use TCP Wrappers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Harden inetd and xinetd Configurations . . . . . . . . . . 134
Disable Unnecessary Services . . . . . . . . . . . . . . . 134
Disable inetd or xinetd If No Services
Are Enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Ensure Logging Is Turned On . . . . . . . . . . . . . . . 135
Harden Remote Services . . . . . . . . . . . . . . . . . . . . . . . . 135
WU-FTPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Sendmail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
BIND (DNS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Apache (HTTP and HTTPS) . . . . . . . . . . . . . . . . 139
Samba . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
■ 8 User and File-System Privileges . . . . . . . . . . . . . . . . . . . . . . 143
File Permissions: A Quick Tutorial . . . . . . . . . . . . . . . 144
World-Readable Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
World-Writable Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Files Owned by bin and sys . . . . . . . . . . . . . . . . . . . . . 146
The umask Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Imprtant Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Files in /dev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Disk Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
setuid and setgid Files . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Implement the wheel Group . . . . . . . . . . . . . . . . . . . . . 150
Sudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
■ 9 Logging and Patching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Log Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Free Space in /var . . . . . . . . . . . . . . . . . . . . . . . . . 157
Patching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Part III
Special Topics
■ 10 Nessus Attack Scripting Language (NASL) . . . . . . . . . . . . . . 161
Running NASL Scripts from the Command Line . . . 162
Writing Nessus Plug-ins Using NASL . . . . . . . . . . . . . 162
Example Vulnerability . . . . . . . . . . . . . . . . . . . . . 162
The Plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Running the Plug-in . . . . . . . . . . . . . . . . . . . . . . . 166
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
■ 11 Wireless Hacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Introduction to WEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Antennas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Popular Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Airsnort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Kismet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Fata-Jack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Securing Wireless Networks . . . . . . . . . . . . . . . . . . . . . 174
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
■ 12 Hacking with the Sharp Zaurus PDA . . . . . . . . . . . . . . . . . . . 177
Kismet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Wellenreiter II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Nmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Qpenmapfe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Bing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
OpenSSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Hping2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
VNC Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Keypebble VNC Viewer . . . . . . . . . . . . . . . . . . . . . . . . . 183
Smbmount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Tcpdump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Wget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
ZEthereal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
zNessus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
MTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Dig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Online Resources for the Zaurus . . . . . . . . . . . . . . . . . 186
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
■ Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187

Hacker - Wikipedia, the free encyclopedia
How To Become A Hacker

Hacking Exposed Computer Forensics

Hacker Disassembling Uncovered
Other Hacker Books
Other Linux Books
Download

Saturday, May 26, 2012

Hacking Exposed Linux Linux Security Secrets & Solutions






CONTENTS
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Part I Security and Controls
▼ 1 Applying Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Free from Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
The Four Comprehensive Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
The Elements of Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
▼ 2 Applying Interactive Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
The Five Interactive Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
▼ 3 Applying Process Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
The Five Process Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Part II Hacking the System
▼ 4 Local Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Physical Access to Linux Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Console Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Privilege Escalation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Sudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
File Permissions and Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Chrooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Physical Access, Encryption, and Password Recovery . . . . . . . . . . . . . . . . . . 80
Volatile Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
▼ 5 Data Networks Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Network Visibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Network and Systems Profi ling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Network Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Covert Communications and Clandestine Administration . . . . . . . . . . . . . . 107
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
▼ 6 Unconventional Data Attack Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Overview of PSTN, ISDN, and PSDN Attack Vectors . . . . . . . . . . . . . . . . . . 127
Introducing PSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Introducing ISDN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Introducing PSDN and X.25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Communication Network Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Tests to Perform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
PSTN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
ISDN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
PSDN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Tools to Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
PAW and PAWS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Intelligent Wardialer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Shokdial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
ward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
THCscan Next Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
PSDN Testing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
admx25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Sun Solaris Multithread and Multichannel X.25 Scanner
by Anonymous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
vudu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
TScan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Common Banners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
How X.25 Networks Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Basic Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Call Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
X.3/X.28 PAD Answer Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
X.25 Addressing Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
DCC Annex List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Key Points for Getting X.25 Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
X.28 Dialup with NUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
X.28 Dialup via Reverse Charge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Private X.28 PAD via a Standard or Toll-Free PSTN or ISDN
Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Internet to X.25 Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Cisco Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
VAX/VMS or AXP/OpenVMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
*NIX Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
▼ 7 Voice over IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
VoIP Attack Taxonomy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Network Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
System Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Signaling Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Introduction to VoIP Testing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Transport Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
VoIP Security Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Firewalls and NAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
▼ 8 Wireless Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
The State of the Wireless . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Wireless Hacking Physics: Radio Frequency . . . . . . . . . . . . . . . . . . . . . . . . . . 225
RF Spectrum Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Exploiting 802.11 The Hacker Way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Wireless Auditing Activities and Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Auditing Wireless Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
▼ 9 Input/Output devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
About Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Bluetooth Profi les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Entities on the Bluetooth Protocol Stack . . . . . . . . . . . . . . . . . . . . . . . . 286
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
▼ 10 RFID—Radio Frequency Identifi cation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
History of RFID: Leon Theremin and “The Thing” . . . . . . . . . . . . . . . . . . . . . 297
Identifi cation-Friend-or-Foe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
RFID Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Purpose of RFID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Passive Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Active Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
RFID Uses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
RFID-Enabled Passports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Ticketing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Other Current RFID Uses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
RFID Frequency Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
RFID Technology Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
RFID Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
RFID Hacker’s Toolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Implementing RFID Systems Using Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
RFID Readers Connected to a Linux System . . . . . . . . . . . . . . . . . . . . 311
RFID Readers with Embedded Linux . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Linux Systems as Backend/Middleware/Database
Servers in RFID Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Linux and RFID-Related Projects and Products . . . . . . . . . . . . . . . . . . . . . . . 313
OpenMRTD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
OpenPCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
OpenPICC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Magellan Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
RFIDiot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
RFID Guardian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
OpenBeacon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Omnikey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Linux RFID Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
▼ 11 Emanation Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Van Eck Phreaking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Other “Side-Channel” Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
▼ 12 Trusted Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Introduction to Trusted Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Platform Attack Taxonomy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Hardware Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Low-Level Software Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
System Software Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Application Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
General Support for Trusted Computing Applications . . . . . . . . . . . . . . . . . 355
TPM Device Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
TrouSerS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
TPM Emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
jTSS Wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
TPM Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Examples of Trusted Computing Applications . . . . . . . . . . . . . . . . . . . . . . . . 359
Enforcer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
TrustedGRUB (tGrub) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
TPM Keyring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Turaya.VPN and Turaya.Crypt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Open Trusted Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
TCG Industrial Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Part III Hacking the Users
▼ 13 Web Application Hacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Access and Controls Exploitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Insuffi cient Data Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Web 2.0 Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Trust Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Trust and Awareness Hijacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Man-in-the-Middle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Web Infrastructure Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
▼ 14 Mail Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
SMTP Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
Understanding Sender and Envelope Sender . . . . . . . . . . . . . . . . . . . 434
Email Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
SMTP Attack Taxonomy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
Fraud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
Alteration of Data or Integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Denial of Service or Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
▼ 15 Name Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Case study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
DNS Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
DNS and IPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
The Social Aspect: DNS and Phishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
WHOIS and Domain Registration and Domain Hijacking . . . . . . . . . . . . . . 476
The Technical Aspect: Spoofi ng, Cache Poisoning, and Other Attacks . . . . 478
Bind Hardening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Part IV Care and Maintenance
▼ 16 Reliability: Static Analysis of C Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Formal vs. Semiformal Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Semiformal Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Formal Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Static Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
C Code Static Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Analyzing C Code Using Hoare Logics . . . . . . . . . . . . . . . . . . . . . . . . 505
The Weakest Precondition Calculus . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Verifi cation Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Some C Analysis Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Tools Based on Abstract Interpretation . . . . . . . . . . . . . . . . . . . . . . . . . 518
Tools Based on Hoare Logics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Tools Based on Model Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Additional References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
▼ 17 Security Tweaks in the Linux Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Linux Security Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
CryptoAPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
NetFilter Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Enhanced Wireless Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
File System Enhancement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
POSIX Access Control Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
NFSv4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Additional Kernel Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Man Pages Online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Online Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Other References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
▼ A Management and Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Best Practices Node Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Use Cryptographically Secured Services . . . . . . . . . . . . . . . . . . . . . . . 532
Prevention Against Brute-Force . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Deny All, Allow Specifi cally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
One-Time Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
Automated Scanning Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Lock Out on Too High Fail Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
Avoid Loadable Kernel Module Feature . . . . . . . . . . . . . . . . . . . . . . . . 537
Enforce Password Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Use sudo for System Administration Tasks . . . . . . . . . . . . . . . . . . . . . 537
Check IPv6 Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Justify Enabled Daemons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Set Mount and Filesystem Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Harden a System Through /proc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Hardware Health . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Checking Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Best Practices Network Environment Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Ingress and Egress Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Build Network Segments and Host-based Firewalls . . . . . . . . . . . . . 544
Perform Time Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Watch Security Mailing Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Collect Log Files at a Central Place . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Collect Statistics Within the Network . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Use VPN for Remote Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Additional Helpful Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Intrusion Detection Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
System Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
Replace Legacy Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
xinetd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
syslog-ng . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
daemontools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
Other Service Management Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
Automating System Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
Perl Scripting Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
cfengine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
▼ B Linux Forensics and Data Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Hardware: The Forensic Workstation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
Hardware: Other Valuable Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Software: Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Software: Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
So, Where Should You Start From? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Live Investigation/Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
Post Mortem Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
Handling Electronic Evidence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Legislative Regulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Defi nition of Electronic Evidence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Equivalence of Traditional Evidence to Electronic Evidence . . . . . . . 566
Advantages and Disadvantages of Electronic Evidence . . . . . . . . . . 566
Working with Electronic Evidence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
Requirements That Electronic Evidence Must Fulfi ll to Be Admitted
in Court . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
▼ C BSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
Overview of BSD Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
Security Features Found in All BSDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
securelevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
Security Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
sysctl(8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
rc.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
rc.subr(8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
chfl ags(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
ttys(5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
sshd_confi g(5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
Blowfi sh Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
System Accounting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
IPsec(4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Randomness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
chroot(8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
ACLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
MAC Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
OpenBSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
OpenPAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
jail(8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
VuXML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
portaudit(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
gbde(4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
geli(8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
NetBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
kauth(9) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
veriexec(4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
pw_policy(3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
fi leassoc(9) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
Audit-Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
cgd(4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
clockctl(4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
OpenBSD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
ProPolice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
W^X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
systrace(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
Encrypted Swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
pf(4) Firewall Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
BSD Security Advisories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
Additional BSD Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
Online Man Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
Online Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
Books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
▼ Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591


Hacker - Wikipedia, the free encyclopedia
How To Become A Hacker

Hacking Exposed Computer Forensics

Hacker Disassembling Uncovered
Other Hacker Books
Other Linux Books
Download

Wednesday, May 23, 2012

Guide to Assembly Language Programming in Linux






Sivarama P. Dandamudi

Contents
Preface vii
PART I Overview 1
1 Assembly Language 3
Introduction 3
What Is Assembly Language? 5
Advantages of High-Level Languages 6
Why Program in Assembly Language? 7
Typical Applications 8
Summary 8
PART II Computer Organization 9
2 Digital Logic Circuits 11
Introduction 11
Simple Logic Gates 13
Logic Functions 15
Deriving Logical Expressions 17
Simplifying Logical Expressions 18
Combinational Circuits 23
Adders 26
Programmable Logic Devices 29
Arithmetic and Logic Units 32
Sequential Circuits 35
Latches 37
Flip-Flops 39
Summary 43
3 Memory Organization 45
Introduction 45
Basic Memory Operations 46
Types of Memory 48
Building a Memory Block 50
Building Larger Memories 52
Mapping Memory 56
Storing Multibyte Data 58
Alignment of Data 59
Summary 60
4 The IA-32 Architecture 61
Introduction 61
Processor Execution Cycle 63
Processor Registers 63
Protected Mode Memory Architecture 67
Real Mode Memory Architecture 72
Mixed-Mode Operation 74
Which Segment Register to Use 75
Input/Output 76
Summary 78
PART III Linux 79
5 Installing Linux 81
Introduction 81
Partitioning Your Hard Disk 82
Installing Fedora Core Linux 92
Installing and Removing Software Packages 107
Mounting Windows File System 110
Summary 112
Getting Help 114
6 Using Linux 115
Introduction 115
Setting User Preferences 117
System Settings 123
Working with the GNOME Desktop 126
Command Terminal 132
Getting Help 134
Some General-Purpose Commands 135
File System 139
Access Permissions 141
Redirection 145
Pipes 146
Editing Files with Vim 147
Summary 149
PART IV NASM 151
7 Installing and Using NASM 153
Introduction 153
Installing NASM 154
Generating the Executable File 154
Assembly Language Template 155
Input/Output Routines 156
An Example Program 159
Assembling and Linking 160
Summary 166
Web Resources 166
8 Debugging Assembly Language Programs 167
Strategies to Debug Assembly Language Programs 167
Preparing Your Program 169
GNU Debugger 170
Data Display Debugger 179
Summary 184
PART V Assembly Language 185
9 A First Look at Assembly Language 187
Introduction 187
Data Allocation 188
Where Are the Operands 193
Overview of Assembly Language Instructions 196
Our First Program 205
Illustrative Examples 206
Summary 209
10 More on Assembly Language 211
Introduction 211
Data Exchange and Translate Instructions 212
Shift and Rotate Instructions 213
Defining Constants 217
Macros 218
Our First Program 221
Illustrative Examples 223
When to Use the XLAT Instruction 227
Summary 229
11 Writing Procedures 231
Introduction 231
What Is a Stack? 233
Implementation of the Stack 234
Stack Operations 236
Uses of the Stack 238
Procedure Instructions 239
Our First Program 241
Parameter Passing 242
Illustrative Examples 248
Summary 252
12 More on Procedures 255
Introduction 255
Local Variables 256
Our First Program 257
Multiple Source Program Modules 260
Illustrative Examples 261
Procedures with Variable Number of Parameters 268
Summary 272
13 Addressing Modes 273
Introduction 273
Memory Addressing Modes 274
Arrays 278
Our First Program 281
Illustrative Examples 282
Summary 289
14 Arithmeticlnstructions 291
Introduction 291
Status Flags 292
Arithmetic Instructions 302
Our First Program 309
Illustrative Examples 310
Summary 316
15 Conditional Execution 317
Introduction 317
Unconditional Jump 318
Compare Instruction 321
Conditional Jumps 322
Looping Instructions 327
Our First Program 328
Illustrative Examples 330
Indirect Jumps 335
Summary 339
16 Logical and Bit Operations 341
Introduction 341
Logical Instructions 342
Shift Instructions 347
Rotate Instructions 353
Bit Instructions 354
Our First Program 355
Illustrative Examples 357
Summary 360
PART VI Advanced Assembly Language 361
17 String Processing 363
String Representation 363
String Instructions 364
Our First Program 372
Illustrative Examples 373
Testing String Procedures 376
Summary 378
18 ASCII and BCD Arithmetic 379
Introduction 379
Processing in ASCII Representation 381
Our First Program 384
Processing Packed BCD Numbers 385
Illustrative Example 387
Decimal Versus Binary Arithmetic 389
Summary 390
19 Recursion 391
Introduction 391
Our First Program 392
Illustrative Examples 394
Recursion Versus Iteration 400
Summary 401
20 Protected-Mode Interrupt Processing 403
Introduction 403
A Taxonomy of Interrupts 404
Interrupt Processing in the Protected Mode 405
Exceptions 408
Software Interrupts 410
File I/O 411
Our First Program 415
Illustrative Examples 415
Hardware Interrupts 418
Direct Control of I/O Devices 419
Summary 420
21 High-Level Language Interface 423
Introduction 423
Calling Assembly Procedures from C 424
Our First Program 427
Illustrative Examples 428
Calling C Functions from Assembly . 432
Inline Assembly 434
Summary 441
22 Floating-Point Operations 443
Introduction 443
Floating-Point Unit Organization 444
Floating-Point Instructions 447
Our First Program 453
Illustrative Examples 455
Summary 458
APPENDICES 459
A Number Systems 461
Positional Number Systems 461
Conversion to Decimal 463
Conversion from Decimal 463
Binary/Octal/Hexadecimal Conversion 464
Unsigned Integers 466
Signed Integers 466
Floating-Point Representation 469
Summary 471
B Character Representation 473
Character Representation 473
ASCII Character Set 474
C Programming Exercises 477
D IA-32 Instruction Set 485
Instruction Format 485
Selected Instructions 487
E Glossary 517
Index 527

Assembly language - Wikipedia, the free encyclopedia
Introduction to Assembly Language - Swanson Technologies
Other Programming Language Books
Other Linux Books
Download

Tuesday, December 13, 2011

Beowulf Cluster Computing With Linux (William)






Beowulf Cluster Computing with Linux, Second Edition
by William Gropp, Ewing Lusk and Thomas Sterling (eds) ISBN:0262692929
The MIT Press © 2003 (618 pages)
This how-to guide provides step-by-step instructions for building a Beowulf-type computer, including the physical elements that make up a clustered PC, the software required, and insights on how to organize the code to exploit parallelism.




Table of Contents
Beowulf Cluster Computing with Linux, Second Edition
Series Foreword
Foreword
Preface to - the Second Edition
Preface to - the First Edition
Chapter 1 - So You Want to Use a Cluster
Part I - Enabling Technologies
Chapter 2 - Node Hardware
Chapter 3 - Linux
Chapter 4 - System Area Networks
Chapter 5 - Configuring and Tuning Cluster Networks
Chapter 6 - Setting up Clusters
Part II - Parallel Programming
Chapter 7 - An Introduction to Writing Parallel Programs for Clusters
Chapter 8 - Parallel Programming with MPI
Chapter 9 - Advanced Topics in MPI Programming
Chapter 10 - Parallel Virtual Machine
Chapter 11 - Fault-Tolerant and Adaptive Programs with PVM
Chapter 12 - Numerical and Scientific Software for Clusters
Part III - Managing Clusters
Chapter 13 - Cluster Management
Chapter 14 - Cluster Workload Management
Chapter 15 - Condor: A Distributed Job Scheduler
Chapter 16 - Maui Scheduler: A High Performance Cluster Scheduler
Chapter 17 - PBS: Portable Batch System
Chapter 18 - Scyld Beowulf
Chapter 19 - Parallel I/O and the Parallel Virtual File System
Chapter 20 - A Tale of Two Clusters: Chiba City and Jazz
Chapter 21 - Conclusions
Appendix A - Glossary of Terms
Appendix B - Annotated Reading List
Appendix C - Annotated URLs
References
Index
List of Figures
List of Tables


Another HPC Books
Another Linux Books
Download CHM or Download PDF

Beowulf Cluster Computing with Linux






Beowulf Cluster Computing with Linux
By Thomas Sterling

Publisher: MIT Press
Publish Date: October 2001
ISBN: 0262692740
Pages : 496

A clear, comprehensive explanation of Beowulf for Linux. Beowulf clusters, which exploit mass-market PC hardware and software in conjunction with cost-effective commercial network technology, are becoming the platform for many scientific, engineering, and commercial applications. With growing popularity has come growing complexity.

Addressing that complexity, Beowulf Cluster Computing with Linux and Beowulf Cluster Computing with Windows provide system users and administrators with the tools they need to run the most advanced Beowulf clusters.

The book is appearing in both Linux and Windows versions in order to reach the entire PC cluster community, which is divided into two distinct camps according to the node operating system. Each book consists of three stand-alone parts. The first provides an introduction to the underlying hardware technology, assembly, and configuration. The second part offers a detailed presentation of the major parallel programming librairies. The third, and largest, part describes software infrastructures and tools for managing
cluster resources.

This includes some of the most popular of the software packages
available for distributed task scheduling, as well as tools for
monitoring and administering system resources and user
accounts. Approximately 75% of the material in the two books is
shared, with the other 25% pertaining to the specific operating
system. Most of the chapters include text specific to the operating
system. The Linux volume includes a discussion of parallel file
systems.

Another Linux Books
Another HPC Books
Download or Download

Monday, November 14, 2011

A Practical Guide to Linux Commands, Editors and Shell programming






Praise for the First Edition of A Practical Guide to Linux Commands, Editors, and Shell Programming

“First Sobell taught people how to use Linux…now he teaches you the power of Linux. A must-have book for anyone who wants to take Linux to the next level.”
—Jon “maddog” Hall, Executive Director, Linux International

“This book is a very useful tool for anyone who wants to ‘look under the hood’ so to speak, and really start putting the power of Linux to work. What I find particularly frustrating about man pages is that they never include examples. Sobell, on the other hand, outlines very clearly what the command does and then gives several common, easy-tounderstand examples that make it a breeze to start shell programming on one’s own. As with Sobell’s other works, this is simple, straight-forward, and easy to read. It’s a great book and will stay on the shelf at easy arm’s reach for a long time.”
—Ray Bartlett, Travel Writer

“Overall I found this book to be quite excellent, and it has earned a spot on the very front of my bookshelf. It covers the real ‘guts’ of Linux—the command line and its utilities—and does so very well. Its strongest points are the outstanding use of examples, and the Command Reference section. Highly recommended for Linux users of all skill levels. Well done to Mark Sobell and Prentice Hall for this outstanding book!”
—Dan Clough, Electronics Engineer and Slackware Linux user

“Totally unlike most Linux books, this book avoids discussing everything via GUI and jumps right into making the power of the command line your friend.”
—Bjorn Tipling, Software Engineer, ask.com

“This book is the best distro-agnostic, foundational Linux reference I’ve ever seen, out of dozens of Linux-related books I’ve read. Finding this book was a real stroke of luck. If you want to really understand how to get things done at the command line, where the power and flexibility of free UNIX-like OSes really live, this book is among the best tools you’ll find toward that end.”
—Chad Perrin, Writer, TechRepublic

Praise for Other Books by Mark G. Sobell

“I keep searching for books that collect everything you want to know about a subject in one place, and keep getting disappointed. Usually the books leave out some important topic, while others go too deep in some areas and must skim lightly over the others. A Practical Guide to Red Hat® Linux® is one of those rare books that actually pulls it off. Mark G. Sobell has created a single reference for Red Hat Linux that can’t be beat! This marvelous text (with a 4-CD set of Linux Fedora Core 2 included) is well worth the price. This is as close to an ‘everything you ever needed to know’ book that I’ve seen. It’s just that good and rates 5 out of 5.”
—Ray Lodato, Slashdot contributor

“Mark Sobell has written a book as approachable as it is authoritative.”
—Jeffrey Bianchine, Advocate, Author, Journalist

“Excellent reference book, well suited for the sysadmin of a Linux cluster, or the owner of a PC contemplating installing a recent stable Linux. Don’t be put off by the daunting heft of the book. Sobell has strived to be as inclusive as possible, in trying to anticipate your system administration needs.”
—Wes Boudville, Inventor

“A Practical Guide to Red Hat® Linux® is a brilliant book. Thank you Mark Sobell.”
—C. Pozrikidis, University of California at San Diego

“This book presents the best overview of the Linux operating system that I have found. . . . [It] should be very helpful and understandable no matter what the reader’s background: traditional UNIX user, new Linux devotee, or even Windows user. Each topic is presented in a clear, complete fashion, and very few assumptions are made about what the reader knows. . . . The book is extremely useful as a reference, as it contains a 70-page glossary of terms and is very well indexed. It is organized in such a way that the reader can focus on simple tasks without having to wade through more advanced topics until they are ready.”
—Cam Marshall, Marshall Information Service LLC, Member of Front Range UNIX Users Group [FRUUG], Boulder, Colorado

“Conclusively, this is THE book to get if you are a new Linux user and you just got into the RH/Fedora world. There’s no other book that discusses so many different topics and in such depth.”
—Eugenia Loli-Queru, Editor in Chief, OSNews.com


Another OpenSource Books
Another Linux Books
Download

Thursday, April 7, 2011

Interprocess Communications in Linux







Interprocess Communications in Linux®: The Nooks & Crannies
By John Shapley Gray

Publisher : Prentice Hall PTR
Pub Date : January 13, 2003
ISBN : 0-13-046042-7



Copyright
Introduction
Acknowledgments
Chapter 1. Programs and Processes
Section 1.1. Introduction
Section 1.2. Library Functions
Section 1.3. System Calls
Section 1.4. Linking Object Code
Section 1.5. Managing Failures
Section 1.6. Executable File Format
Section 1.7. System Memory
Section 1.8. Process Memory
Section 1.9. The u Area
Section 1.10. Process Memory Addresses
Section 1.11. Creating a Process
Section 1.12. Summary
Section 1.13. Key Terms and Concepts

Section 2.1. Introduction
Section 2.2. Process ID
Section 2.3. Parent Process ID
Section 2.4. Process Group ID
Section 2.5. Permissions
Section 2.6. Real and Effective User and Group IDs
Section 2.7. File System Information
Section 2.8. File Information
Section 2.9. Process Resource Limits
Section 2.10. Signaling Processes
Section 2.11. Command-Line Values
Section 2.12. Environment Variables
Section 2.13. The /proc Filesystem
Section 2.14. Summary
Section 2.15. Key Terms and Concepts

Chapter 3. Using Processes
Section 3.1. Introduction
Section 3.2. The fork System Call Revisited
Section 3.3. exec's Minions
Section 3.4. Using fork and exec Together
Section 3.5. Ending a Process
Section 3.6. Waiting on Processes
Section 3.7. Summary
Section 3.8. Key Terms and Concepts

Chapter 4. Primitive Communications
Section 4.1. Introduction
Section 4.2. Lock Files
Section 4.3. Locking Files
Section 4.4. More About Signals
Section 4.5. Signal and Signal Management Calls
Section 4.6. Summary
Section 4.7. Key Terms and Concepts

Chapter 5. Pipes
Section 5.1. Introduction
Section 5.2. Unnamed Pipes
Section 5.3. Named Pipes
Section 5.4. Summary
Section 5.5. Key Terms and Concepts

Chapter 6. Message Queues
Section 6.1. Introduction
Section 6.2. IPC System Calls: A Synopsis
Section 6.3. Creating a Message Queue
Section 6.4. Message Queue Control
Section 6.5. Message Queue Operations
Section 6.6. A Client–Server Message Queue Example
Section 6.7. Message Queue Class
Section 6.8. Summary
Section 6.9. Key Terms and Concepts

Chapter 7. Semaphores
Section 7.1. Introduction
Section 7.2. Creating and Accessing Semaphore Sets
Section 7.3. Semaphore Control
Section 7.4. Semaphore Operations
Section 7.5. Semaphore Class
Section 7.6. Summary
Section 7.7. Key Terms and Concepts

Chapter 8. Shared Memory
Section 8.1. Introduction
Section 8.2. Creating a Shared Memory Segment
Section 8.3. Shared Memory Control
Section 8.4. Shared Memory Operations
Section 8.5. Using a File as Shared Memory
Section 8.6. Shared Memory Class
Section 8.7. Summary
Section 8.8. Key Terms and Concepts

Chapter 9. Remote Procedure Calls
Section 9.1. Introduction
Section 9.2. Executing Remote Commands at a System Level
Section 9.3. Executing Remote Commands in a Program
Section 9.4. Transforming a Local Function Call into a Remote Procedure
Section 9.5. Debugging RPC Applications
Section 9.6. Using RPCGEN to Generate Templates and a MAKEFILE
Section 9.7. Encoding and Decoding Arbitrary Data Types
Section 9.8. Using Broadcasting to Search for an RPC Service
Section 9.9. Summary
Section 9.10. Key Terms and Concepts

Chapter 10. Sockets
Section 10.1. Introduction
Section 10.2. Communication Basics
Section 10.3. IPC Using Socketpair
Section 10.4. Sockets: The Connection-Oriented Paradigm
Section 10.5. Sockets: The Connectionless Paradigm
Section 10.6. Multiplexing I/O with select
Section 10.7. Peeking at Data
Section 10.8. Out of Band Messages
Section 10.9. Summary
Section 10.10. Key Terms and Concepts

Chapter 11. Threads
Section 11.1. Introduction
Section 11.2. Creating a Thread
Section 11.3. Exiting a Thread
Section 11.4. Basic Thread Management
Section 11.5. Thread Attributes
Section 11.6. Scheduling Threads
Section 11.7. Using Signals in Threads
Section 11.8. Thread Synchronization
Section 11.9. Thread-Specific Data
Section 11.10. Debugging Multithreaded Programs
Section 11.11. Summary
Section 11.12. Nomenclature and Key Concepts

Appendix A. Using Linux Manual Pages
Section A.1. Manual Page Sections
Section A.2. Manual Page Format
Section A.3. Standard Linux System Calls

Appendix B. UNIX Error Messages
Appendix C. RPC Syntax Diagrams
Section C.1. Introduction
Section C.2. RPC Definitions
Section C.3. RPC Keywords
Section C.4. Some RPC Examples

Appendix D. Profiling Programs
Section D.1. Introduction
Section D.2. Sample Program for Profiling
Section D.3. Generating Profile Data
Section D.4. Viewing and Interpreting Profile Data

Appendix E. Bibliography

Another Linux Books
Another Open Source Books
Another Parallel Programming Books
Download

Thursday, March 3, 2011

A Practical Guide To Ubuntu Linux






Contents
Preface xxxvi
Chapter 1: Welcome to Linux 1
The GNU–Linux Connection 2
The History of GNU–Linux 2
The Code Is Free 4
Have Fun! 5
The Linux 2.6 Kernel 5
The Heritage of Linux: UNIX 5
What Is So Good About Linux? 6
Why Linux Is Popular with Hardware Companies and Developers 7
Linux Is Portable 8
Standards 9
The C Programming Language 9
Ubuntu Linux 10
Overview of Linux 10
Linux Has a Kernel Programming Interface 10
Linux Can Support Many Users 11
Linux Can Run Many Tasks 11
Linux Provides a Secure Hierarchical Filesystem 12
The Shell: Command Interpreter and Programming Language
A Large Collection of Useful Utilities 14
Interprocess Communication 14
System Administration 15
Additional Features of Linux 15
GUIs: Graphical User Interfaces 15
(Inter)Networking Utilities 16
Software Development 17
Conventions Used in This Book 17
Chapter Summary 20
Exercises 20
PART I Installing Ubuntu Linux 21
Chapter 2: Installation Overview 23
The Live/Install Desktop CD/DVD 24
More Information 24
Planning the Installation 25
Considerations 25
Requirements 25
Processor Architecture 26
Interfaces: Installer and Installed System 27
Ubuntu Releases 28
Ubuntu Editions 28
Installing a Fresh Copy or Upgrading an Existing Ubuntu System? 29
Setting Up the Hard Disk 30
RAID 34
LVM: Logical Volume Manager 35
The Installation Process 36
Downloading and Burning a CD/DVD 37
The Easy Way to Download a CD ISO Image File 37
Other Ways to Download a CD/DVD ISO Image File 37
Verifying an ISO Image File 40
Burning the CD/DVD 40
Gathering Information About the System 41
Chapter Summary 42
Exercises 43
Advanced Exercises 43
Chapter 3: Step-by-Step Installation 45
Basic Installation from the Live/Install Desktop CD/DVD 46
Booting the System 46
Checking the CD/DVD for Defects 47
Live Session 47
Graphical Partitioners 53
gparted: the GNOME Partition Editor 53
ubiquity: Setting Up Partitions 56
Upgrading to a New Release 59
Installing KDE 60
Setting Up a Dual-Boot System 61
Creating Free Space on a Windows System 61
Installing Ubuntu Linux as the Second Operating System 61
Advanced Installation 62
The Live/Install Desktop CD: The Initial Install Screen 62
The Alternate CD Initial Install Screen Menu 65
The Server CD Initial Install Screen Menu 66
The DVD 67
The Ubuntu Textual Installer 67
The X Window System 74
displayconfig-gtk: Configures the Display 75
The xorg.conf File 77
gdm: Displays a Graphical Login 82
Chapter Summary 83
Exercises 83
Advanced Exercises 84
PART II Getting Started with Ubuntu Linux 85
Chapter 4: Introduction to Ubuntu Linux 87
Curbing Your Power: root Privileges/sudo 88
A Tour of the Ubuntu Linux Desktop 89
Logging In on the System 89
Introduction 90
Launching Programs from the Desktop 91
Switching Workspaces 93
Setting Personal Preferences 94
Mouse Preferences 95
Working with Windows 96
Using Nautilus to Work with Files 96
The Update Notifier 100
Changing Appearances (Themes) 102
Session Management 104
Getting Help 104
Feel Free to Experiment 105
Logging Out 105
Getting the Most out of the Desktop 105
GNOME Desktop Terminology 105
Opening Files 106
Panels 107
The Main Menu 110
Windows 111
The Object Context Menu 115
Updating, Installing, and Removing Software Packages 119
Software Sources Window 119
Add/Remove Applications 120
Synaptic: Finds, Installs, and Removes Software 121
Where to Find Documentation 124
Ubuntu Help Center 124
man: Displays the System Manual 124
info: Displays Information About Utilities 126
The ––help Option 129
HOWTOs: Finding Out How Things Work 129
Getting Help with the System 130
More About Logging In 132
The Login Screen 132
What to Do if You Cannot Log In 133
Logging In Remotely: Terminal Emulators, ssh, and Dial-Up Connections 133
Logging In from a Terminal (Emulator) 134
Changing Your Password 135
Using Virtual Consoles 136
Working from the Command Line 136
Correcting Mistakes 137
Repeating/Editing Command Lines 139
Controlling Windows: Advanced Operations 139
Changing the Input Focus 139
Changing the Resolution of the Display 140
The Window Manager 141
Chapter Summary 142
Exercises 143
Advanced Exercises 144
Chapter 5: The Linux Utilities 145
Special Characters 146
Basic Utilities 147
ls: Lists the Names of Files 147
cat: Displays a Text File 147
rm: Deletes a File 148
less Is more: Display a Text File One Screen at a Time 148
hostname: Displays the System Name 149
Working with Files 149
cp: Copies a File 149
mv: Changes the Name of a File 150
lpr: Prints a File 151
grep: Searches for a String 151
head: Displays the Beginning of a File 152
tail: Displays the End of a File 152
sort: Displays a File in Order 153
uniq: Removes Duplicate Lines from a File 154
diff: Compares Two Files 154
file: Tests the Contents of a File 155
| (Pipe): Communicates Between Processes 156
Four More Utilities 157
echo: Displays Text 157
date: Displays the Time and Date 157
script: Records a Shell Session 158
unix2dos: Converts Linux and Macintosh Files to Windows Format
Compressing and Archiving Files 159
bzip2: Compresses a File 160
bunzip2 and bzcat: Decompress a File 160
gzip: Compresses a File 161
tar: Packs and Unpacks Archives 161
Locating Commands 164
which and whereis: Locate a Utility 164
apropos: Searches for a Keyword 165
slocate: Searches for a File 166
Obtaining User and System Information 166
who: Lists Users on the System 167
finger: Lists Users on the System 167
w: Lists Users on the System 169
Communicating with Other Users 170
write: Sends a Message 170
mesg: Denies or Accepts Messages 171
Email 171
Tutorial: Creating and Editing a File with vim 172
Starting vim 172
Command and Input Modes 174
Entering Text 175
Getting Help 176
Ending the Editing Session 178
The compatible Parameter 179
Chapter Summary 179
Exercises 181
Advanced Exercises 182
Chapter 6: The Linux Filesystem 183
The Hierarchical Filesystem 184
Directory Files and Ordinary Files 184
Filenames 185
The Working Directory 188
Your Home Directory 188
Pathnames 189
Absolute Pathnames 189
Relative Pathnames 190
Directory Commands 191
mkdir: Creates a Directory 191
Imprtant Standard Directories and Files 194
Working with Directories 196
rmdir: Deletes a Directory 196
Using Pathnames 197
mv, cp: Move or Copy Files 197
mv: Moves a Directory 198
Access Permissions 199
ls –l: Displays Permissions 199
chmod: Changes Access Permissions 200
Setuid and Setgid Permissions 201
Directory Access Permissions 202
ACLs: Access Control Lists 203
Enabling ACLs 204
Working with Access Rules 204
Setting Default Rules for a Directory 207
Links 209
Hard Links 210
Symbolic Links 212
rm: Removes a Link 214
Chapter Summary 214
Exercises 216
Advanced Exercises 218
Chapter 7: The Shell 219
The Command Line 220
Syntax 220
Processing the Command Line 223
Executing the Command Line 225
Editing the Command Line 225
Standard Input and Standard Output 226
The Screen as a File 226
The Keyboard and Screen as Standard Input and Standard Output
Redirection 228
Pipes 234
Running a Program in the Background 237
Filename Generation/Pathname Expansion 239
The ? Special Character 239
* Special Character 240
The
The [ ] Special Characters 241
Builtins 243
Chapter Summary 244
Utilities and Builtins Introduced in This Chapter 245
Exercises 245
Advanced Exercises 247
PART III Digging into Ubuntu Linux 249
Chapter 8: Linux GUIs: X and GNOME 251
X Window System 252
Using X 254
Window Managers 259
The Nautilus File Browser Window 260
The View Pane 261
The Side Pane 261
Control Bars 262
Menubar 263
GNOME Utilities 266
Deskbar Applet 266
Font Preferences 267
Pick a Font Window 268
Pick a Color Window 268
Run Application Window 269
Searching for Files 269
GNOME Terminal Emulator/Shell 270
Chapter Summary 271
Exercises 272
Advanced Exercises 272
Chapter 9: The Bourne Again Shell 275
Background 276
Shell Basics 277
Startup Files 277
Commands That Are Symbols 280
Redirecting Standard Error 280
Writing a Simple Shell Script 282
Separating and Grouping Commands 286
Job Control 290
Manipulating the Directory Stack 292
Parameters and Variables 295
User-Created Variables 296
Variable Attributes 299
Keyword Variables 301
Special Characters 309
Processes 310
Process Structure 310
Process Identification 310
Executing a Command 312
History 312
Variables That Control History 312
Reexecuting and Editing Commands 314
The Readline Library 322
Aliases 328
Single Versus Double Quotation Marks in Aliases 329
Examples of Aliases 330
Functions 331
Controlling bash Features and Options 334
Command Line Options 334
Shell Features 334
Processing the Command Line 338
History Expansion 338
Alias Substitution 338
Parsing and Scanning the Command Line 338
Command Line Expansion 339
Chapter Summary 347
Exercises 349
Advanced Exercises 351
Chapter 10: Networking and the Internet 353
Types of Networks and How They Work 355
Broadcast Networks 356
Point-to-Point Networks 356
Switched Networks 356
LAN: Local Area Network 357
WAN: Wide Area Network 358
Internetworking Through Gateways and Routers 358
Network Protocols 361
Host Address 363
CIDR: Classless Inter-Domain Routing 367
Hostnames 368
Communicate Over a Network 370
finger: Displays Information About Remote Users 370
Sending Mail to a Remote User 371
Mailing List Servers 372
Network Utilities 372
Trusted Hosts 372
OpenSSH Tools 373
telnet: Logs In on a Remote System 373
ftp: Transfers Files Over a Network 375
ping: Tests a Network Connection 375
traceroute: Traces a Route Over the Internet 376
host and dig: Query Internet Nameservers 378
jwhois: Looks Up Information About an Internet Site 378
Distributed Computing 379
The Client/Server Model 380
DNS: Domain Name Service 381
Ports 383
NIS: Network Information Service 383
NFS: Network Filesystem 383
Internet Services 384
Proxy Servers 387
RPC Network Services 387
Usenet 388
WWW: World Wide Web 390
URL: Uniform Resource Locator 391
Browsers 392
Search Engines 392
Chapter Summary 392
Exercises 393
Advanced Exercises 394
Chapter 11: Programming the Bourne Again Shell 395
Control Structures 396
if...then 396
if...then...else 400
if...then...elif 403
for...in 409
for 410
while 412
until 416
break and continue 418
case 419
select 425
Here Document 427
File Descriptors 429
Parameters and Variables 432
Array Variables 432
Locality of Variables 434
Special Parameters 436
Positional Parameters 438
Expanding Null and Unset Variables 443
Builtin Commands 444
type: Displays Information About a Command 445
read: Accepts User Input 445
exec: Executes a Command 448
trap: Catches a Signal 451
kill: Aborts a Process 454
getopts: Parses Options 454
A Partial List of Builtins 457
Expressions 458
Arithmetic Evaluation 458
Logical Evaluation (Conditional Expressions) 459
String Pattern Matching 460
Operators 461
Shell Programs 466
A Recursive Shell Script 467
The quiz Shell Script 470
Chapter Summary 476
Exercises 478
Advanced Exercises 480
PART IV System Administration 483
Chapter 12: System Administration:
Core Concepts 485
Running Commands with root Privileges 487
sudo: Running a Command with root Privileges 490
sudoers: Configuring sudo 494
Unlocking the root Account (Assigning a Password to root)
su: Gives You Another User’s Privileges 499
The Upstart Event-Based init Daemon 500
Software Packages 501
Definitions 501
Jobs 503
SysVinit (rc) Scripts: Start and Stop System Services 507
System Operation 510
Runlevels 510
Booting the System 511
Recovery (Single-User) Mode 512
Going to Multiuser Mode 515
Logging In 516
Logging Out 517
Bringing the System Down 518
Crash 519
Avoiding a Trojan Horse 520
Getting Help 522
Textual System Administration Utilities 522
kill: Sends a Signal to a Process 522
Other Textual Utilities 525
Setting Up a Server 527
Standard Rules in Configuration Files 528
rpcinfo: Displays Information About portmap 530
The inetd and xinetd Superservers 531
Securing a Server 532
DHCP: Configures Network Interfaces 538
nsswitch.conf: Which Service to Look at First 542
How nsswitch.conf Works 542
PAM 545
More Information 546
Configuration Files, Module Types, and Control Flags 546
Example 548
Modifying the PAM Configuration 549
Chapter Summary 550
Exercises 551
Advanced Exercises 551
Chapter 13: Files, Directories, and Filesystems 553
Imprtant Files and Directories 554
File Types 566
Ordinary Files, Directories, Links, and Inodes 566
Special Files 567
Filesystems 570
mount: Mounts a Filesystem 572
umount: Unmounts a Filesystem 575
fstab: Keeps Track of Filesystems 576
fsck: Checks Filesystem Integrity 577
tune2fs: Changes Filesystem Parameters 578
RAID Filesystem 580
Chapter Summary 580
Exercises 580
Advanced Exercises 581
Chapter 14: Downloading and Installing Software 583
JumpStart: Installing and Removing Packages Using aptitude 585
Finding the Package That Holds a File You Need 587
APT: Keeps the System Up-to-Date 588
Repositories 588
sources.list: Specifies Repositories for APT to Search 589
The APT Local Package Indexes and the APT Cache 590
The apt cron Script and APT Configuration Files 590
aptitude: Works with Packages and the Local Package Index 592
apt-cache: Displays Package Information 596
apt-get source: Downloads Source Files 598
dpkg: The Debian Package Management System 598
deb Files 599
dpkg: The Foundation of the Debian Package Management System 600
BitTorrent 604
Installing Non-dpkg Software 607
The /opt and /usr/local Directories 607
GNU Configure and Build System 607
wget: Downloads Files Noninteractively 609
Chapter Summary 610
Exercises 610
Advanced Exercises 610
Chapter 15: Printing with CUPS 611
Introduction 612
Prerequisites 612
More Information 613
Notes 613
JumpStart I: Configuring a Local Printer 614
system-config-printer: Configuring a Printer 614
Configuration Tabs 614
Setting Up a Remote Printer 616
JumpStart II: Configuring a Remote Printer Using the CUPS Web Interface
Traditional UNIX Printing 622
Configuring Printers 624
The CUPS Web Interface 624
CUPS on the Command Line 626
Sharing CUPS Printers 629
Printing from Windows 630
Printing Using CUPS 631
Printing Using Samba 631
Printing to Windows 632
Chapter Summary 633
Exercises 633
Advanced Exercises 633
Chapter 16: Building a Linux Kernel 635
Prerequisites 636
Downloading the Kernel Source Code 637
aptitude: Downloading and Installing the Kernel Source Code 637
git: Obtaining the Latest Kernel Source Code 637
Read the Documentation 638
Configuring and Compiling the Linux Kernel 639
.config: Configures the Kernel 639
Customizing a Kernel 640
Cleaning the Source Tree 642
Compiling a Kernel Image File and Loadable Modules 643
Using Loadable Kernel Modules 643
Installing the Kernel, Modules, and Associated Files 646
Rebooting 647
grub: The Linux Boot Loader 647
menu.lst: Configures grub 648
update-grub: Updates the menu.lst file 651
grub-install: Installs the MBR and grub Files 653
dmesg: Displays Kernel Messages 654
Chapter Summary 655
Exercises 656
Advanced Exercises 656
Chapter 17: Administration Tasks 657
Configuring User and Group Accounts 658
users-admin: Manages User Accounts 658
useradd: Adds a User Account 660
userdel: Removes a User Account 661
usermod: Modifies a User Account 661
groupadd: Adds a Group 661
groupdel: Removes a Group 661
Backing Up Files 662
Choosing a Backup Medium 663
Backup Utilities 663
Performing a Simple Backup 665
dump , restore: Back Up and Restore Filesystems 666
Scheduling Tasks 668
cron and anacron: Schedule Routine Tasks 668
at: Runs Occasional Tasks 671
System Reports 671
vmstat: Reports Virtual Memory Statistics 671
top: Lists Processes Using the Most Resources 672
parted: Reports on and Partitions a Hard Disk 673
Keeping Users Informed 677
Creating Problems 678
Solving Problems 679
Helping When a User Cannot Log In 679
Speeding Up the System 680
lsof: Finds Open Files 681
Keeping a Machine Log 681
Keeping the System Secure 682
Log Files and Mail for root 683
Monitoring Disk Usage 683
logrotate: Manages Log Files 684
Removing Unused Space from Directories 686
Disk Quota System 687
syslogd: Logs System Messages 688
Chapter Summary 690
Exercises 690
Advanced Exercises 691
Chapter 18: Configuring a LAN 693
Setting Up the Hardware 694
Connecting the Computers 694
Routers 695
NIC: Network Interface Card 695
Tools 695
Configuring the Systems 697
network-admin: Configures Network Connections 698
nm-applet: Configures Network Connections Automatically 700
iwconfig: Configures a Wireless NIC 700
Setting Up Servers 702
More Information 703
Chapter Summary 703
Exercises 704
Advanced Exercises 704
PART V Using Clients and Setting Up Servers 705
Chapter 19: OpenSSH: Secure Network
Communication 707
Introduction 708
About OpenSSH 708
Files 708
How OpenSSH Works 710
More Information 711
OpenSSH Clients 711
Prerequisites 711
JumpStart: Using ssh and scp 711
Setup 712
ssh: Connects to or Executes Commands on a Remote System 714
scp: Copies Files to and from a Remote System 716
sftp: A Secure FTP Client 718
~/.ssh/config and /etc/ssh/ssh_config Configuration Files 718
sshd: OpenSSH Server 720
Prerequisites 720
Note 720
JumpStart: Starting the sshd Daemon 720
Authorized Keys: Automatic Login 721
Command Line Options 722
/etc/ssh/sshd_config Configuration File 722
Troubleshooting 724
Tunneling/Port Forwarding 725
Chapter Summary 727
Exercises 728
Advanced Exercises 728
Chapter 20: FTP: Transferring Files Across a Network 729
Introduction 730
More Information 731
FTP Client 731
Prerequisites 731
JumpStart I: Downloading Files Using ftp 732
Notes 735
Anonymous FTP 735
Automatic Login 735
Binary Versus ASCII Transfer Mode 736
ftp Specifics 736
FTP Server (vsftpd) 740
Prerequisites 740
Notes 740
JumpStart II: Starting a vsftpd Server 741
Testing the Setup 741
vsftpd.conf: The vsftpd Configuration File 742
Chapter Summary 753
Exercises 753
Advanced Exercises 754
Chapter 21: exim4: Setting Up Mail Servers,
Clients, and More 755
Introduction to exim4 756
Prerequisites 757
Notes 757
More Information 758
JumpStart I: Configuring exim4 to Use a Smarthost 758
JumpStart II: Configuring exim4 to Send and Receive Email 760
How exim4 Works 761
Mail Logs 762
Working with Messages 763
Aliases and Forwarding 763
Related Programs 765
Configuring exim4 765
Using a Text Editor to Configure exim4 766
The update-exim4.conf.conf Configuration File 766
dpkg-reconfigure: Configures exim4 768
SpamAssassin 768
Prerequisites 769
How SpamAssassin Works 769
Testing SpamAssassin 770
Configuring SpamAssassin 771
Additional Email Tools 772
Webmail 772
Mailing Lists 774
Setting Up an IMAP or POP3 Server 776
Authenticated Relaying 777
Alternatives to exim4 779
Chapter Summary 779
Exercises 780
Advanced Exercises 780
Chapter 22: NIS: Network Information Service 781
Introduction to NIS 782
How NIS Works 782
More Information 784
Setting Up an NIS Client 784
Prerequisites 785
Notes 785
Step-by-Step Setup 786
Testing the Setup 787
yppasswd: Changes NIS Passwords 788
Setting Up an NIS Server 790
Prerequisites 790
Notes 791
Step-by-Step Setup 791
Testing 796
yppasswdd: The NIS Password Update Daemon 797
Chapter Summary 798
Exercises 798
Advanced Exercises 798
Chapter 23: NFS: Sharing Filesystems 799
Introduction 800
More Information 802
Setting Up an NFS Client 802
Prerequisites 802
JumpStart I: Mounting a Remote Directory Hierarchy 803
mount: Mounts a Directory Hierarchy 804
Improving Performance 806
/etc/fstab: Mounts Directory Hierarchies Automatically 807
Setting Up an NFS Server 808
Prerequisites 808
Notes 808
JumpStart II: Configuring an NFS Server Using shares-admin 809
Manually Exporting a Directory Hierarchy 811
Where the System Keeps NFS Mount Information 815
exportfs: Maintains the List of Exported Directory Hierarchies 817
Testing the Server Setup 818
automount: Mounts Directory Hierarchies on Demand 818
Chapter Summary 821
Exercises 822
Advanced Exercises 822
Chapter 24: Samba: Linux and Windows File
and Printer Sharing 823
Introduction 824
About Samba 825
Prerequisites 825
More Information 825
Notes 825
Samba Users, User Maps, and Passwords 826
JumpStart: Configuring a Samba Server Using shares-admin 826
swat: Configures a Samba Server 828
smb.conf: Manually Configuring a Samba Server 832
Parameters in the smbd.conf File 832
The [homes] Share: Sharing Users’ Home Directories 838
Accessing Linux Shares from Windows 838
Browsing Shares 838
Mapping a Share 839
Accessing Windows Shares from Linux 839
smbtree: Displays Windows Shares 839
smbclient: Connects to Windows Shares 840
Browsing Windows Networks 840
Mounting Windows Shares 841
Troubleshooting 841
Chapter Summary 844
Exercises 844
Advanced Exercises 844
Chapter 25: DNS/BIND: Tracking Domain Names
and Addresses 845
Introduction to DNS 846
Nodes, Domains, and Subdomains 846
Zones 848
Queries 849
Servers 850
Resource Records 851
DNS Query and Response 854
Reverse Name Resolution 855
About DNS 857
How DNS Works 857
Prerequisites 857
More Information 858
Notes 858
JumpStart I: Setting Up a DNS Cache 858
Setting Up BIND 860
named.conf: The named Configuration File 860
Zone Files 863
A DNS Cache 864
DNS Glue Records 868
TSIGs: Transaction Signatures 868
Running BIND in a chroot Jail 870
Troubleshooting 872
A Full-Functioned Nameserver 873
A Slave Server 877
A Split Horizon Server 878
Chapter Summary 883
Exercises 883
Advanced Exercises 884
Chapter 26: firestarter and iptables: Setting
Up a Firewall 885
About firestarter 886
Prerequisites 886
Notes 887
More Information 888
JumpStart: Building a Firewall Using the firestarter Firewall Wizard 888
firestarter: Maintains a Firewall 890
The Status Tab 890
The Events Tab 892
The Policy Tab 894
How iptables Works 896
About iptables 899
More Information 899
Prerequisites 899
Notes 899
Anatomy of an iptables Command 900
Building a Set of Rules 901
Commands 901
Packet Match Criteria 903
Display Criteria 903
Match Extensions 903
Targets 906
Copying Rules to and from the Kernel 907
Sharing an Internet Connection Using NAT 908
Connecting Several Clients to a Single Internet Connection 910
Connecting Several Servers to a Single Internet Connection 912
Chapter Summary 912
Exercises 913
Advanced Exercises 913
Chapter 27: Apache: Setting Up a Web Server 915
Introduction 916
About Apache 917
Prerequisites 917
More Information 918
Notes 918
JumpStart: Getting Apache Up and Running 919
Modifying the Configuration Files 919
Testing Apache 920
Putting Your Content in Place 920
Configuring Apache 921
Configuration Tools 921
Include Directives 922
Filesystem Layout 923
Configuration Directives 925
Directives I: Directives You May Want to Modify as You Get Started 926
Contexts and Containers 931
Directives II: Advanced Directives 935
The Ubuntu apache2.conf File 948
The Ubuntu default Configuration File 950
Redirects 951
Content Negotiation 951
Type Maps 951
MultiViews 952
Server-Generated Directory Listings (Indexing) 953
Virtual Hosts 953
Setting Up a Virtual Host 954
Types of Virtual Hosts 954
The default Virtual Host 954
Examples 954
Troubleshooting 956
Modules 957
mod_cgi and CGI Scripts 958
mod_ssl 959
Authentication Modules and .htaccess 961
Scripting Modules 962
Multiprocessing Modules (MPMs) 963
webalizer: Analyzes Web Traffic 964
MRTG: Monitors Traffic Loads 964
Error Codes 964
Chapter Summary 965
Exercises 966
Advanced Exercises 966
PART VI Appendixes 969
Appendix A: Regular Expressions 971
Characters 972
Delimiters 972
Simple Strings 972
Special Characters 972
Periods 973
Brackets 973
Asterisks 974
Carets and Dollar Signs 974
Quoting Special Characters 975
Rules 975
Longest Match Possible 975
Empty Regular Expressions 976
Bracketing Expressions 976
The Replacement String 976
Ampersand 977
Quoted Digit 977
Extended Regular Expressions 977
Appendix Summary 979
Appendix B: Help 981
Solving a Problem 982
Finding Linux-Related Information 983
Documentation 983
Useful Linux Sites 984
Linux Newsgroups 985
Mailing Lists 985
Words 986
Software 986
Office Suites and Word Processors 988
Specifying a Terminal 988
Appendix C: Security 991
Encryption 992
Public Key Encryption 993
Symmetric Key Encryption 994
Encryption Implementation 995
GnuPG/PGP 995
File Security 997
Email Security 997
MTAs (Mail Transfer Agents) 997
MUAs (Mail User Agents) 998
Network Security 998
Network Security Solutions 999
Network Security Guidelines 999
Host Security 1001
Login Security 1002
Remote Access Security 1003
Viruses and Worms 1004
Physical Security 1004
Security Resources 1006
Appendix Summary 1009
Appendix D: The Free Software Definition 1011
Appendix E: The Linux 2.6 Kernel 1015
Native Posix Thread Library (NPTL) 1016
IPSecurity (IPSec) 1016
Asynchronous I/O (AIO) 1016
O(1) Scheduler 1017
OProfile 1017
kksymoops 1017
Reverse Map Virtual Memory (rmap VM) 1017
HugeTLBFS: Translation Look-Aside Buffer Filesystem 1018
remap_file_pages 1018
2.6 Network Stack Features (IGMPv3, IPv6, and Others) 1018
Internet Protocol Virtual Server (IPVS) 1019
Access Control Lists (ACLs) 1019
4GB-4GB Memory Split: Physical Address Extension (PAE) 1019
Scheduler Support for HyperThreaded CPUs 1019
Block I/O (BIO) Block Layer 1019
Support for Filesystems Larger Than 2 Terabytes 1020
New I/O Elevators 1020
Interactive Scheduler Response Tuning 1020
Glossary 1021
Index 1071


Another Open Source Books
Another Linux Books
Download
Related Posts with Thumbnails

Put Your Ads Here!