From d3da1158eaffbe899a291245b51a27a388f18cef Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 27 Apr 2017 10:28:42 +0900 Subject: [PATCH] fix wmic path in json --- .../com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java | 5 +++-- .../java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java | 1 + src/test/resources/config/example.json | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java b/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java index 4c88b90..ec46255 100644 --- a/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java +++ b/src/main/java/com/loafle/overflow/crawler/wmi/WMICrawlerLinux.java @@ -35,10 +35,11 @@ public class WMICrawlerLinux extends WMICrawlerOS { String ip = config.getTarget().getConnection().getIp(); String query = item.getQueryInfo().getQuery(); - + String wmicPath = (String)item.getQueryInfo().getExtend().get("wmicPath"); + //FIXME:: where is wmic ?? List argList = new ArrayList(); - argList.add("/home/snoop/temp/wmic"); + argList.add(wmicPath); argList.add("-U"); argList.add(id + "%" + pw); argList.add("//" + ip); diff --git a/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java b/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java index fee2ad3..935518b 100644 --- a/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java +++ b/src/test/java/com/loafle/overflow/crawler/wmi/WMICrawlerTest.java @@ -116,6 +116,7 @@ public class WMICrawlerTest { System.out.println(c); } + @Ignore @Test public void testWMIJson() throws Exception { diff --git a/src/test/resources/config/example.json b/src/test/resources/config/example.json index b5731c5..39f5150 100644 --- a/src/test/resources/config/example.json +++ b/src/test/resources/config/example.json @@ -30,7 +30,7 @@ "query": "select PercentProcessorTime, PercentIdleTime, PercentUserTime,Name from Win32_PerfFormattedData_PerfOS_Processor", "extend" : { "nameSpace":"root/cimv2", - "wmicPath": "" + "wmicPath": "/home/snoop/temp/wmic" } }, "mappingInfo" : { @@ -49,7 +49,7 @@ "query": "select PercentProcessorTime, PercentIdleTime, PercentUserTime,Name from Win32_PerfFormattedData_PerfOS_Processor where Name='_Total'", "extend" : { "nameSpace":"root/cimv2", - "wmicPath": "" + "wmicPath": "/home/snoop/temp/wmic" } }, "mappingInfo" : {