Information Security
Information Security
MOD:
X-X/Y*Y
Dec:
Crypto
A-Za-z1-0 !?.
0-25,26-51,52-61, is 62, . is 65
C=aP+b mod 26
M^e mod n
Message=13
11*7
13^7 mod 77
n=p*q
decrypt:
inverse of e mode(p-1)(q-1)
7(0) mod 60
....
43 = 1
7*43 mod 60
301-301 / 60*60= 1
Forensics
Key/tabs etc, initiate a shortcut file, it logs all the actions you perform and stores in app
data
Stores:
Full file path, network number created on the source, serial number, attributes, size,
creation time, hotkeys
Time stamps have 2 types normal and unix. Starts from utc is 1 jan 1601 and 1jan 1970
Forensics2
Window file have hive files that are binary storing registry of loggin everything on window
files
Hive type: classes root, current user, local machine, user, current config
Subkeys are under main keys, once clicked, timely modified on backend
USBSTOR: info on any usb connection done to your device, with all logs of what
write/read/delete etc used by a forensic examiner only then it can be accessed
Recent docs: recent doc opened, file menu, and local disk
CRYPTOGRAPHY:
Reverse Eng.:
Oht2
MALWARE:
dll files it
scanned,
processes
shown:
check
mutex,
cerate,
create
process
comms
shows
connection, send receive data, and protocol has communication, client to server data
is sent
in IDA:
View-> strings
To find variables:
What is the mutex created to ensure that the malware is not loaded twice?
Ans> SADFHUHF
opening mutex
Details shows each history of the file and the names of the malware and imports it used
and open/create mutex and processes
What IP / Port number of C2 server does it connect to?
Ans>127.26.152.13: 80
ip address called
Ans>hello
Mutex created?
IP?
Port?
Commands?
The sequence of hexadecimal values you've provided can be translated into ASCII
characters to understand its meaning. Let's break it down:
```
41 42 43 2D 31 32 33 34 35 36 00 00 53 00 6F 00
```
```
```
The NULL characters are non-printable and usually signify the end of a string or are used
as padding. Ignoring these, the readable part of the sequence is:
```
ABC-123456So
```
### Summary
ABC-123456So
```
The NULL characters (`00`) are non-printable and are typically used for string
termination or padding in various contexts.
PDF:
.rar, .docx
Steganography
Hidden messages
Images
Network packets
Social Engineering: Attackers often use social engineering tactics to trick users into
enabling macros in a document, usually by sending emails with seemingly legitimate
attachments and urging recipients to enable macros to view the content.
This slide demonstrates how different bullet points and indentation levels can be used
to structure information in a way that hides or obscures data within documents. This
might be particularly relevant in the context of information security for hiding metadata
or sensitive information within seemingly benign files.
Shell code:
Injection
1. PID find
2. Open process
3. Buffer reserved
4. Write shell code in buffer
5. Create remote thread to inject in another process
open process is existing
• Process Injection:
• Pick any file: The process begins by selecting a known executable file (exe), Word
document, PDF, etc. This file will serve as the carrier for the shellcode.
• Add Shellcode:
• Add shellcode to it: Inject the malicious code into the chosen file.
• Add new code section .malware: Create a new section in the file specifically for the
malicious code.
• Add main address .. Overwrite with .malware address .MAIN_: Modify the file’s
main execution address to point to the newly added malware section.
• Run nc or any reverse shell handler on remote computer: Use tools like Netcat
(nc) or other reverse shell handlers to listen for connections from the compromised
system.
• When target gets phished, you have C2 control: Once the target is tricked into
opening the compromised file (phishing), the attacker gains Command and Control
(C2) over the system.
• Send next stage payload to run: Deploy additional payloads or stages of the attack.
• Install more remote software: Install additional malicious software to further control
or exploit the system.
• Install keyloggers etc: Set up keyloggers to capture keystrokes and other sensitive
information.
• Exfiltrate passwords from chrome: Steal saved passwords from the Chrome
browser.
• Exfiltrate registry artifacts to identify important files: Extract registry data to find
important files on the system.
• Encrypt them for ransom: Encrypt the victim’s files and demand a ransom for their
decryption.
Buffer:
• Stack Frames: Each function call creates a new stack frame, which includes the function’s
local variables, parameters, return address, and a pointer to the previous frame.
• Call Stack: The stack that keeps track of function calls and returns addresses, allowing the
program to return control to the correct location after a function completes.
Explanation
• When data is copied into the buffer without proper bounds checking, it can overwrite
adjacent memory, including the return address and frame pointers.
• By carefully crafting the input data, an attacker can insert malicious code into the
overflowed buffer and overwrite the return address with the address of this malicious
code.
1. Malicious Code: The attacker’s code that has been injected into the buffer.
2. New Return Address: The overwritten return address now points to the malicious
code.
Key Concepts
Buffer Overflow
• Buffer Overflow: Occurs when data exceeds the allocated memory space of a buffer
and starts overwriting adjacent memory locations. This can lead to unpredictable
behavior, crashes, or potential code execution.
1. Inject Malicious Code: Attacker inputs more data than the buffer can hold, including
malicious code.
2. Overwrite Return Address: The overflow overwrites the return address with the
address of the malicious code.
3. Execute Malicious Code: When the function returns, it jumps to the malicious code
instead of the intended return address.
Prevention
• Bounds Checking: Ensure all buffer operations check the bounds to prevent
overflow.
• Safe Functions: Use safe library functions that limit the amount of data copied into
buffers (e.g., strncpy instead of strcpy).
• Stack Canaries: Use stack protection mechanisms that detect changes to the stack
frame, such as stack canaries.
• Address Space Layout Randomization (ASLR): Randomizes the memory addresses
used by system and application processes, making it harder for an attacker to predict
where the malicious code will be injected.
(return address – base address) +4 (32 bit system) = address to add shellcode
Gdp: breakpoint
1011/1111/1111/1111/1110/1010/111 1/0(10)00
11111100
10(binary)->decimal(2)
2-1=1 => 1
Buffer Overflow:
In a buffer overflow attack, the attacker overwrites the buffer and adjacent memory
locations, including the return address.
The goal is to overwrite the return address with a pointer to the malicious code.
Challenges:
Predicting the exact address to which the return address should be overwritten can be
difficult.
An inaccurate guess can lead to a failed attack, as the return address may not point
exactly to the start of the malicious code.
NOP stands for "No Operation". It is an instruction that does nothing and simply
advances the execution to the next instruction.
By filling the buffer with multiple NOP instructions before the malicious code (creating a
NOP sled), the attacker increases the chances of successful execution.
When the return address points to any location within the NOP sled, the CPU will
continue executing NOPs until it reaches the malicious code.
Without NOP:
If the return address is inaccurately guessed, it may not point exactly to the start of the
malicious code, leading to a failed attack.
With NOP:
Even if the return address is not perfectly accurate, it will likely point somewhere within
the NOP sled. The NOP sled then guides the execution flow to the malicious code,
resulting in a successful attack.
• Length of cipher is twice than that of plain text (pairs)
• For single char plaintext, cipher is just ASCII (hex) added to 80h
hex= ascii+80h
Decipher 0301e3
E3=ascii+80
63 ascii is c
e3 – 80 = 63h ‘c’