Skip to navigation Skip to content
Hackercool Magazine
  • Home
  • 12 Free eBooks
  • Subscription
  • Products
  • Login
  • Blog
  • Contact us
    • Our services
  • Home
  • About us
  • Blog
  • Cart
  • Checkout
  • Contact us
  • Customer Login
  • FAQ
  • Our services
  • Privacy Policy
  • Products
  • Refund and Cancellation
  • Terms & Conditions
  • $0.00 0 items
Home / Hacking / Website Hacking / Beginners guide to login bypass
Posted on August 9, 2013June 24, 2024 by kanishka10 — 12 Comments

Beginners guide to login bypass

Hello, aspiring ethical hackers. In this blogpost, you will learn about login bypass.

What is Login bypass?

Many resources like websites Routers, Gateways, file messengers use authentication to ensure security of the resources what if this login in bypass. The process of Login bypass refers to any action on current which allows a user to directly access the resources without the use of credentials. Many techniques can be used to bypass login of a page. Some of the techniques are,

  1. SQL injection
  2. Forced browsing
  3. URL parameters manipulation.

Let’s learn about each of them in detail.

1. SQL Injection:

Acunetix describes this as ” the type of attack that takes advantage of improper coding of your web applications that allows hacker to inject SQL commands into say a login form to allow them to gain access to the data held within your database. In essence, SQL Injection arises because the fields available for user input allow SQL statements to pass through and query the database directly.

In this article, I am going to show you how login bypass attack can be done on websites using SQL injection. For this I am going to use Vulnerawa and WAMP server. You can download Vulnerawa from here. To see what is Vulnerawa, go here. To learn how to setup Vulnerawa in Wamp Server, go here. When you finish successfully setting up Vulnerawa, it should be as below. The first page of a website is the  “index.php”   which is as shown below.

Now click on the “Login” button. You should see a login form as below.

Now insert a single quote character( ‘ ) into the form as shown below.

Click on “Submit”. You should get the error as shown below. This shows that the webpage is vulnerable to SQL injection. Notice that the URL has changed  to a page “process.php”. Remember this for now.

Now enter the query

1′ or ‘1’=’1 

as shown below in both username and password fields.

login bypass

Click on “Submit”. If you got the below webpage, then you have successfully bypassed the login screen.

The query we entered above validates the  user  even without checking the password. There are some other queries which can work similarly. Two of them are here.

‘ or ‘1’=’1;
‘ or ‘1’=’1”

When a hacker enters these two queries, the username field becomes

” or ‘1’=’1;

which transforms to validate the user if username is empty or 1=1. Now whatever may happen, one will always be equal to one. We can find many more using trial and error. This vulnerability exists because we are supplying raw data to our application.

Now let’s go to the page “process.php” to understand how this sql injection worked. Go to the root directory of Vulnerawa. That would be “C://Wamp/www/vulnerawa1.0.2“. You should see the list of below pages.  These are all the webpages which make the webapp vulnerawa1.0.2.

But we are interested in the page process.php. Right click on the page and select “edit” option to view the file. To put simply, open the process.php file with notepad. You should see it as below.  We are interested in the two lines of code, $myusername=$_POST[‘username’] and  $mypassword=$_POST[‘password’]. These are the two queries to take username and password from the user. You can observe that they are taking input directly aka without sanitization.

Now just below these two lines, we have two lines commented. These are

$myusername = mysqli_real_escape_string($connect, $myusername);

$mypassword = mysqli_real_escape_string($connect, $mypassword);

Now, uncomment those two lines by removing the two backward slashes as shown below.

Save the file and restart the WAMP server. Now try to bypass the login screen as explained above. You should get something as shown below.

The “mysqli_real_escape_string” escapes any escapes any special characters entered in the input fields thus rendering injection harmless.

2. Forced browsing:

The page that is accessed after your login into any resource is also part of all the web pages that belong to that website. Sometimes, login can be bypassed by directly going to this page on browser. This is known as forced browsing and this page can be searched using web directory busting or fuzzing.

3. URL parameter tampering:

The login screen can also be bypassed by tampering with the URL parameter.

Follow Us
  • Facebook
  • Twitter
  • Instagram
  • LinkedIn
 
         
Category: Website Hacking
Tags: Login Bypass, SQL Injection

Post navigation

Previous post: Desktop phishing tutorial: Step by step guide
Next post: Beginners guide to armitage

12 thoughts on “Beginners guide to login bypass”

  1. Anonymous
    August 9, 2013

    Great article, very clearly written with excellent screenshots !
    Thanks

  2. Pentesticles
    August 10, 2013

    What’s the point in writing a blog post about the most basic SQLi and being pretentious enough to quote the Art of War! Hahahaha.

  3. Cereal
    August 10, 2013

    Nice article, congrats.

    1. kanishka10
      August 10, 2013

      Thank you very much, Cereal.

  4. |)|2|< (0//3T
    October 18, 2013

    Brilliant Tutorial on Detection and Prevention of Sql Injection Attack
    “Surprisingly, he gets access to the restricted area….”<==Referring to this line,can you create the php mysql code to get access to the resticted area like to retrieve sensitive user information and mail me the code asap

  5. TonyT
    February 15, 2014

    haha,
    works like a charm. tried it on http://www.sticktipp.de

    define(‘DB_NAME’, ‘db479035460’);

    /** Ersetze username_here mit deinem MySQL-Datenbank-Benutzernamen */
    define(‘DB_USER’, ‘dbo479035460’);

    /** Ersetze password_here mit deinem MySQL-Passwort */
    define(‘DB_PASSWORD’, ‘st1ckt1pp’);

    /** Ersetze localhost mit der MySQL-Serveradresse */
    define(‘DB_HOST’, ‘db479035460.db.1and1.com’);

    /** Der Datenbankzeichensatz der beim Erstellen der Datenbanktabellen verwendet werden soll */
    define(‘DB_CHARSET’, ‘utf8’);

    /** Der collate type sollte nicht geändert werden */
    define(‘DB_COLLATE’, ”);

  6. ishwor
    June 22, 2016

    can we bypass router login page its username and password

    1. kanishka10
      June 23, 2016

      Ishwor, it depends. But mostly router logins can be bypassed using default username and passwords.

  7. Phpprogrammer
    June 14, 2017

    Attacks on website is very common now a days. You blog is surely help us to maintain our website security and make safe them.Thanks for the article.

    1. kanishka10
      June 24, 2017

      You are welcome, Phpprogrammer.

  8. How To Bypass Website Login - UK Login Database
    December 4, 2021

    […] 5. Login Bypass using SQL Injection – Hackercool Magazine […]

  9. Bypass Website Login - UK Web Portals
    December 31, 2021

    […] 4. Login Bypass using SQL Injection – Hackercool Magazine […]

Comments are closed.

Our Latest Posts
  • Beginners guide to digital forensics
  • Beginners guide to Threat Intelligence
  • Beginners guide to Information security
  • Beginners guide to cybersecurity
  • Beginners guide to vulnerability management

Categories

  • ►Basics (15)
  • ▼Hacking (164)
    • ►Footprinting (21)
    • ►Scanning (6)
    • ►Enumeration (10)
    • ►Vulnerability Assessment (1)
    • ►Password Cracking (9)
    • ▼Website Hacking (36)
      • Beginners guide to Commix
      • Beginners guide to dirb tool
      • Beginners guide to dirbuster
      • Beginners guide to ffuf tool
      • Beginners guide to gobuster tool
      • Beginners guide to LFI vulnerability
      • Beginners guide to login bypass
      • Beginners guide to PHPSploit
      • Beginners guide to Sqlsus
      • Beginners guide to Uniscan
      • Beginners guide to WPScan
      • Beginners guide to XSSer
      • C99 shell : The infamous web shell
      • Command Injection for Beginners
      • Complete guide to sqlmap
      • Complete guide to Wapiti
      • Complete guide to web application hacking
      • Complete guide to web server hacking
      • Cross Site Scripting (XSS) for Beginners
      • Cross-Site Request Forgery for Beginners
      • Havij SQL injection tool: Complete guide
      • Hp WebInspect: Beginners guide
      • Joomla enumeration with Metasploit
      • Nessus vulnerability scanner: Beginner's guide
      • Nikto vulnerability scanner: Complete guide
      • Remote File Inclusion (RFI) for beginners
      • Server Side Request Forgery For Beginners
      • SQL Injection for beginners
      • WAPT with HPWebinspect : Part 2
      • Webshell attack with msfvenom
      • Webshells in Kali Linux
      • Weevely web shell: Complete guide
      • WhatWeb tool: Beginners guide
      • Wordpress enumeration with Metasploit
      • Wordpress hacking guide for beginners
      • Wordpress Reverse Shell : Multiple Methods
    • ►WiFi Hacking (21)
    • ►MiTM (8)
    • ►Gaining Access (22)
      • ►Social Engineering (6)
      • ►Windows Hacking (6)
      • ►Linux Hacking (1)
    • ►POST-Exploitation (21)
      • ►Privilege Escalation (13)
        • ►Linux Privilege Escalation (8)
        • ►Windows Privilege Escalation (4)
      • ►Maintaining Access (2)
      • ►Windows POST Exploitation (4)
      • ►Linux POST Exploitation (1)
    • ►DoS (2)
    • ►AV Evasion (5)
    • 5 phases of ethical hacking for beginners
    • Beginners guide to ethical hacking
    • Beginners guide to Hacking
    • Beginners guide to pen testing
  • ►Metasploitable2 (4)
  • ►Hacking Tools (75)
    • ►Footprinting tools (7)
    • ►Scanning tools (3)
    • ►Enumeration tools (2)
    • ►Password cracking tools (5)
    • ►MiTM tools (4)
    • ►Initial access tools (6)
    • ►Privilege escalation tools (5)
    • ►Stress testing tools (1)
  • ►Vulnerabilities (12)
    • ►Windows vulnerabilities (3)
    • ►Linux vulnerabilities (5)
    • ►Other vulnerabilities (4)
  • ►Hacking Labs (4)
  • ►Uncategorized (52)
  • ►Digital forensics (4)
  • ►Installations (7)
  • ►Vulnerawa (2)
Contact Us
  • Hackercool Cybersecurity (OPC) Pvt Ltd.
  • Address: Hyderabad, India
  • WhatsApp : 9505658443
  • Mail: [email protected]
Menu
  • Refund and Cancellation
  • Terms & Conditions
  • Privacy Policy
  • FAQ
  • About us
Follow Us
Follow Us
  • Facebook
  • Twitter
  • Instagram
  • LinkedIn
© Hackercool Magazine 2025
Built with WooCommerce.
  • My Account
  • Search
  • Cart 0
Select your currency
AED United Arab Emirates dirham
AFN Afghan afghani
ALL Albanian lek
AMD Armenian dram
ANG Netherlands Antillean guilder
AOA Angolan kwanza
ARS Argentine peso
AUD Australian dollar
AWG Aruban florin
AZN Azerbaijani manat
BAM Bosnia and Herzegovina convertible mark
BBD Barbadian dollar
BDT Bangladeshi taka
BGN Bulgarian lev
BHD Bahraini dinar
BIF Burundian franc
BMD Bermudian dollar
BND Brunei dollar
BOB Bolivian boliviano
BRL Brazilian real
BSD Bahamian dollar
BTC Bitcoin
BTN Bhutanese ngultrum
BWP Botswana pula
BYR Belarusian ruble (old)
BYN Belarusian ruble
BZD Belize dollar
CAD Canadian dollar
CDF Congolese franc
CHF Swiss franc
CLP Chilean peso
CNY Chinese yuan
COP Colombian peso
CRC Costa Rican colón
CUC Cuban convertible peso
CUP Cuban peso
CVE Cape Verdean escudo
CZK Czech koruna
DJF Djiboutian franc
DKK Danish krone
DOP Dominican peso
DZD Algerian dinar
EGP Egyptian pound
ERN Eritrean nakfa
ETB Ethiopian birr
EUR Euro
FJD Fijian dollar
FKP Falkland Islands pound
GBP Pound sterling
GEL Georgian lari
GGP Guernsey pound
GHS Ghana cedi
GIP Gibraltar pound
GMD Gambian dalasi
GNF Guinean franc
GTQ Guatemalan quetzal
GYD Guyanese dollar
HKD Hong Kong dollar
HNL Honduran lempira
HRK Croatian kuna
HTG Haitian gourde
HUF Hungarian forint
IDR Indonesian rupiah
ILS Israeli new shekel
IMP Manx pound
INR Indian rupee
IQD Iraqi dinar
IRR Iranian rial
IRT Iranian toman
ISK Icelandic króna
JEP Jersey pound
JMD Jamaican dollar
JOD Jordanian dinar
JPY Japanese yen
KES Kenyan shilling
KGS Kyrgyzstani som
KHR Cambodian riel
KMF Comorian franc
KPW North Korean won
KRW South Korean won
KWD Kuwaiti dinar
KYD Cayman Islands dollar
KZT Kazakhstani tenge
LAK Lao kip
LBP Lebanese pound
LKR Sri Lankan rupee
LRD Liberian dollar
LSL Lesotho loti
LYD Libyan dinar
MAD Moroccan dirham
MDL Moldovan leu
MGA Malagasy ariary
MKD Macedonian denar
MMK Burmese kyat
MNT Mongolian tögrög
MOP Macanese pataca
MRU Mauritanian ouguiya
MUR Mauritian rupee
MVR Maldivian rufiyaa
MWK Malawian kwacha
MXN Mexican peso
MYR Malaysian ringgit
MZN Mozambican metical
NAD Namibian dollar
NGN Nigerian naira
NIO Nicaraguan córdoba
NOK Norwegian krone
NPR Nepalese rupee
NZD New Zealand dollar
OMR Omani rial
PAB Panamanian balboa
PEN Sol
PGK Papua New Guinean kina
PHP Philippine peso
PKR Pakistani rupee
PLN Polish złoty
PRB Transnistrian ruble
PYG Paraguayan guaraní
QAR Qatari riyal
RON Romanian leu
RSD Serbian dinar
RUB Russian ruble
RWF Rwandan franc
SAR Saudi riyal
SBD Solomon Islands dollar
SCR Seychellois rupee
SDG Sudanese pound
SEK Swedish krona
SGD Singapore dollar
SHP Saint Helena pound
SLL Sierra Leonean leone
SOS Somali shilling
SRD Surinamese dollar
SSP South Sudanese pound
STN São Tomé and Príncipe dobra
SYP Syrian pound
SZL Swazi lilangeni
THB Thai baht
TJS Tajikistani somoni
TMT Turkmenistan manat
TND Tunisian dinar
TOP Tongan paʻanga
TRY Turkish lira
TTD Trinidad and Tobago dollar
TWD New Taiwan dollar
TZS Tanzanian shilling
UAH Ukrainian hryvnia
UGX Ugandan shilling
USD United States (US) dollar
UYU Uruguayan peso
UZS Uzbekistani som
VEF Venezuelan bolívar (2008–2018)
VES Venezuelan bolívar
VND Vietnamese đồng
VUV Vanuatu vatu
WST Samoan tālā
XAF Central African CFA franc
XCD East Caribbean dollar
XOF West African CFA franc
XPF CFP franc
YER Yemeni rial
ZAR South African rand
ZMW Zambian kwacha
LTC Litecoin
ETH Ethereum
ZWD Zimbabwe Dollar
ZWL Zimbabwe
Want to learn how Black hat and Red Teamers hack?

Our 12 FREE eBooks teach you exactly that. 

Tell me where should I send them and don't forget to click on the confirmation email we send to your email address.

First Name
[email protected]