php - 有人入侵了我的 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";
}
}
?>
解决方案
推荐阅读
- python - 执行查询后无法得到查询结果
- amazon-web-services - Amazon APP Stream 中的 Cypress 测试自动化
- c# - 如何重构这个 ifs 瀑布,使其更干净、更高效?
- python - 有没有更好的方法来获得熊猫连续的年月值?
- php - 在 Docker 容器中坚持 Symfony 升级
- graphdb - 如何处理 java.io.IOException: GraphDB Workbench 中的断管?
- javascript - 观察者不适用于递归项目
- r - R:如何将新数据框合并到列表中的其他几个数据框
- grails - Grails - 读取 resources.xml 中的配置属性
- git - Github 工作流事件触发器同步不起作用?