Advanced Topics in Network Security
Total Page:16
File Type:pdf, Size:1020Kb
AdvancedAdvanced TopicsTopics inin NetworkNetwork SecuritySecurity Network Attacks (Lecture #16) Instructor : Sheau-Dong Lang [email protected] School of Electrical Engineering & Computer Science University of Central Florida 1 IntroductionIntroduction Reference for this lecture nd Hack Proofing Your Network, 2nd Edition, Syngress How serious a particular attack is depends on How the attack iiss carricarrieded out What damage is done to the comprimised system Example Home users: An attattackeracker being able to run code on user’s machine E-commerce company Denial of Service (DOS) attack Information leakage 2 DifferentDifferent TypesTypes ofof AttacksAttacks Denial of Service (DOS) Information Leakage Regular File Access Misinformation Database Access Remote Arbitrary Code Execution Elevation of Privileages 3 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) Definition Availability to a resource is intentionally blocked or degraded by an attacker Two Categories Local Vector Denial of Service AttAttackack from the local system Network Vector Denial of Service Attack remotely from across a network 4 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) Local Vector Denial of Service AttAttackack from the local system Common but preventable These types of attacks can be easily traced and the attacker can be identified with right security infrastructure Three types - Process degradation - Disk space exhaustion - i-node exhaustion (Unix specific) 5 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) LocalLocal VectorVector DenialDenial ofof ServiceService Process Degradation Reduces performance by overloading the target system [Methods] Spawning multiple processes to eat up all available resources Spawning enough processes to fill to capacity of the system process table Spawning enough processes to overload the CPU 6 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) LocalLocal VectorVector DenialDenial ofof ServiceService [EX] Vulnerabilities in LINUX kernel before version 2.4.12 By creating a deep symbolic link, a user can prevent the scheduling of other processes when an attattemptempt to reference the symbolic link is made Upon creating the symbolic link, attempting to perform “cat” of one of the deeply links files, the process scheduler is blocked Æ preventing any other processes on the system from receiving CPU time Solution: fix and upgrade the OS kernel [EX] fork bomb Degrade the system performance witwithh flooded processes Not specific to Linux, it affects a number of OSs on various platforms 1 line of code for a fork bomb: void main() { for (;;) fork();} Solution: Limit the number of processes per user 7 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) LocalLocal VectorVector DenialDenial ofof ServiceService Disk Space Exhaustion Fills disk space to capacity UNIX systems crash when the root partition reaches storage capacity Not an OS design flaw Need to administrate the storage safely Separate directories, /home, /var, /usr/local, etc [EX] Filling a disk with garbage values 1 line of code cat /dev/zero > ~/maliciousfile /dev/zero simply generates zeros and this operation continues until the user stops the process or the partition is full [EX] Mail bomb Not commonly used Å mail is easily traced via SMTP headers Most mail bombers were jailed, without Internet access, or both 8 (Appendix)(Appendix) SpecialSpecial DevicesDevices inin LinuxLinux /dev/null Linux discards whatever you write to this device you can discard output from a program read from this device results in EOF copy this file to another file results in a zero size file /dev/zero infinite long file filled with 0 if you need n zeroes, mmap this file for the desired size /dev/full mimic a file with no more room useful to stress test a program to test for the case when the disk is full 9 (Appendix)(Appendix) specialspecial devicesdevices /dev/random /dev/urandom /dev/random generates random number based on your actions on mouse and keyboard generates only a limited number of random numbers but perfectly random /dev/urandom generates generates an infinite number of random numbers not perfect numbers from rand() function are reproducible 10 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) LocalLocal VectorVector DenialDenial ofof ServiceService I-node (index node) Exhaustion : specific to UNIX file system Similar to disk capcapacityacity attack Is focused on the design of the file systems When a file system is formatted, a finite nnumberumber of inodes are created [EX] using up all the available inodes for the partition WithouWithoutt filling the disk actually, it can create the similar situation System is unable to ccreatereate new files UNIX System V i-node Structure 11 (Appendix)(Appendix) FileFile SystemsSystems File System It provides the mechanism for on-line storage of and access to both data and programs of the operating system and all the users of the computer system Resides permanently on secondary storage (hard disk) Three components of a file system Files : collection of information (data, program, etc.) Directory structures : organizes and provides information about all the files in the system Partitions : separates pphysicallyhysically or logically collections of directories 12 (Appendix)(Appendix) LinkedLinked AllocationAllocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. block = pointer 13 (Appendix)(Appendix) LinkedLinked AllocationAllocation (Cont.)(Cont.) Advantages Simple: need only starting address in directory Free-space management system No external fragmentation Æ no need for compaction Disadvantages No random access How can we access i th block in the file? Æ need to traverse the list Space overhead for the pointers Block size = 512 bytes, pointer size = 4 bytes Æ 0.78% overhead Reliability What if a pointer is lost? 14 (Appendix)(Appendix) LinkedLinked AllocationAllocation 15 (Appendix)(Appendix) FATFAT (File(File AllocationAllocation Table)Table) Variation of the linked allocation scheme MS-DOS and OS/2 At the beginning of a partition, there is a FAT Instead of making each block maintain the pointer, a dedicated table contains all the pointer information (Advantage) Simple and efficient (ex) allocating a new block Æ finding the first 0-valued table entry Improved random access time Å witwithouthout moving the disk head, we can find the location of the block (Disadvantage) Excessive disk head movements to access FAT to look up the pointer 16 (Appendix)(Appendix) FileFile--AllocationAllocation TableTable 17 (Appendix)(Appendix) IndexedIndexed AllocationAllocation Brings all pointers together into tthehe index block. Logical view. index table 18 (Appendix)(Appendix) ExampleExample ofof IndexedIndexed AllocationAllocation Index table can be located in the main memory 19 (Appendix)(Appendix) IndexedIndexed AllocationAllocation (Cont.)(Cont.) Trying to solve the problem of excessive random access time in linked allocation Each file has its own index table Each entry has a disk block address Advantage Faster random access No external fragmentation Disadvantage overhead of index block. (ex) what if a file has only 2 blocks and we still need a fixed size index table, usually tthehe size of one block 20 (Appendix)(Appendix) IndexedIndexed AllocationAllocation –– MappingMapping (Cont.)(Cont.) Mapping from logical to physicphysicalal in a file of unbounded length (block size of 512 words). Linked scheme – Link blocks of index table (no limit on size). 21 (Appendix)(Appendix) MultiMulti--levellevel indexindex schemescheme M outer-index index table file 22 (Appendix)(Appendix) ii--nodenode (UNIX(UNIX filefile system),system), combinedcombined schemescheme Direct blocks – addresses of data blocks Single indirect – one level index Double indirect – two levlevelel index Triple indirect – three level index (Question) what would be the maximum file size? Block size = 64 bytes, block pointer size = 4 bytes (Answer) direct blocks = 13*64 bytes single indirect = 16*64 bytes double indirect = 16*16*64 bytes Triple indirect = 16*16*16*64 bytes Then, add all those numbers 23 (Appendix)(Appendix) CombinedCombined Scheme:Scheme: UNIXUNIX 24 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) Network Vector Denial of Service Two ccategoriesategories An attattackack that affects a specific service An attack that targets an entire system Three types Client-Side Network DoS Service-Based Network DoS System-Directed Network DoS 25 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) NetworkNetwork VectorVector DenialDenial ofof ServiceService Client Side Network DoS Typically targeted at a specific product Render the user of the client incapable of performing any activity with the client [EX] JavaScript Bomb By default, web browser enables JavaScript JavaScript can be used in a number of malicious ways including launching a DoS against a client Æ never-ending loop of window creation Æ resource starvation eventualleventuallyy 26 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) NetworkNetwork VectorVector DenialDenial ofof ServiceService Service Side Network DoS Targeted at a specific service Render the service unavailable to legitimate users Attacks are usually launched at services such as HTTPD, Mail Transport Agent (MTA), etc 27 (1)(1) DenialDenial ofof ServiceService (DOS)(DOS) NetworkNetwork VectorVector DenialDenial ofof ServiceService System-Directed Network DoS Used