Sunday, 29 July 2012

Ghost Phisher - Phishing & Penetration Attacks

Ghost Phisher - Phishing & Penetration Attacks:
Ghost Phisher is a computer security application that comes inbuilt with
a Fake DNS Server, Fake DHCP Server, Fake HTTP server and also has an
integrated area for automatic capture and logging of HTTP form method
credentials to a database. The program could be used as an honey
pot,could be used to service DHCP request , DNS requests or phishing
attacks.











Requirements:

 
python
python-qt4
xterm
subversion

To install simply run the following command in terminal after changing directory to the path were the downloaded package is: 

root@host:~# dpkg -i ghost-phisher_1.3_all.deb


Ghost phisher ships in with default Windows and Linux vulnerability
pages, These pages can be used for penetration.Ghost automatically
recognizes the remote operating system and displays the vulnerability
pages according to the information fetched.  

Download ghost-phisher from the official website.

















Note: If you want to learn more about Linux and Windows based Penetration testing, you might want to subscribe our RSS feed and Email Subscription  or become our Facebook fan! You will get all the latest updates at both the places.

OWASP Top 10 Tutorial

OWASP Top 10 Tutorial:
OWASP has categorized the top 10 vulnerability for web application, website hacking is very common now a days so the security testing on a web application is very important because it seems to be very difficult to recover a data after a hacking attack. OWASP top 10 is a standard to conduct a penetration testing on a web server, we have discussed the first part of this article before and this article will discuss the remaining part.






Broken Authentication and Session Management

Authentication
is the step to know about the visitor (user) of a web application after
authentication process session management establish. But what if an
attacker steals or hijacks the session of authentication process? If a
web application authentication process is vulnerable then an external
attacker or the legitimate users may try to steal the account
information of other users. This attack may occur when the session ID is
visible or when end-to-end encryption (SSL) is not used or cracked. The
flaw can occur when the user forgets their password, changes their
password, gets an account up-grade or during other related procedures.
The
common type of attack on authentication is brute force or dictionary
based attacks on web forms by using tool like THC Hydra. So the point to
discuss is about creating a strong password because whether it is HTTP
authentication or HTML authentication – they both can be cracked.

The risk factors involved are session ID hijacking, accounts may be compromised and the user information might be at risk.

Open Source Tools
  • Add N Edit Cookies (Firefox add-ons,not available for latest Firefox)
  • HackBar (Firefox add-ons)
  • Nikto
Common Vulnerabilities





Insecure Direct Object References

It
is a type of attack in which an authorized user changes a parameter of
the system object to refer a page, database or any system object that
they are not authorized for. The most common attack is directory
traversal (or path traversal) and refers to a file or account by
mishandling the URL.

The risk factor is bigger because if this vulnerability is compromised then all the information and data will be compromised.

Example:
http://target.com/bank?acct=#####

Open Source Tools
  • Websucurify
  • w3af
  • Burp Suite
Common Vulnerabilities





Cross-Site Request Forgery (CSRF)

Cross-site
request forgery is also known as a session riding attack. An attacker
uses different techniques to execute or submit a request to a website by
using authorized users (the victims). There is a difference between
cross-site scripting and cross-site request forgery because the XSS
exploit will break the trust of a user for an application while on CSRF
it will break the trust of an application for the user (the victim in
this case). In CSRF an attacker may send malicious code (HTML or Java)
via email or by using the XSS flaw.

The risk factor on the victim
side is very clear because an attacker can cause a victim to change the
data and perform the desired function.
Open Source Tools
Common Vulnerabilities
 
 





 





 





 





 





 





 





 





 









 





Security Misconfiguration

Security
misconfiguration is a dangerous attack because it can lead to the whole
system being compromised. Security misconfiguration may occur at the
system level while the common security misconfiguration for web
applications is default accounts, default pages, unpatched software and
unprotected directories that contain relevant information. In security
misconfiguration an attacker might be a third-person or an authorized
user.

The threat level is very high, but by implementing some
simple practices an administrator may be able to protect their
application:
  • Disable all unnecessary software
  • Change all the default passwords
  • Keep all software’ up-to-date, including the server and database software
Open Source Tools
  • Nikto
  • skipfish
 
 





 





 





 





 





 





 



































Insecure Cryptographic Storage

As
the title suggests, insecure cryptographic storage is about storage.
Insecure cryptographic storage vulnerability occurs when an attacker
gains access to a file that contains the confidential information in
plain text. It means there is no encryption policy for the data that is
meant to be encrypted. In insecure cryptographic storage the attacker
does not break the encryption policy, but finds a way to get the desired
information. For example, an application stores credit card information
of their users in simple text (plain text) and then an attacker finds
an SQL injection vulnerability to enter into the database so the
attacker can easily get the credit card information of the users because
all the information is available in plain text.

So the key point
to fight against insecure cryptographic storage is to apply encryption
to all backup data, use strong encryption algorithms, so in the event an
attacker gets the file, he/she is not able to get the data.





Failure to Restrict URL Access

This
might count under the authentication vulnerability because the failure
to restrict URL access is a result of improper authentication. In simple
words, it is a forced browsing where an authorized user or maybe a
third-person tries to access a URL for which they are not supposed to.

http://victim.com/username_info A user supposed to use their URL
http://victim.com/admin_info What if a user try to access this URL
Path traversal is a good example of failure to restrict URL access.
http://victim.com/admin_info.php?pages=../../../../etc/passwd
The
other possibilities of this vulnerability is to call some scripts from
other website or simply use the redirection vulnerability.
http://victim.com/admin_info.php?pages=http://www.ehacking.net/malware

Open Source Tools
  • w3af
  • Websecurify
  • Nikto
Common Vulnerabilities





Insufficient Transport Layer Protection

The
risk of insufficient transport layer protection is high for your user
because the user information might be monitored and sniffed. An attacker
can use different sniffers for both wired and wireless networks on the
user side to monitor and catch the confidential information of a user.
Nowadays web applications use SSL/TSL in the process of authentication
to protect the user information – but keep in mind SSL can be cracked.
So the point is to use strong SSL for authentication and session cookies
on all the important pages.
Open Source Tools
  • SSLScan (An old tool)
  • Calomel SSL Validation (Firefox add-ons)
  • SSL Test (Bash script to find the weak cipher)
  • Nikto





Unvalidated Redirects and Forwards

It
is dangerous because it can lead a user to phishing and malware
websites. An attacker can take the advantage of redirects and trick the
victim to click on a link. The user will most likely click on it because
the link seems to be valid.

http://website.com/cgi-bin/redirect.cgi?url=attack.com
http://website.com/login?url=website.com
Example:

If
a web application is vulnerable then an attacker sends an email to the
user like you have received an email to purchase something with a low
rate and a URL like:

http://www.amazon.com/Application-Development-Graph-Cookbook/dp?url=http://www.phishing.com
So an attacker can easily use phishing technique to steal the confidential information of the user.

Common Vulnerabilities
 





Final Thoughts

Lastly,
I just want to mention the wonderful option of w3af because it provides
the ability to conduct web application based penetration testing on
the OWASP Top 10 vulnerabilities.

 
OWASP
has categorized the most dangerous vulnerabilities in web applications
and it is a reference point for web developers and penetration testers
to make sure that the application does not contain these top
vulnerabilities. Besides the application level vulnerabilities we need
to take care of the system software and the vulnerabilities that can
cause all of the information to be compromised. The key tip is to remain
up-to-date.
  • Update all of the software, both at the system and the application level.
  • Keep engaged with the online community to learn about new vulnerabilities and application weaknesses.



Note: If you want to learn more about Linux and Windows based Penetration testing, you might want to subscribe our RSS feed and Email Subscription  or become our Facebook fan! You will get all the latest updates at both the places.

How to Exploit an Iframe Vulnerability & Security

How to Exploit an Iframe Vulnerability & Security:
Web application security is always an important topic to discuss
because websites seem to be the first target of malicious hackers.
Hackers use websites to spread their malwares and worms, and they use
the compromised websites for spamming and other purposes. OWASP has
created an outline to secure a web application from the most dangerous
vulnerabilities in web application, but it is always good to be actively
learning about the new weaknesses and the new ways that an attacker
might use to hack into a web application. 



Hackers are always trying to
discover new ways to trick a user so from a penetration tester’s point
of view a website administrator should take care of each and every
vulnerability and the weaknesses that an attacker may exploit to hack
into a website. There are so many automatic tools and manual techniques
available to test a website for the most common vulnerabilities, like
SQL-injection, cross site scripting, security misconfiguration and
others, but we should take care about the variant of these
vulnerabilities. SQL-injection is dangerous because an attacker may get
access into a database and steal the information of the user and the
administrator of the website, but what if an attacker simply hijacks the
user or simply redirects your visitor to a malicious website. This can
break the trust of the visitor on your website.

In this article,
we will discuss the attack at HTML level or attack at HTML codes, iframe
is the part of HTML or a technique used in HTML to embed some file
(document, video and others) in the same HTML page. The simple way to
explain iframe is that “iframe is the technique to display the
information from another web page within the same (current) page”.
Security risk in iframe is an important topic to discuss because the
usage of iframe is very common- even the most famous social networking
websites are using iframe. The simple attribute to use iframe is as
follows:

<iframe src=”http://www.ehacking.net”></iframe>

The above statement shows how to display another website within a website.

Example 2:

<iframe src=’http://ehacking.net/’ width=’500′ height=’600′ style=’visibility: hidden;’></iframe>





Width
and height of an iframe has been defined, but since the frame
visibility is hidden there is no physical presence of Infosec
Institute’s website. This technique is not used by the attacker because
the frame occupies the area (width and height).

<iframe src=’http://ehacking.net/’ width=’1′ height=’1′ style=’visibility: hidden;’></iframe>

Now it is completely hidden from the user’s eye, but the iframe is working as normal. Look at the picture below.






Obfuscated iFrame Injection Attacks

Obfuscated
iframe injection attack is a dangerous and tricky attack because it is
very difficult to detect and find the malicious injection code on a
website. Obfuscated is the way to hide the meaning of the communication
so that it is difficult to find the injected code. The aim of this
attack is the same- to trick the user and then redirect to the third
party web page to exploit the user. If a website has been compromised by
using iframe injection attack, then it is easy to find and locate the
injection code because the code is easy to read. However, in an
obfuscated iframe injection attack, it is not easy to read the injected
code.

Let’s consider an example- A
website has been compromised and it redirects or displays another web
page within a page to sell some products. The visitor of this website
trusts your website, and they usually purchase products so you need to
make sure to clean the website from this tricky attack. A simple way is
to review the index page for the possible iframe and redirect code.
Let’s suppose you have reviewed but have not found any URL of the third
party website. Now, there is no URL of the third party website so what
is the problem? Sometimes attackers use human weaknesses (social
engineering technique) in a web application attack. Let’s suppose there
is a code like:


1
2
3
4
++++%23wp+/+GPL%0A%3CScript+Language%3D%27Javascript%27%3E%0A++++%3C%21--%0A++++document.write%28unescape%28%273c696672616d65207372633d27687474703a2f2f696e666
f736563696e737469747574652e636f6d2f272077696474683d273127206865696768743d273127207374
796c653d277669736962696c6974793a2068696464656e3b273e3c2f696672616d653e%27%29%29%3B%0A
++++//--%3E%0A++++%3C/Script%3E
It
seems to be normal and an important code for this website; but in
reality, it is the root cause of the problem. Let’s decode it by using
the java decoding function and the result is:


1
2
3
4
5
6
7
8
#wp / GPL
<Script Language='Javascript'>
    <!--
document.write(unescape('3c696672616d65207372633d27687474703a2f2f696e666f73656369
6e737469747574652e636f6d2f272077696474683d273127206865696768743d273127207374796c653d
277669736962696c6974793a2068696464656e3b273e3c2f696672616d653e'));
    //-->
    </Script>


Again,
it seems to be a legitimate piece of code because the attacker has
created it very carefully and used the term “GPL” “wp” and “Java” so the
code seems to be legitimate. In actuality, it is the root cause but how
can this be confirmed. Everything is good with the code, but the
numbers and letters seems to be HEX. In the next step, we need to
decrypt it via hex decoder. Remember take only:


1
2
3
3c696672616d65207372633d27687474703a2f2f696e666f736563696e737469747574652e636f6d2f272
077696474683d273127206865696768743d273127207374796c653d277669736962696c6974793a206869
6464656e3b273e3c2f696672616d653e



The result is:

<iframe src=’http://infosecinstitute.com/’ width=’1′ height=’1′ style=’visibility: hidden;’></iframe>


Now, you can imagine why it is difficult to fight against the obfuscated iframe injection attack.












Note: If you want to learn more about Linux and Windows based Penetration testing, you might want to subscribe our RSS feed and Email Subscription  or become our Facebook fan! You will get all the latest updates at both the places.

Sunday, 15 July 2012

SQLmap GUI - SQL Injection Tool

SQLmap GUI - SQL Injection Tool:

SQL injection is the most dangerous vulnerability that can cause a great harm to the website and their database, web application penetration testing is the right way to audit the security of a web application, since penetration testing means to confirm the vulnerability by exploit the vulnerability and there are several exploitation tool for SQLi is available and SQLmap is among of them.








SQLmap is the very famous SQL injection exploitation tool and the command line version of the tool was previously available but now the GUI (graphical user interface) of SQLmap is also available which is very easy to use and user friendly.

sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out-of-band connections.





Download SQLmap GUI

Insert the target for exploitation

SQLmap injection technique

Tables of database










 




Note: If you want to learn more about Linux and Windows based Penetration testing, you might want to subscribe our RSS feed and Email Subscription  or become our Facebook fan! You will get all the latest updates at both the places.