关闭

关闭

关闭

封号提示

内容

首页 获取远程机器共享目录的物理路径的代码.doc

获取远程机器共享目录的物理路径的代码.doc

获取远程机器共享目录的物理路径的代码.doc

上传者: agnostic_jing 2012-07-25 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《获取远程机器共享目录的物理路径的代码doc》,可适用于IT/计算机领域,主题内容包含依靠端口用wmi。像下边的脚本是得到共享目录ttt的物理目录,依靠端口靠smb。bt下的nmap第一:依靠端口用wmi。像下边的脚本是得到共享目录t符等。

依靠端口用wmi。像下边的脚本是得到共享目录ttt的物理目录,依靠端口靠smb。bt下的nmap第一:依靠端口用wmi。像下边的脚本是得到共享目录ttt的物理目录。代码如下:strPath="ttt"strPath=Replace(strPath,"","")arrPath=Split(strPath,"")strComputer=arrPath()strShare=arrPath()SetobjSWbemLocator=CreateObject("WbemScriptingSWbemLocator")SetobjWMIService=objSWbemLocatorConnectServer(strComputer,"rootCIMV","admin","")SetcolItems=objWMIServiceExecQuery("Select*FromWinShareWhereName='"strShare"'")ForEachobjItemincolItemsWscriptEchoobjItemPathNext*********************************微软的脚本有问题只能得到本机***********************************************strPath="atlfspublic"strPath=Replace(strPath,"","")arrPath=Split(strPath,"")strComputer=arrPath()strShare=arrPath()SetobjWMIService=GetObject("winmgmts:"strComputer"rootcimv")SetcolItems=objWMIServiceExecQuery("Select*FromWinShareWhereName='"strShare"'")ForEachobjItemincolItemsWscriptEchoobjItemPathNext*********************************微软的脚本有问题只能得到本机***********************************************第二、依靠端口靠smb。bt下的nmap复制代码代码如下:rootbt:~#nmapscriptsmbenumsharesscriptargs=smbuser=administrator,smbpass=toorpStartingNmapBETA(http:nmaporg)at:CSTNmapscanreportforHostisup(slatency)PORTSTATESERVICEtcpopenmicrosoftdsMACAddress::C::B:F:(VMware)Hostscriptresults:wwwiniotcn|smbenumshares:|ADMIN$|Type:STYPEDISKTREEHIDDEN|Comment:RemoteAdmin|Users:,Max:<unlimited>|Path:C:WINDOWS|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|C$|Type:STYPEDISKTREEHIDDEN|Comment:Defaultshare|Users:,Max:<unlimited>|Path:C:|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|IPC$|Type:STYPEIPCHIDDEN|Comment:RemoteIPC|Users:,Max:<unlimited>|Path:|Anonymousaccess:READ<notafileshare>|Currentuser('administrator')access:READ<notafileshare>|NETLOGON|Type:STYPEDISKTREE|Comment:Logonservershare|Users:,Max:<unlimited>|Path:C:WINDOWSSYSVOLsysvolhaiyangtopcomSCRIPTS|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|SYSVOL|Type:STYPEDISKTREE|Comment:Logonservershare|Users:,Max:<unlimited>|Path:C:WINDOWSSYSVOLsysvol|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|ttt|Type:STYPEDISKTREE|Comment:|Users:,Max:<unlimited>|Path:c:sharettt|Anonymousaccess:<none>|Currentuser('administrator')access:READNmapdone:IPaddress(hostup)scannedinsecondsrootbt:~#第一:依靠端口用wmi。像下边的脚本是得到共享目录ttt的物理目录。复制代码代码如下:strPath="ttt"strPath=Replace(strPath,"","")arrPath=Split(strPath,"")strComputer=arrPath()strShare=arrPath()SetobjSWbemLocator=CreateObject("WbemScriptingSWbemLocator")SetobjWMIService=objSWbemLocatorConnectServer(strComputer,"rootCIMV","admin","")SetcolItems=objWMIServiceExecQuery("Select*FromWinShareWhereName='"strShare"'")ForEachobjItemincolItemsWscriptEchoobjItemPathNext*********************************微软的脚本有问题只能得到本机***********************************************strPath="atlfspublic"strPath=Replace(strPath,"","")arrPath=Split(strPath,"")strComputer=arrPath()strShare=arrPath()SetobjWMIService=GetObject("winmgmts:"strComputer"rootcimv")SetcolItems=objWMIServiceExecQuery("Select*FromWinShareWhereName='"strShare"'")ForEachobjItemincolItemsWscriptEchoobjItemPathNext*********************************微软的脚本有问题只能得到本机***********************************************第二、依靠端口靠smb。bt下的nmap复制代码代码如下:rootbt:~#nmapscriptsmbenumsharesscriptargs=smbuser=administrator,smbpass=toorpStartingNmapBETA(http:nmaporg)at:CSTNmapscanreportforHostisup(slatency)PORTSTATESERVICEtcpopenmicrosoftdsMACAddress::C::B:F:(VMware)Hostscriptresults:|smbenumshares:|ADMIN$|Type:STYPEDISKTREEHIDDEN|Comment:RemoteAdmin|Users:,Max:<unlimited>|Path:C:WINDOWS|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|C$|Type:STYPEDISKTREEHIDDEN|Comment:Defaultshare|Users:,Max:<unlimited>|Path:C:|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|IPC$|Type:STYPEIPCHIDDEN|Comment:RemoteIPC|Users:,Max:<unlimited>|Path:|Anonymousaccess:READ<notafileshare>|Currentuser('administrator')access:READ<notafileshare>|NETLOGON|Type:STYPEDISKTREE|Comment:Logonservershare|Users:,Max:<unlimited>|Path:C:WINDOWSSYSVOLsysvolhaiyangtopcomSCRIPTS|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|SYSVOL|Type:STYPEDISKTREE|Comment:Logonservershare|Users:,Max:<unlimited>|Path:C:WINDOWSSYSVOLsysvol|Anonymousaccess:<none>|Currentuser('administrator')access:READWRITE|ttt|Type:STYPEDISKTREE|Comment:|Users:,Max:<unlimited>|Path:c:sharettt|Anonymousaccess:<none>|Currentuser('administrator')access:READNmapdone:IPaddress(hostup)scannedinsecondsrootbt:~#详细出处参考:http:wwwjbnetarticlehtm

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/5
1下载券 下载 加入VIP, 送下载券

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部