search
HomeBackend DevelopmentPHP Tutorial想给phpmyadmin加一个验证码但找不到验证的地方,可否告知一下

想给phpmyadmin加一个验证码??但找不到验证的地方,可否告知一下。



毕竟没有验证码很容易被社工的。同时我也想JS加密密码,然后再用PHP解密。

知道的告知一下。谢谢。


回复讨论(解决方案)

设置一下,让它登录后才能访问还不可以吗

设置一下,让它登录后才能访问还不可以吗

可以说要仔细一点吗??不是很明白。
我是想加一个验证码或者对密码进行加密也行。

呵呵,那你就得去改改phpmyadmin的源码了。

它自带的就有登录功能

呵呵,那你就得去改改phpmyadmin的源码了。

它自带的就有登录功能

这个我知道呀,但它验证用户各与密码的地方在那里,我找了好长时间,就是找不到。

是用户名与密码

来个高手吧,到底在那里修改呢???

登录表单在 libraries/auth/cookie.auth.lib.php 240 行附近
有关用户名的操作在该文件450行附近

    if (! empty($_REQUEST['pma_username'])) {        // The user just logged in        $GLOBALS['PHP_AUTH_USER'] = $_REQUEST['pma_username'];        $GLOBALS['PHP_AUTH_PW']   = empty($_REQUEST['pma_password']) ? '' : $_REQUEST['pma_password'];        if ($GLOBALS['cfg']['AllowArbitraryServer'] && isset($_REQUEST['pma_servername'])) {            $GLOBALS['pma_auth_server'] = $_REQUEST['pma_servername'];        }        return true;    }

phpmysqladmin 本身不需要验证用户名和口令的真伪
因为户名和口令是给 mysql 用的,错了就连接不上数据库

@xuzuning 版主

phpmyadmin不连接mysql怎样操作数据库里的东西呢?我觉得纳闷呢。又在那里将这些信息传给mysql呢??

@xuzuning 版主

网上很多都讲怎样用phpMyAdmin连接mysql,但并没有说明如何修改phpMyAdmin加验证码以加强安全性。

不然,有人不停地扫,一般情况下,一个小菜鸟,两三天,估计也扫出来了。

phpmyadmin不连接mysql怎样操作数据库里的东西呢?我觉得纳闷呢。又在那里将这些信息传给mysql呢?? 你是误解了我的意思了
phpmyadmin 本身是不需要登陆的
需要输入的是访问数据库的用户名和口令
因此 phpmyadmin 没有提供验证,也无法判断登入 mysql 的用户名和口令是否合法

如果你连你的 phpmyadmin 的入口都公开了出来,那还担心人家“扫”干什么?

引用 8 楼 bluewjzhhr 的回复:phpmyadmin不连接mysql怎样操作数据库里的东西呢?我觉得纳闷呢。又在那里将这些信息传给mysql呢??你是误解了我的意思了
phpmyadmin 本身是不需要登陆的
需要输入的是访问数据库的用户名和口令
因此 phpmyadmin 没有提供验证,也无法判断登入 mysql 的用户名和口令是否合法

如果你连……

版主,不是我主动公开的,也许是黑客通过某种方法探测到的。

还有呀:

 if (! empty($_REQUEST['pma_username'])) {        // The user just logged in        $GLOBALS['PHP_AUTH_USER'] = $_REQUEST['pma_username'];        $GLOBALS['PHP_AUTH_PW']   = empty($_REQUEST['pma_password']) ? '' : $_REQUEST['pma_password'];        if ($GLOBALS['cfg']['AllowArbitraryServer'] && isset($_REQUEST['pma_servername'])) {            $GLOBALS['pma_auth_server'] = $_REQUEST['pma_servername'];        }        return true;    }


我怎么看,都觉得这个不是验证用户名登录的地方呀??是不是在其它地方??

你把 phpmyadmin 的入口甚至目录都改个名,不就可以免除挡墙的“攻击”了吗
我没说那是用户验证吧?我只是说与登录名相关,是吧?
况且,我再三的说了,phpmyadmin是不需要登录的,用户登录只是为了连接mysql而设的

这个我理解,知道用户登录是为了连接mysql设计的,你知道在那里进行:

"select * from user where user='".$user."' and password='".$password."'";

的吗???

这个我理解,知道用户登录是为了连接mysql设计的,你知道在那里进行:

"select * from user where user='".$user."' and password='".$password."'";

的吗???

我想版主的意思是  phpmyadmin只是提供接口传入mysql用户名和密码进行连接的。所以应该找具体在哪里执行mysql_connect(xx,xx,xx),然后对连接的状态进行判断。至于你说的执行这句sql,应该是在mysql数据库内部执行的了;或许mysql自身有个表是用来放用户信息的。

引用 13 楼 bluewjzhhr 的回复:这个我理解,知道用户登录是为了连接mysql设计的,你知道在那里进行:

"select * from user where user='".$user."' and password='".$password."'";

的吗???

我想版主的意思是  phpmyadmin只是提供接口传入mysql用户名和密码……


我知道版主的意思,是我的表述不清楚。

找了三个晚上,依然无结果。想给phpMyAdmin加一个验证码,杂就这么难呢?????

本帖最后由 xuzuning 于 2012-12-20 16:46:41 编辑
            登录表单在 libraries/auth/cookie.auth.lib.php 240 行附近
有关用户名的操作在该文件450行附近PHP code?123456789    if (! empty($_REQUEST['pma_username'])) {……

引用 7 楼 xuzuning 的回复:本帖最后由 xuzuning 于 2012-12-20 16:46:41 编辑
            登录表单在 libraries/auth/cookie.auth.lib.php 240 行附近
有关用户名的操作在该文件450行附近PHP code?123456789    if (! empty($_REQUEST['p……


发现mysql的加密方式为sha1(unhex(sha1('xxx')))这样的,我直接在JS前端加密后,再传回去,然后直接的密码对比就行了。这样不更安全些????????

不相信这样的密码,谁破解的了。也不用为其它的明文传输密码问题而发愁了。

很简单的问题 提交页面和显示页面都加个东西就可以啊

很简单的问题 提交页面和显示页面都加个东西就可以啊

关键是phpMyAdmin里验证密码的地方在那里,找不到呀!!!!!!

关键是phpMyAdmin里验证密码的地方在那里,找不到呀!!!!!!
问题是 phpMyAdmin 不验证密码,因为密码是给 mysql 用的,php中无法验证
要说几遍才能明白呢?

一般使用 phpMyAdmin 时都将用户名和密码写在 config 文件里的

用户名或密码错了,就连不上 mysql,此时 mysql 会给出相应的错误信息
这和你到银行取钱是一个道理,柜员受理你的业务,密码得由你自己输,输错了他就转告你错了

表述不准确,请版主谅解

phpMyAdmin 总得去mysql中找用户名与密码同时存在的记录吧,不去mysql中查找,怎么知道有此用户呢?

我想知道phpMyAdmin 是怎样把用户名与密码给到mysql的。


找到了:
 在common.inc.php里面大概第945行:

// Connects to the server (validates user's login)
$userlink = PMA_DBI_connect($cfg['Server']['user'], $cfg['Server']['password'], false);

谢谢版主了。

前面我已经说了
$GLOBALS['PHP_AUTH_USER'] = $_REQUEST['pma_username'];
$GLOBALS['PHP_AUTH_PW']   = empty($_REQUEST['pma_password']) ? '' : $_REQUEST['pma_password'];
这就是缓存传入的用户名和口令的
当然还有几处类似的地方

当你连接 mysql 时需要执行 mysql_connect('localhost', $username, $parssword); 这样是吧?
这个 $username 和 $parssword 不就是传入的或预置的用户名和口令吗
这就是 phpmyadmin 让你输入的用户名和口令和口令,是用于连接数据库的
当数据库还没有连接时,phpmydamin 如何到 mysql 中去查找用户名和口令呢?
那么如果数据库已经连接上了,验证这个用户名和口令又有什么用呢?
当然,连接时 mysql 本身也要去 user 表验证用户名和口令的,但你是干预不了的

这和你的应用系统是不一样的,你的应用系统的用户名和口令的确是要在连接mysql后去表中验证用户名和口令
估计你把这两个混淆了

@xuzuning
有个奇怪的事要问下:验证码加上了,但验证码生成的session或者cookie进不了phpMyAdmin里面,换句话说:phpMyAdmin应该在某个地方把session给注销掉了。目前验证码是可以正常显示,但使用不了。

谁弄好了,说下。快整死我了

云里雾里的。
嗷嗷。。。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Working with Flash Session Data in LaravelWorking with Flash Session Data in LaravelMar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

Build a React App With a Laravel Back End: Part 2, ReactBuild a React App With a Laravel Back End: Part 2, ReactMar 04, 2025 am 09:33 AM

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

cURL in PHP: How to Use the PHP cURL Extension in REST APIscURL in PHP: How to Use the PHP cURL Extension in REST APIsMar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel TestsSimplified HTTP Response Mocking in Laravel TestsMar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon12 Best PHP Chat Scripts on CodeCanyonMar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Notifications in LaravelNotifications in LaravelMar 04, 2025 am 09:22 AM

In this article, we're going to explore the notification system in the Laravel web framework. The notification system in Laravel allows you to send notifications to users over different channels. Today, we'll discuss how you can send notifications ov

Explain the concept of late static binding in PHP.Explain the concept of late static binding in PHP.Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

PHP Logging: Best Practices for PHP Log AnalysisPHP Logging: Best Practices for PHP Log AnalysisMar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor