首页 > 解决方案 > phpmyadmin直接url访问(post方式)

问题描述

我正在尝试使用 url post 方法访问 phpmyadmin。

www.example.com/phpmyadmin/?pma_username=####&pma_password=####

但是什么也没发生,phpmyadmin 是否以某种方式阻止了通过 url 的直接访问?还是我使用了错误的帖子变量?

这是一块未改动的 phpmyadmin index.php 登录表单。

    <!-- Login form -->
<form method="post" id="login_form" action="index.php" name="login_form" class="disableAjax login hide js-show">
    <fieldset>
    <legend><input type="hidden" name="set_session" value="123" />Log in<a href="./doc/html/index.html" target="documentation"><img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help" /></a></legend><div class="item">
            <label for="input_username">Username:</label>
            <input type="text" name="pma_username" id="input_username" value="" size="24" class="textfield"/>
        </div>
        <div class="item">
            <label for="input_password">Password:</label>
            <input type="password" name="pma_password" id="input_password" value="" size="24" class="textfield" />
        </div>    <input type="hidden" name="server" value="1" /></fieldset><fieldset class="tblFooters"><input value="Go" type="submit" id="input_go" /><input type="hidden" name="target" value="index.php" /><input type="hidden" name="token" value="123" /></fieldset>

标签: phpmyadmin

解决方案


将参数指定为 URL 的一部分,如 中www.example.com/phpmyadmin/?pma_username=####&pma_password=####所示,实际上是 GET 查询,而不是 POST(POST 使用网页上的表单值而不是 URL 查询字符串)。

您尝试使用的格式有些陈旧,出于安全考虑已在 phpMyAdmin 4.9.0 中删除。您仍然可以指定服务器、数据库、表和目标页面;但是删除了用户名和密码选项。

对于类似的功能,您可能会想出一个涉及 auth_type 配置的解决方案(它将用户名和密码硬编码到配置指令中,因此需要您配置一些其他身份验证方式,例如通过 Web 服务器的 HTTP BASIC)或auth_type 登录(这需要实现您自己的身份验证脚本,示例在文档中)。您可以根据将实际 POST 值传递回登录页面来提出重定向表单,但由于采取了安全措施,我不确定这是否会起作用。

基本上,对不起,这个功能已经消失并且不太可能返回。


推荐阅读