Skip to content

Commit

Permalink
True fix for #3
Browse files Browse the repository at this point in the history
  • Loading branch information
checkymander committed Feb 17, 2022
1 parent 09a04ab commit 4e6e6ff
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 35 deletions.
35 changes: 14 additions & 21 deletions Payload_Type/athena/agent_code/Athena/Config/MythicConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,32 @@ public class HTTP
public HTTP(string uuid)
{
HttpClientHandler handler = new HttpClientHandler();
int callbackPort = Int32.Parse("callback_port");
string callbackHost = "callback_host";
int callbackPort = Int32.Parse("80");
string callbackHost = "http://test";
string getUri = "get_uri";
string queryPath = "query_path_name";
string postUri = "post_uri";
this.userAgent = "%USERAGENT%";
this.hostHeader = "%HOSTHEADER%";
this.hostHeader = "";
this.getURL = $"{callbackHost}:{callbackPort}/{getUri}?{queryPath}";
this.postURL = $"{callbackHost}:{callbackPort}/{postUri}";
this.proxyHost = "proxy_host:proxy_port";
this.proxyPass = "proxy_pass";
this.proxyUser = "proxy_user";
this.proxyHost = ":";
this.proxyPass = "";
this.proxyUser = "";
this.psk = "AESPSK";

if (!string.IsNullOrEmpty(this.proxyHost))
if (!string.IsNullOrEmpty(this.proxyHost) && this.proxyHost != ":")
{
try
WebProxy wp = new WebProxy()
{
WebProxy wp = new WebProxy()
{
Address = new Uri(this.proxyHost)
};
Address = new Uri(this.proxyHost)
};

if (!string.IsNullOrEmpty(this.proxyPass) && !string.IsNullOrEmpty(this.proxyUser))
{
handler.DefaultProxyCredentials = new NetworkCredential(this.proxyUser, this.proxyPass);
}
handler.Proxy = wp;
}
catch
if (!string.IsNullOrEmpty(this.proxyPass) && !string.IsNullOrEmpty(this.proxyUser))
{

handler.DefaultProxyCredentials = new NetworkCredential(this.proxyUser, this.proxyPass);
}
handler.Proxy = wp;
}

this.client = new HttpClient(handler);
Expand All @@ -100,7 +93,7 @@ public HTTP(string uuid)
}

//Doesn't do anything yet
this.encryptedExchangeCheck = bool.Parse("encrypted_exchange_check");
this.encryptedExchangeCheck = bool.Parse("False");

if (!string.IsNullOrEmpty(this.psk))
{
Expand Down
21 changes: 7 additions & 14 deletions Payload_Type/athena/agent_code/Athena/Config/Templates/HTTP.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,18 @@ namespace Athena.Config
this.proxyUser = "proxy_user";
this.psk = "AESPSK";

if (!string.IsNullOrEmpty(this.proxyHost))
if (!string.IsNullOrEmpty(this.proxyHost) && this.proxyHost != ":")
{
try
WebProxy wp = new WebProxy()
{
WebProxy wp = new WebProxy()
{
Address = new Uri(this.proxyHost)
};
Address = new Uri(this.proxyHost)
};

if (!string.IsNullOrEmpty(this.proxyPass) && !string.IsNullOrEmpty(this.proxyUser))
{
handler.DefaultProxyCredentials = new NetworkCredential(this.proxyUser, this.proxyPass);
}
handler.Proxy = wp;
}
catch
if (!string.IsNullOrEmpty(this.proxyPass) && !string.IsNullOrEmpty(this.proxyUser))
{

handler.DefaultProxyCredentials = new NetworkCredential(this.proxyUser, this.proxyPass);
}
handler.Proxy = wp;
}

this.client = new HttpClient(handler);
Expand Down

0 comments on commit 4e6e6ff

Please sign in to comment.