Skip to content

Commit

Permalink
Added console output
Browse files Browse the repository at this point in the history
  • Loading branch information
ceramicskate0 authored Mar 2, 2020
1 parent d94a938 commit b62eae2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions AutoUpdateSysmon/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace AutoUpdateSysmon
Expand Down Expand Up @@ -34,24 +35,24 @@ static void Main(string[] args)
else
{
RunUpdate(args[0], args[1]);
Console.WriteLine("[*] Update Status: Complete no issues.");
}
}
}
catch (Exception e)
{
Console.WriteLine("App ERROR: Error == " + e.Message.ToString());
Console.WriteLine("[!] App ERROR: Error: " + e.Message.ToString());
try
{
RunUpdate();
}
catch
catch(Exception r)
{
Console.WriteLine("[!] Update Status: " + r.Message.ToString());
Environment.Exit(1);
}
}



Thread.Sleep(3000);
}
private static void RunUpdate(string URL= @"https://raw.githubusercontent.com/ceramicskate0/sysmon-config/master/sysmonconfig-export.xml", string HostLocation= @"C:\Windows\sysmonconfig-export.xml")
{
Expand All @@ -66,6 +67,8 @@ private static void RunUpdate(string URL= @"https://raw.githubusercontent.com/ce
Process process = new Process();
process.StartInfo = startInfo;
process.Start();
string output = process.StandardOutput.ReadToEnd();
Console.WriteLine("[*] Process Output:" + output);
}
}
internal class CustomWebClient : WebClient
Expand Down

0 comments on commit b62eae2

Please sign in to comment.