关闭

关闭

关闭

封号提示

内容

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

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

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

agnostic_jing
2012-07-25 0人阅读 0 0 0 暂无简介 举报

简介:本文档为《获取远程机器共享目录的物理路径的代码doc》,可适用于IT/计算机领域

依靠端口用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)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

评分:

/5

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部

举报
资料