wmic path in json
This commit is contained in:
snoop 2017-04-27 10:28:42 +09:00
parent 275d1e907f
commit d3da1158ea
3 changed files with 6 additions and 4 deletions

View File

@ -35,10 +35,11 @@ public class WMICrawlerLinux extends WMICrawlerOS {
String ip = config.getTarget().getConnection().getIp(); String ip = config.getTarget().getConnection().getIp();
String query = item.getQueryInfo().getQuery(); String query = item.getQueryInfo().getQuery();
String wmicPath = (String)item.getQueryInfo().getExtend().get("wmicPath");
//FIXME:: where is wmic ??
List<String> argList = new ArrayList<String>(); List<String> argList = new ArrayList<String>();
argList.add("/home/snoop/temp/wmic"); argList.add(wmicPath);
argList.add("-U"); argList.add("-U");
argList.add(id + "%" + pw); argList.add(id + "%" + pw);
argList.add("//" + ip); argList.add("//" + ip);

View File

@ -116,6 +116,7 @@ public class WMICrawlerTest {
System.out.println(c); System.out.println(c);
} }
@Ignore
@Test @Test
public void testWMIJson() throws Exception { public void testWMIJson() throws Exception {

View File

@ -30,7 +30,7 @@
"query": "select PercentProcessorTime, PercentIdleTime, PercentUserTime,Name from Win32_PerfFormattedData_PerfOS_Processor", "query": "select PercentProcessorTime, PercentIdleTime, PercentUserTime,Name from Win32_PerfFormattedData_PerfOS_Processor",
"extend" : { "extend" : {
"nameSpace":"root/cimv2", "nameSpace":"root/cimv2",
"wmicPath": "" "wmicPath": "/home/snoop/temp/wmic"
} }
}, },
"mappingInfo" : { "mappingInfo" : {
@ -49,7 +49,7 @@
"query": "select PercentProcessorTime, PercentIdleTime, PercentUserTime,Name from Win32_PerfFormattedData_PerfOS_Processor where Name='_Total'", "query": "select PercentProcessorTime, PercentIdleTime, PercentUserTime,Name from Win32_PerfFormattedData_PerfOS_Processor where Name='_Total'",
"extend" : { "extend" : {
"nameSpace":"root/cimv2", "nameSpace":"root/cimv2",
"wmicPath": "" "wmicPath": "/home/snoop/temp/wmic"
} }
}, },
"mappingInfo" : { "mappingInfo" : {