System Attacks
Backdoor
Backdoors have two components, server and client:
Server runs on the victim machine listening on the network in order to accept connections.
Client runs on the attacker machine.
Netbus
orSubSeven
are very famous.If the backdoor server sits behind a firewall, the easiest way to archive a connection is using a Connect-back Backdoor or Reverse Backdoor.
A firewall cannot tell the difference between a user surfing the web and a backdoor connecting back to the attacker's machine.
Create stable connection to a remote host
Password Attacks
Normally stored in an encrypted form, preventing a malicious local user from getting to know user's passwords, using a one-way encryption algorithm, using a cryptographic hashing function. There are three main strategies:
Brute force attacks
This method is only used when other attack vectors fail.
You try them all by generating and testing all the possible valid passwords. Given enough time, a brute force attack is always successful.
Long passwords made by upper and lower case letters, numbers and symbols can take days or even years to crack
John The Ripper: can mount both brute force and dictionary-based attacks against a password database (see:
john --list=formats
)Fast because of the high use of parallelization, crack strategies
/etc/passwd
: contains info about user accounts/etc/shadow
: contains info about the actual password hashesjohn
needs the username and the password hashes to be in the same file, therefore we need to use theunshadow
utility that comes with John The Ripperjohn -incremental -users:<users list> <file to crack>
john -incremental -users:victim crackme
To display the passwords recovered by
john
, use:john --show <file>
Dictionary attacks
Common passwords
Faster than pure brute force attacks
Poorly chosen or default passwords are more exposed to dictionary cracking
john -wordlist=<custom wordlist file> <file to crack>
Install password dictionaries:
apt-get install seclists
You'll find them in
/usr/share/seclists/Passwords
Mangling words
Variations on dictionary words
john -wordlist=<custom wordlist file> <file to crack> -rules <file to crack>
Rainbow Tables
Offer a tradeoff between the processing time needed to calculate the hash of a password and the storage space needed to mount an attack.
A rainbow table contains links between the results of a run of one hashing function and another.
Rainbow tables are BIG in file size, but reduces a cracking session from days to seconds.
Great choice to crack simple and complex short passwords.
Ophcrack
rainbow cracking for Windows authentication passwords (can run on Linux too).
John the Ripper
Hashcat
Buffer Overflow Attacks
A BoF attack can lead to:
An app or OS crash (DoS).
Privilege escalation.
Remote code execution.
Security features bypass.
A buffer is an area in the RAM reserved for temporary data storage:
User input, parts of a video file, server banners received by a client application. etc.
Buffers have a finite size, therefore: if an app developer does not enforce a buffer limit, an attacker could find a way to write data beyond those limits and write there arbitrary code
Stack
A stack is a data structure used to store data.
Two operation for LIFO stacks:
pop
&push
.Space on the stack can be allocated from app's code.
An overflow happens when an attacker overwrites on a reserved space, so overwriting a function return address means getting control over the app.
If an attacker manages to overflow a local variable from the app, the attacker would be able to overwrite the Base Pointer and then get a Return Address.
If the attacker overwrites the Return Address with the right value, they are able to control the execution flow of the program.
This technique can be exploited by writing custom tools and applications or by using hacking tools as Metasploit.
Being able to write a buffer overflow exploit requires a deep understanding of assembly programming, how applications and OS works and some exotic programming skills.
Last updated