我知道已经有人就这个话题提出了很多问题。我也知道要走的路是准备好的陈述。然而,我仍然没有完全理解以下是否或如何可能成为安全问题:
$mysqli = new mysqli("localhost", "root", "", "myDatabase");
$mysqli->set_charset("utf8");
$pw = mysqli_real_escape_string($mysqli,$_POST['pw']);
$username = mysqli_real_escape_string($mysqli,$_POST['username']);
$str = "SELECT * FROM users WHERE id='".$id."' AND username='".$username."'";
$result = $this -> mysqli -> query($qstr);
if($result->num_rows > 0){
//user logged in
}
Run Code Online (Sandbox Code Playgroud)
我尝试了注入备忘单中的许多不同输入,但找不到任何通过查询的内容。例如,如果我输入任何带有“;”的内容 然后 $result 变成 false,因为据我所知,一个查询不能包含两个单独的语句。任何带有 ' 或 " 的输入都会被 mysqli_real_escape_string 清理。
您能向我解释一下上面的代码是如何被利用的吗?如果您有一个解释它的链接,我也非常乐意阅读它!
干杯
编辑:这个答案已经回答了:
绕过 mysql_real_escape_string() 的 SQL 注入
然而,这个问题是关于旧版本的 mysql 而不是 mysqli。其次,得票最多的答案陈述了以下可以绕过它的示例:
mysql_query('SET NAMES gbk');
$var = mysql_real_escape_string("\xbf\x27 OR 1=1 /*");
mysql_query("SELECT * FROM test WHERE name = '$var' LIMIT …Run Code Online (Sandbox Code Playgroud) 我正在尝试在navigator.geolocation.getCurrentPosition的回调中的新浏览器窗口中打开Google地图。
问题是浏览器将新窗口作为弹出窗口打开,因为调用是异步的。在大多数浏览器中,询问用户是否要允许弹出窗口。但是,某些浏览器(尤其是移动浏览器)不会显示此消息。取而代之的是,它们只是阻止了弹出窗口,对于用户而言,似乎什么也没有发生。
我尝试的第一种方法是(缩短版本,不进行错误处理等):
$("#getGoogleDirection").on("click",function(e){
navigator.geolocation.getCurrentPosition(openMap);
});
function openMap(position){
var userLat = position.coords.latitude;
var userLng = position.coords.longitude;
var destinationLat = "<?php echo $destination["lat"]?>";
var destinationLng = "<?php echo $destination["lng"]?>";
window.open("https://www.google.com/maps/dir/"+userLat+","+userLng+"/"+destinationLat+","+destinationLng+"/");
}
Run Code Online (Sandbox Code Playgroud)
如果浏览器询问用户是否要打开弹出窗口,则此方法有效。但是,如前所述,某些浏览器不询问用户,而只是阻止弹出窗口。
所以我尝试了另一个选择:
var newWindow;
$("#getGoogleDirection").on("click",function(e){
navigator.geolocation.getCurrentPosition(openMap);
newWindow = window.open('', '_blank');
newWindow.document.write('Loading route...');
});
function openMap(position){
var userLat = position.coords.latitude;
var userLng = position.coords.longitude;
var destinationLat = "<?php echo $destination["lat"]?>";
var destinationLng = "<?php echo $destination["lng"]?>";
newWindow.location.href = 'https://www.google.com/maps/dir/"+userLat+","+userLng+"/"+destinationLat+","+destinationLng+"/"';
}
Run Code Online (Sandbox Code Playgroud)
这也有效。但是,问题在于浏览器打开了新窗口,但在旧窗口中打开了navigator.geolocation.getCurrentPosition的确认弹出框。因此,必须返回到旧窗口,按确认按钮,然后再返回新窗口。这对于用户来说不是很方便。
是否可以通过编程方式进行窗口切换?第二,可以同步制作navigator.geolocation.getCurrentPosition,以便我可以调用
window.open()
Run Code Online (Sandbox Code Playgroud)
直接在$(“#getGoogleDirection”)的点击事件处理程序中,因为不会将其作为弹出窗口打开。
非常感谢!
我们希望使用银行业务API进行SEPA从我们的银行帐户到用户银行帐户的转帐。为此,用户需要在表格中输入其IBAN和BIC。我们获取这些数据(受SSL保护),然后使用银行REST API进行汇款。如果我们收到“成功”响应,则会向用户显示一条消息,表明资金已转入他的帐户。
在整个过程中,我们不会将IBAN或BIC存储在本地变量中的任何位置,也不会存储在数据库中。与fidor API的连接是安全的。
因此,存在以下问题:1. SEPA数据通常是否需要PCI合规性?2.如果是,我们是否需要符合上述用例的PCI?因为我们从不存储任何数据。
我试图在Google上找到关于此的信息,但没有成功。如果您有相同的用例,请与您分享经验,我将非常感谢。另外,如果您有关于此主题的链接,我也将不胜感激。
提前致谢!