create configs
This commit is contained in:
@@ -16,20 +16,15 @@ impl PowerShell {
|
||||
event_id: String,
|
||||
_system: &event::System,
|
||||
event_data: HashMap<String, String>,
|
||||
rdr: &mut csv::Reader<&[u8]>,
|
||||
) {
|
||||
if event_id == "4103" {
|
||||
&self.execute_pipeline(&event_data, rdr);
|
||||
&self.execute_pipeline(&event_data);
|
||||
} else if event_id == "4104" {
|
||||
&self.execute_remote_command(&event_data, rdr);
|
||||
&self.execute_remote_command(&event_data);
|
||||
}
|
||||
}
|
||||
|
||||
fn execute_pipeline(
|
||||
&mut self,
|
||||
event_data: &HashMap<String, String>,
|
||||
rdr: &mut csv::Reader<&[u8]>,
|
||||
) {
|
||||
fn execute_pipeline(&mut self, event_data: &HashMap<String, String>) {
|
||||
// パイプライン実行をしています
|
||||
let default = String::from("");
|
||||
let commandline = event_data.get("ContextInfo").unwrap_or(&default);
|
||||
@@ -45,23 +40,19 @@ impl PowerShell {
|
||||
let command = rm_after.replace_all(&temp_command_with_extra, "");
|
||||
|
||||
if command != "" {
|
||||
utils::check_command(4103, &command, 1000, 0, &default, &default, rdr);
|
||||
utils::check_command(4103, &command, 1000, 0, &default, &default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn execute_remote_command(
|
||||
&mut self,
|
||||
event_data: &HashMap<String, String>,
|
||||
rdr: &mut csv::Reader<&[u8]>,
|
||||
) {
|
||||
fn execute_remote_command(&mut self, event_data: &HashMap<String, String>) {
|
||||
// リモートコマンドを実行します
|
||||
let default = String::from("");
|
||||
let message_num = event_data.get("MessageNumber");
|
||||
let commandline = event_data.get("ScriptBlockText").unwrap_or(&default);
|
||||
|
||||
if let Some(_) = message_num {
|
||||
utils::check_command(4104, &commandline, 1000, 0, &default, &default, rdr);
|
||||
utils::check_command(4104, &commandline, 1000, 0, &default, &default);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user