Computer System Security Unit 1
Computer System Security Unit 1
By
Dr. Shruti Bharadwaj
Unit 1
❑ Introduction
❑ What is Security? What I have to learn?
❑ Sample Attacks
❑ Marketplace for Vulnerabilities
❑ Error 404 Hacking digital India part I chase
---Continue
Vulnerability is a cyber-security term that refers to a flaw in a system that can leave
it open to attack. Vulnerable consumers fail to understand their preferences and/or
lack the knowledge, skills, or freedom to act on them. The aim is to significantly
replace trial and error with a robust understanding of markets, markets habitually
governed by social virtues.
Mobile Security as a concept deals with the protection of our mobile devices
from possible attacks by other mobile devices, or the wireless environment that
the device is connected to.
--Continue
Phishing (pronounced: fishing) is an attack that attempts to steal your money, or your
identity, by getting you to reveal personal information -- such as credit card numbers, bank
information, or passwords -- on websites that pretend to be legitimate.
Social engineering :is the term used for a broad range of malicious activities accomplished
through human interactions. It uses psychological manipulation to trick users into making
security mistakes or giving away sensitive information. Social engineering attacks happen in
one or more steps.
A man in the middle (MITM) attack is a general term for when a perpetrator positions
himself in a conversation between a user and an application—either to eavesdrop or to
impersonate one of the parties, making it appear as if a normal exchange of information is
underway.
The goal of an attack is to steal personal information, such as login credentials, account
details and credit card numbers. Targets are typically the users of financial applications,
SaaS businesses, e-commerce sites and other websites where logging in is required.
Control hijacking
1. Hijacking is a type of network security attack in which the attacker takes control of a
communication .
2. In hijacking ( also known as a man in the middle attack ) , the perpetrator takes control
of an established connection while it is in progress .
3. The attacker intercepts messages in a public key exchange and then retransmits them ,
substituting their own public key for the requested one , so that the two original parties
still appear to be communicating with each other directly .
4. The attacker uses a program that appears to be the server to the client and appears to be
the client to the server.
5. This attack may be used simply to gain access to the messages , or to enable the attacker
to modify them before retransmitting them .
6. Attacker's goal in control hijacking : takeover target machine ( for example web server
) by Execute arbitrary code on target by hijacking application control flow.
Attacker Needs to Perform Control Hijacking
▪ Is dependent on data properties that are enforced beyond its immediate scope
❑ The buffer overflow exploit techniques a hacker uses depends on the architecture and
operating system being used by their target.
❑ However, the extra data they issue to a program will likely contain malicious code that
enables the attacker to trigger additional actions and send new instructions to the
application.
❑ For example, introducing additional code into a program could send it new instructions
that give the attacker access to the organization’s IT systems.
❑ In the event that an attacker knows a program’s memory layout, they may be able to
intentionally input data that cannot be stored by the buffer.
❑ This will enable them to overwrite memory locations that store executable code and
replace it with malicious code that allows them to take control of the program.
Buffer Overflow Consequences
❑System crashes: A buffer overflow attack will typically lead to the system
crashing. It may also result in a lack of availability and programs being put
into an infinite loop.
❑Access control loss: A buffer overflow attack will often involve the use of
arbitrary code, which is often outside the scope of programs’ security
policies.
❑Further security issues: When a buffer overflow attack results in arbitrary
code execution, the attacker may use it to exploit other vulnerabilities and
subvert other security services.
Types of Buffer Overflow Attacks
There are several types of buffer overflow attacks that attackers use to exploit
organizations’ systems. The most common are:
❑ Stack-based buffer overflows: This is the most common form of buffer overflow
attack. The stack-based approach occurs when an attacker sends data containing
malicious code to an application, which stores the data in a stack buffer. This
overwrites the data on the stack, including its return pointer, which hands control of
transfers to the attacker.
❑ Heap-based buffer overflows: A heap-based attack is more difficult to carry out than
the stack-based approach. It involves the attack flooding a program’s memory space
beyond the memory it uses for current runtime operations.
How to Prevent Buffer Overflows
For example, we have a 16-bit integer value which may store an unsigned
integer ranging from 0 to 65535, or signed integer ranging from -32768 to
32767. So, during an arithmetic operation, if the results require more than the
allocated space (like 65535+1), the compiler may: completely ignore the error
caused, or abort the program.
Format String Vulnerability
❑ A format string vulnerability is a bug where user input is passed as the format argument
to printf, scanf, or another function in that family.
❑ The format argument has many different specifies which could allow an attacker to leak data if
they control the format argument to printf. Since printf and similar are variadic functions, they
will continue popping data off of the stack according to the format.
❑ For example, if we can make the format argument "%x.%x.%x.%x", printf will pop off four
stack values and print them in hexadecimal, potentially leaking sensitive information.
❑ printf can also index to an arbitrary "argument" with the following syntax: "%n$x" (where n is
the decimal index of the argument you want).
❑ While these bugs are powerful, they're very rare nowadays, as all modern compilers warn
when printf is called with a non-constant string.
-----Continue (Example)
#include <stdio.h>
#include <unistd.h>
int main()
{ int secret_num = 0x8badf00d;
char name[64] = {0}; read(0, name, 64);
printf("Hello ");
printf(name);
printf("! You'll never get my secret!\n");
return 0; }
Due to how GCC decided to lay out the stack, secret_num is actually at a lower address on the stack than name, so we only have to go to the 7th "argument" in printf to leak the secret:
$ ./fmt_string %7$llx
Hello 8badf00d3ea43eef
! You'll never get my secret!