通过PHP伪造$ _POST

How*_*Gee 4 php security post http

我现在都处于安全恐慌状态,所以我要尽可能地保证一切安全.我登录了,我引用了这个:

http://www.addedbytes.com/writing-secure-php/writing-secure-php-1/

第一个例子是登录的例子,如果你说?authorization=1你进去了.但是如果我把我的代码包裹起来if($_POST)那么用户必须发帖子.用户可以伪造一个$_POST吗?我怎么去假装$_POST

Mar*_*c B 15

用户只需在本地计算机上创建一个文件:

<form action="http://yoursite.com/login.php" method="post">
    <input type="text" name="username"  value="hahaha faked it!" />
    <input type="text" name="password" value="hee hee you can't tell this is fake" />
    <input type="submit">
</form>
Run Code Online (Sandbox Code Playgroud)

和繁荣,"假"的帖子.换句话说,您必须假设用户发送的任何内容都可能是假的.

  • +1 POST和GET一样容易伪造.您还应该解释一下CSRF令牌. (2认同)