Put signposts back into the trap into the fake files
.env, JSON, YAML, SQL and Git config carry URLs marked with the serving catch, so a later request shows where the address came from. MCP exposes the marker. Switch: Flypaper__Drip__Signposts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c11bf211e
commit
302b40c172
14 files changed
+199
-27
No files matched your search
@@ -0,0 +1,28 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Flypaper.Core.Abstractions;
|
||||
|
||||
namespace Flypaper.Core.Strategies;
|
||||
|
||||
public sealed partial record SignpostLinks(string BaseUrl, string Marker)
|
||||
{
|
||||
public const int MarkerLength = 12;
|
||||
|
||||
public string Backup => $"{BaseUrl}/backup/db-{Marker}.sql";
|
||||
|
||||
public string Admin => $"{BaseUrl}/admin-{Marker}/";
|
||||
|
||||
public string Settings => $"{BaseUrl}/storage/settings-{Marker}.json";
|
||||
|
||||
public string Repository => $"{BaseUrl}/git-{Marker}/portal.git";
|
||||
|
||||
public static string MarkerOf(Guid sessionId) => sessionId.ToString("N")[..MarkerLength];
|
||||
|
||||
public static SignpostLinks For(ITrapChannel channel)
|
||||
{
|
||||
var baseUrl = channel.Host is { } host && HostPattern().IsMatch(host) ? $"http://{host}" : "";
|
||||
return new SignpostLinks(baseUrl, MarkerOf(channel.Session.Id));
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"^[A-Za-z0-9.-]{1,253}\z")]
|
||||
private static partial Regex HostPattern();
|
||||
}
|
||||
Reference in new issue
Block a user