首页 > 解决方案 > 有人入侵了我的 php 网站并访问数据库

问题描述

一天前,一个人入侵了我的整个数据库并访问了所有数据库表。他拍了一些它的截图,一一发给我炫耀。首先,我可以更改所有的 Godaddy 密码并应用 2 层身份验证,但它没用。他再次访问我的数据库,并说他在我的网站上设置了后门,任何时候他都可以访问我的数据库。

我遇到了非常严重的问题,因为数据库包含非常重要的数据。我已经改变了我的整个托管计划并转移到另一个,但是在早上我看到他再次可以访问我的服务器,并且他在数据库中添加了一个新用户。我不知道是什么问题。即使我更改了托管公司,我什至不知道他在哪个 php 文件上访问我的数据库。

当我更改了托管公司并且他再次在他的命令提示符下访问我的数据库时,这怎么可能。即使它也很难获得新的托管域,因为它也是新的。

我的一些数据库代码

<?php
require '../connect.php';
                    error_reporting(0);
                    if (isset($_POST['submit'])) 
                    {
                        $uname = $_POST['uname'];
                        $service = $_POST['service'];
                      $check = "SELECT * FROM Logins WHERE username='$uname'";
                      $checks = mysqli_query($con,$check);
                      $chk = mysqli_num_rows($checks);
                      if($chk == 1)
                      {
                        while ($row=mysqli_fetch_assoc($checks)) 
                        {
                          $acctype = $row['logintype'];
                        }
                        if ($service == "Sim Data") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "50";
                          }
                          else
                          {
                            $price = "10";
                          }
                        }
                        elseif ($service == "Nadra Data") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "300";
                          }
                          else
                          {
                            $price = "200";
                          }
                        }
                        elseif ($service == "Call Data Record") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "1200";
                          }
                          else
                          {
                            $price = "1000";
                          }
                        }
                        elseif ($service == "Cnic Color Copy") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "150";
                          }
                          else
                          {
                            $price = "100";
                          }
                        }
                        elseif ($service == "Live Location") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "600";
                          }
                          else
                          {
                            $price = "400";
                          }
                        }
                        elseif ($service == "IMEI Tracing") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "1000";
                          }
                          else
                          {
                            $price = "600";
                          }
                        }
                        elseif ($service == "Other") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "100";
                          }
                          else
                          {
                            $price = "100";
                          }
                        }
                        elseif ($service == "Nadra Special") 
                        {
                          if ($acctype=="local") 
                          {
                            $price = "20";
                          }
                          else
                          {
                            $price = "20";
                          }
                        }
                        else
                        {
                          $price = "Wrong";
                        }



                        $in = "INSERT INTO newdata(Username,service,Profit,Status) VALUES('$uname','$service','$price','Processing')";
                        $ins = mysqli_query($con,$in);
                        $msg = "Order has been booked";
                      }
                      else
                      {
                        $msg = "Username not  found";
                      }
                    }

?>

标签: php

解决方案


推荐阅读