-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf87150
commit 4c4282a
Showing
7 changed files
with
60 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
using System.Collections.Generic; | ||
using System.Security.Cryptography.X509Certificates; | ||
using SharpSocksServer.Config; | ||
using SharpSocksServer.ImplantComms; | ||
using SharpSocksServer.Logging; | ||
|
||
namespace SharpSocksServer.HttpServer | ||
{ | ||
public class HttpServerController | ||
{ | ||
public HttpServerController(ILogOutput logger, EncryptedC2RequestProcessor requestProcessor) | ||
public HttpServerController(ILogOutput logger, EncryptedC2RequestProcessor requestProcessor, SharpSocksConfig config) | ||
{ | ||
Logger = logger; | ||
RequestProcessor = requestProcessor; | ||
Config = config; | ||
} | ||
|
||
private ILogOutput Logger { get; } | ||
private EncryptedC2RequestProcessor RequestProcessor { get; } | ||
private SharpSocksConfig Config { get; } | ||
|
||
public void StartHttp(string httpServerUri) | ||
public void StartHttp() | ||
{ | ||
var httpAsyncListener = new HttpAsyncListener(RequestProcessor, Logger); | ||
httpAsyncListener.CreateListener(new Dictionary<string, X509Certificate2> | ||
{ | ||
{ | ||
httpServerUri, | ||
Config.HttpServerURI, | ||
null | ||
} | ||
}); | ||
Logger.LogMessage($"C2 HTTP processor listening on {httpServerUri}"); | ||
Logger.LogMessage($"C2 HTTP processor listening on {Config.HttpServerURI}"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters