Can you monitor which file executes the SQL statement?

Source: Internet
Author: User
I have to take care of the project, the developer is not me, but found that the site may have a backdoor.
Data is often modified by people.
But a file can not be found in a file.
So I want to monitor which file performs the operation recorded down analysis.
Excuse me, is there any way?


Reply to discussion (solution)

Does your project use a database class?

Does your project use a database class?


Refers to the conn.php when the database operation is called.

Does your project use a database class?



The Include folder has db_mysql.class.php

First check if there are mysql_query in the file other than db_mysql.class.php
If there is, it is a place to be screened.

In the db_mysql.class.php file, the method name contains the query, execute, INSERT, UPDATE, fetch words in the method
Join

File_put_contents (' Log.txt ', Print_r (Debug_backtrace (), 1), file_append);
You can see from the file Log.txt where the SQL commands were executed.

Water for a moment, and then see again

First check if there are mysql_query in the file other than db_mysql.class.php
If there is, it is a place to be screened.

In the db_mysql.class.php file, the method name contains the query, execute, INSERT, UPDATE, fetch words in the method
Join

File_put_contents (' Log.txt ', Print_r (Debug_backtrace (), 1), file_append);
You can see from the file Log.txt where the SQL commands were executed.



Thank you. However, I found that some PHP files also use some of the SQL statements themselves. Can I just write it in config.php?

First check if there are mysql_query in the file other than db_mysql.class.php
If there is, it is a place to be screened.

In the db_mysql.class.php file, the method name contains the query, execute, INSERT, UPDATE, fetch words in the method
Join

File_put_contents (' Log.txt ', Print_r (Debug_backtrace (), 1), file_append);
You can see from the file Log.txt where the SQL commands were executed.



Array
(
[0] = = Array
(
[File] =/www/web/zlhk/public_html/include/conn.php
[Line] = 3
[function] = include
)

[1] = = Array
(
[File] =/www/web/zlhk/public_html/madmin45/users.php
[Line] = 8
[Args] = Array
(
[0] =/www/web/zlhk/public_html/include/conn.php
)

[function] = include
)

)
Array

It's all about data like that.

That's what you didn't do as I said!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.