Ecomm Unit 5
Ecomm Unit 5
An Ethical hacker also referred to as a “white hat hacker”. An Ethical Hacker is the first to get access to
the target system. Thus, the organization's security staff may patch a weakness in the system to
prevent an intruder from abusing it. In short, Ethical hackers are well recognized in their profession
for their job of protecting the system.
fixed and safe confidential information from being exposed to hackers who have malicious
intentions.
− Document their Findings: Ethical hackers must properly document all their findings and
potential threats. The main part of the work they are hired by the organizations is proper
reporting of bugs and vulnerabilities which are threat to the security.
− Keeping the Confidential Information Safe: Ethical hackers must oblige to keep all their
findings secure and never share them with others. Under any kind of situation they should
never agree to share their findings and observations.
− Sign Non-Disclosure Agreements: They must sign confidential agreements to keep the
information they have about the organizations safe with them. This will prevent them to give -
out confidential information and legal action will be taken against them if they indulge in any
such acts.
− Handle the loopholes in Security: Based on their observations, Ethical hackers should restore/
repair the security loopholes. This will prevent hackers from breaching the security of the
organization from attacks.
2. Computer Skills
Basic computer skills include data processing, managing computer files, and creating presentations.
Advanced computer skills include managing databases, programming, and running calculations in
spreadsheets. Some of the most essential computer skills are MS Office, Spreadsheets, Email,
Database Management, Social Media, Web, Enterprise systems, etc. An ethical hacker needs to be a
computer systems expert.
3. Linux Skills
The main reason to learn Linux for an ethical hacker is, in terms of security, Linux is more secure than
any other operating system. It does not mean that Linux is 100 percent secure it has some malware
for it but is less vulnerable than any other operating system. So, it does not require any anti-virus
software.
4. Programming Skills
Another most important skill to become an ethical hacker is Programming Skills. Before one writes
code he/she must choose the best programming language for his/her programming.
6. Reverse Engineering
Reverse Engineering is a process of recovering the design, requirement specifications, and functions
of a product from an analysis of its code. It builds a program database and generates information
from this. In software security, reverse engineering is widely used to ensure that the system lacks any
major security flaws or vulnerabilities. It helps to make a system robust, thereby protecting it from
hackers and spyware. Some developers even go as far as hacking their system to identify
vulnerabilities – a system referred to as ethical hacking.
7. Cryptography Skills
Cryptography deals with converting a normal text/message known as plain text to a non-readable
form known as cipher text during the transmission to make it incomprehensible to hackers. An ethical
hacker must assure that communication between different people within the organization does not
leak.
8. Database Skills
DBMS is the root of creating and managing all databases. Accessing a database where all the
information is stored can put the company in a tremendous threat, so ensuring that this software is
hack-proof is important. An ethical hacker must have a good understanding of this, along with
different database engines and data schemas to help the organization build a strong DBMS.
9. Problem-solving Skills
Problem-solving skills help one to determine the source of a problem and find an effective solution.
Apart from the technical skills pointed above, an ethical hacker also must be a critical thinker and
dynamic problem solver. They must want to learn new ways and ensure all security breaches are
thoroughly checked. This requires tons of testing and an ingenious penchant to device new ways of
problem-solving.
These are:
1. Reconnaissance: The attacker uses various hacking tools (NMAP, Hping) to obtain
information about the target
2. Scanning: Using tools such as NMAP and Nexpose, the attacker tries to spot vulnerabilities
in the system.
3. Gain access: Here, the attacker attempts to exploit the vulnerability using the Metasploit
tool
4. Maintain access: Now, the attacker tries to install some backdoors into the victim’s system
for future access (Metasploit is used again to achieve this)
5. Clear tracks: In this stage, the attacker clears all evidence of the attack as no attacker likes
to get caught
6. Reporting: Finally, the ethical hacker documents a report which consists of the
vulnerabilities spotted, the tools used to exploit, and the success rate of the operation
SQL injection is a code injection technique that might destroy your database. SQL injection is one of
the most common web hacking techniques. SQL injection is the placement of malicious code in SQL
statements, via web page input.
An SQL injection attack is the execution of a malicious SQL query to alter data stored in a database or
to access data without authentication or authorization. Websites or web applications using SQL
databases are vulnerable to SQL injection attacks. The most common approach to launching an SQL
injection attack is via user input fields. Hence, it is very important to validate data entered by users
before sending it to the server.
A SQL injection attack consists of insertion or “injection” of a SQL query via the input data from the
client to the application. A successful SQL injection exploit can read sensitive data from the database,
modify database data (Insert/Update/Delete), execute administration operations on the database
(such as shutdown the DBMS), recover the content of a given file present on the DBMS file system
and in some cases issue commands to the operating system.
SQL injection usually occurs when you ask a user for input, like their username/userid, and instead of
a name/id, the user gives you an SQL statement that you will unknowingly run on your database.
In general,
● SQL injection is a code injection technique that might destroy your database.
● SQL injection is one of the most common web hacking techniques.
● SQL injection is the placement of malicious code in SQL statements, via web page input.
− Error-based SQL Injections obtain information about the database structure from error
messages issued by the database server.
− Here, an attacker tries to insert malicious query in input fields and get some error which is
regarding SQL syntax or database. Attackers can use these error messages to gain
information about the database. A hacker might try writing a SQL command in any input field
like a single quote, double-quote, or any other SQL operator like OR, AND, NOT.
− For Example, for a URL of a site that takes a parameter from the user, then in that case:
https://www.example.org/index.php?item=123
Then here attacker can try inserting any SQL command or operator in the passes value,
as: https://www.example.org/index.php?item=123′
− In this case, a database could return some error. This error message gives the attacker
information like the database used in SQL, the syntax that caused an error, and where the
syntax occurred in the query. For a professional hacker with experience, this will be enough
to tell him that the server is insecurely connected to a database and can plan additional SQL
injection attacks that will cause damage.
− The UNION operator is used for combining 2 tables or performing 2 select queries at the
same time. In union operators, they remove duplicate row or column which we try to
execute at the same time.
Query:
SELECT EMP_ID, EMP_DOJ FROM EMP
UNION SELECT dept_ID, dept_Name FROM dept;
− This SQL query will produce a single result set with two columns, including values from EMP
columns EMP_ID and EMP_DOJ and dept columns dept_ID and dept_Name.
− Two important needs must be met for a UNION query to function:
− Each query must return the same number of columns.
− The data types must be the same, i.e., it is not changed after query execution.
− To determine the no of columns required in an SQL injection UNION attack, we will Inject a
sequence of ORDER BY clauses and increment the provided column index until an error is
encountered. “ - -” at the end ignores all subsequent statements.
− This demonstrates that the query lacks the fourth column. So we now know that the query in
the backend has three columns.
− Now we will use the UNION statement in order to join two queries and to be able to discover
the vulnerable columns.
Query: ?id=1 UNION SELECT 1,2,3 --+
− It works by submitting a SQL query to the database and forcing the application to produce a
different response depending on whether the query returns TRUE or FALSE. Only correct
queries show the result, wrong queries do not return anything. Attackers should try to
generate logically correct queries.
Example:
− The attacker will use blind SQL injection to ensure that the inject query returns a true or false
result.
▪ ?id=1' AND 1=1 --+
− Now, the database checks if 1 is equal to 1 for the supplied condition. If the query is
legitimate, it returns TRUE;
− A successful SQL injection attack can result in unauthorized access to sensitive data, such as
passwords, credit card details, or personal user information. Many high-profile data breaches in
recent years have been the result of SQL injection attacks, leading to reputational damage and
regulatory fines. In some cases, an attacker can obtain a persistent backdoor into an
organization's systems, leading to a long-term compromise that can go unnoticed for an
extended period.
Preventing SQL Injection
− User Authentication: Validating input from the user by pre-defining length, type of input, of the
input field and authenticating the user.
− Restricting access privileges of users and defining as to how much amount of data any outsider
can access from the database. Basically, user should not be granted permission to access
everything in the database.
− Do not use system administrator accounts.
Case Study 1:
− For this SQL injection example, let’s use two database tables, Users and Contacts. The Users
table may be as simple as having just three fields: ID, username, and password. The Contacts
table has more information about the users, such as UserID, FirstName, LastName, Address1,
Email, credit card number, and security code.
− The Users table has information used for logins like:
1. jsmith,P@$$w0rd
2. sbrown,WinterIsComing!
3. kcharles,Sup3rSecur3Password$
− When someone wants to log in, they’ll go to the login page and enter their username and
password. This information is then sent to the webserver, which will construct a SQL query and
send that query to the database server. An example of what that query looks like might be:
− The way SQL works is that it will then perform a true or false comparison for each row that the
query requests. In our example, the query says to check the Users table and give back the ID
value for every row where the username is jsmith and the password is P@$$w0rd. Often, the
webserver will then see what is returned by the database server and if it is a number. In our
case, the webserver would receive back a 1 and let the user past the login page.
− But, what if we want to get malicious with this? Because the database server performs that
true-or-false check, we can trick it into believing that we have successfully authenticated. We can
do this by adding an OR to the password. If we log in with x or 1=1 as our password, that will
create a new SQL query that looks like:
− This will work for us, because while x is not jsmith‟s password, the database server will then
check the second condition. If x isn‟tjsmith‟s password, then does 1 equal 1? It does! The ID will
be sent back to the application and the user will be successfully authenticated.
Case Study 2:
− An attacker wishing to execute SQL injection manipulates a standard SQL query to exploit
non-validated input vulnerabilities in a database. There are many ways that this attack vector
can be executed, several of which will be shown here to provide you with a general idea about
how SQLI works.
− For example, the above-mentioned input, which pulls information for a specific product, can
be altered to read http://www.estore.com/items/items.asp?itemid=999 or 1=1.
− And since the statement 1 = 1 is always true, the query returns all of the product names and
descriptions in the database, even those that you may not be eligible to access.
− Attackers are also able to take advantage of incorrectly filtered characters to alter SQL
commands, including using a semicolon to separate two fields.
− For example, this input http://www.estore.com/items/iteams.asp?itemid=999; DROP TABLE
Users would generate the following SQL query:
− SELECT ItemName, ItemDescription FROM Items WHERE ItemNumber = 999; DROP TABLE
USERS
Another example,
− Suppose we have an application based on student records. Any student can view only his or
her own records by entering a unique and private student ID. Suppose we have a field like
below: STUDENT_ID:
− And the student enters the following in the input field:12222345 or 1=1.
− So this basically translates to :
− SELECT * from STUDENT where STUDENT_ID == 12222345 or 1 = 1
− Now this 1=1 will return all records for which this holds true. So basically, all the student data is
compromised. Now the malicious user can also delete the student records in a similar fashion.
Consider the following SQL query.
SELECT * from USER where USERNAME = “” and PASSWORD=””
Now the malicious can use the “=” operator in a clever manner to retrieve private and secure user
information. So instead of the above-mentioned query the following query when executed,
retrieves protected data, not intended to be shown to users.
Select * from User where (Username = “” or 1=1) AND (Password=”” or 1=1).
Since 1=1 always holds true, user data is compromised.
5.4 Firewall:
5.4.1 Concepts of Firewall
With the increasing number of cyber crimes with every passing day, individuals and companies
must secure their information. A firewall is one such security device that can help you safeguard
your network and device from an outsider.
A firewall can be defined as a special type of network security device or a software program that
monitors and filters incoming and outgoing network traffic based on a defined set of security
rules. It acts as a barrier between internal private networks and external sources (such as the
public Internet).
Firewalls prevent unauthorized access to networks through software or firmware. By utilizing a set
of rules, the firewall examines and blocks incoming and outgoing traffic. It is a cyber-security tool
that filters network traffic and helps users block malicious software from accessing the Internetin
infected computers.
Sutex bank college of computer applications and science Page 11
Unit 5
Fencing your property protects your house and keeps trespassers at bay; similarly, firewalls are
used to secure a computer network. Firewalls are network security systems that prevent
unauthorized access to a network. It can be a hardware or software unit that filters the incoming
and outgoing traffic within a private network, according to a set of rules to spot and prevent
cyber-attacks.
Firewalls are used in enterprise and personal settings. They are a vital component of network
security. Most operating systems have a basic built-in firewall. However, using a third-party
firewall application provides better protection.
A UTM device generally integrates the capabilities of a stateful inspection firewall, intrusion
prevention, and antivirus in a loosely linked manner. It may include additional services and, in
many cases, cloud management. UTMs are designed to be simple and easy to use.
A firewall system analyzes network traffic based on pre-defined rules. It then filters the traffic and
prevents any such traffic coming from unreliable or suspicious sources. It only allows incoming
traffic that is configured to accept.
Typically, firewalls intercept network traffic at a computer's entry point, known as a port. Firewalls
perform this task by allowing or blocking specific data packets (units of communication
transferred over a digital network) based on pre-defined security rules. Incoming traffic is allowed
only through trustedipaddresses, or sources.
Advantages of Firewall:
− It provides enhanced security and privacy from vulnerable services. It promotes privacy.
− It prevents unauthorized users from accessing a private network that is connected to the
internet.
− Firewalls are designed to protect the computer from viruses, malware, and other harmful
codes.
− Firewalls provide faster response time and can handle more traffic loads. It monitors
Sutex bank college of computer applications and science Page 13
Unit 5
network traffic.
− A firewall allows you to easily handle and update the security protocols from a single
authorized device.
− It safeguards your network from phishing attacks.
Disadvantages of Firewall:
1. Cost Oriented
It can be costly for organizations as they need to pay for them. If they look for hardware
firewalls, then it will cost more for them. As there are installation charges, maintenance
charges and also they need to hire the IT technician for this. The cost also varies on the
type of firewall the company chooses.
2. It can restrict some organizational activities.
The firewall prevents access to several sites that have malware or any virus. This thing can
be good for its users, but large companies often face problems because of it. As the
firewalls use strict security guidelines and that can affect the employees‟ work efforts. And
hence it will also impact the productivity of the company by which it can face the loss.
3. It can decrease performance level.
Firewalls are the security tools that keep running in the background of the computer. And
as there are multiple tabs open and the firewall is also running, in that case, the
performance of the computer will be slow.
4. Still, Some Hacking Attacks Can Happen
The firewalls can be effective on the basic Trojan and their types. Hence, another type of
malware can enter the computer device. If you have a firewall installed on your computer,
then you should also install the anti-virus applications. So that you can run the malware
detection test and remove all these malware and viruses.
5. Need a Careful Maintenance
For many large businesses, it needs to have a dedicated team of IT experts who can
maintain all the maintenance work of firewalls. Hence, it will increase the company’s
capital expenditure, and they will need to accommodate all these employees. And they
need to work as per the latest policies provided by a company that can be challenging to
execute. Hence, the maintenance issue is also one of the significant disadvantages of
firewalls.