Skip to content

Commit

Permalink
Merge pull request #481 from cmu-sei/v8
Browse files Browse the repository at this point in the history
Working with Greg_S on getting containers working...
  • Loading branch information
sei-dupdyke authored Jan 8, 2025
2 parents 38e9fb6 + eb38ecc commit 338d69c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/Dockerfile-linux-client
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@ RUN apk add --no-cache \
busybox-extras \
nikto \
openssh-client \
python3 && \
python3 \
iproute2 \
ethtool && \
wget 'https://github.com/sqlmapproject/sqlmap/tarball/master' -O sqlmap.tar.gz && \
mkdir sqlmap && \
tar -xvf sqlmap.tar.gz -C sqlmap && \
rm sqlmap.tar.gz

COPY --from=dev /app/ghosts.client.linux/out ./app
WORKDIR /app/
WORKDIR /app/

ENV ASPNETCORE_URLS=http://+:5000
EXPOSE 5000/tcp

CMD ["dotnet", "./ghosts.client.linux.dll"]
CMD ["dotnet", "./ghosts.client.linux.dll"]
2 changes: 1 addition & 1 deletion src/ghosts.client.linux/Comms/CheckId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public string Id
private string Run()
{
// Ignore all certs
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
ServicePointManager.ServerCertificateValidationCallback += (_, _, _, _) => true;

var s = string.Empty;

Expand Down
3 changes: 0 additions & 3 deletions src/ghosts.client.linux/Handlers/SharepointHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,6 @@ public void Execute(TimelineHandler handler, TimelineEvent timelineEvent)
header = "http://"; //default header
}




if (credentialKey == null)
{
Log.Trace($"Sharepoint:: The command args must specify a 'credentialKey:<value>' , sharepoint browser action will not be executed.");
Expand Down
7 changes: 7 additions & 0 deletions src/ghosts.client.linux/Infrastructure/WebClientHeaders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using System.Net;
using Ghosts.Domain;
using Ghosts.Domain.Code;
using Newtonsoft.Json;
using NLog;
using NLog.Fluent;

namespace ghosts.client.linux.Infrastructure
{
Expand All @@ -12,6 +15,8 @@ namespace ghosts.client.linux.Infrastructure
/// </summary>
public static class WebClientBuilder
{
public static readonly Logger _log = LogManager.GetCurrentClassLogger();

public static WebClient Build(ResultMachine machine, bool useId = true)
{
var client = new WebClient();
Expand Down Expand Up @@ -47,6 +52,8 @@ public static IDictionary<string, string> GetHeaders(ResultMachine machine, bool
dict.Add("ghosts-user", username);
dict.Add("ghosts-version", ApplicationDetails.Version);

_log.Trace($"Webrequest headers generated: {JsonConvert.SerializeObject(dict)}");

return dict;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/ghosts.client.linux/config/application.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/ghosts.client.linux/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<targets>
<target name="logfile" xsi:type="File" fileName="logs/app.log" layout="${date:universalTime=true:format=dd/MM/yyyy H\:mm\:ss tt}|${callsite}|${message}" archiveAboveSize ="1000000" maxArchiveFiles="2" />
<target name="clientupdates" xsi:type="File" fileName="logs/clientupdates.log" layout="${message}" archiveAboveSize ="500000" maxArchiveFiles="20" />
<target name="console" xsi:type="Console" layout="${longdate}|${level:uppercase=true}|${logger}|${message}" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="logfile">
Expand All @@ -19,5 +20,6 @@
</logger>
<logger name="HEALTH" minlevel="Trace" writeTo="clientupdates" />
<logger name="TIMELINE" minlevel="Trace" writeTo="clientupdates" />
<logger name="*" minlevel="Trace" writeTo="console" />
</rules>
</nlog>
</nlog>

0 comments on commit 338d69c

Please sign in to comment.