Home  >  Article  >  Backend Development  >  phpmyadmin changes the sql statement to base64 transmission_PHP tutorial

phpmyadmin changes the sql statement to base64 transmission_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:48:241149browse

Because the security dog ​​function is installed on the server, our direct sql cannot be used. Let me introduce to you how phpmyadmin solves this problem by changing the sql statement to base64 transmission.

1. First modify libraries/header.inc.php

Paste the js base64 function into line 61

2. Then modify js/sql.js

Find $("#sqlqueryform.ajax").live("submit",function(a){ This paragraph

Change to the following,

$.post(b.attr("action"),b.serialize(),function(d){
The code is as follows
 代码如下 复制代码

$("#sqlqueryform.ajax").live("submit",function(a){
  a.preventDefault();
  var b=$(this);
  if(!checkSqlQuery(b[0]))return false;
  $(".error").remove();
  var c=PMA_ajaxShowMessage(),e=$("#sqlqueryresults");
  PMA_prepareForAjaxRequest(b);
  $('#sqlquery').val( Base64.encode( $('#sqlquery').val() )  );
  $.post(b.attr("action"),b.serialize(),function(d){

Copy code


$("#sqlqueryform.ajax").live("submit",function(a){

a.preventDefault();
var b=$(this);

if(!checkSqlQuery(b[0]))return false;
 代码如下 复制代码


$sql_query=base64_decode($sql_query);

$(".error").remove();

var c=PMA_ajaxShowMessage(),e=$("#sqlqueryresults");
PMA_prepareForAjaxRequest(b);

$('#sqlquery').val( Base64.encode( $('#sqlquery').val() ) );

Import.php file line 24 insert
The code is as follows Copy code
$sql_query=base64_decode($sql_query);
ok Now if the query entered by clicking sql will be encoded by base64 before being transmitted, it can avoid the interception of security defense software such as SafeDog
http://www.bkjia.com/PHPjc/632778.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632778.htmlTechArticleBecause the security dog ​​function is installed on the server, our direct sql cannot be used. Let me explain to you below. Classmates introduce how phpmyadmin changes the sql statement to base64 transmission to solve...
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