Secondo HAR: campioni, lettori e richieste della pagina di Instagram

Il HAR del 12 novembre (senza filtro) letto con la sonda sulla macchina di
Alberto, fuori dal repository: 45 forme di richieste, 142 campioni ripuliti e
verificati. Da qui otto campioni nuovi (scheda e post del profilo, schede Reel e
Con tag, raccolte, storie, vassoio delle storie, serie con un video), accorciati
sulla copia ripulita per non aprire mai i grezzi.

Lettori: postCount = media_count e la chiave nuova highlight.cover. Le schede
Reel e Con tag restano anteprime, non contenuti; il blocco della pagina
iniziale da' nome e foto dell'account collegato (H10).

Sonda: i numeri con esponente restano numeri; la verifica non cerca dentro i
valori ammessi di proposito ma sempre nelle chiavi di dati, cerca la chiave del
frammento con lo stesso confronto del testo, e non conta le parole degli
indirizzi finti.

docs/sonda/richieste-instagram.md: quale operazione da' che cosa, le scritture
che Febe non deve mai mandare, le vie per doc_id e i campi di sessione nei
limiti di 6.1, cio' che manca (seguiti, seconda pagina dei post: parte A
quater delle prove dal vivo).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-12 18:29:35 +01:00
1 parent 2ffb766a95
commit dc60e282c5
23 files changed
+5986 -28

No files matched your search

@@ -211,6 +211,74 @@ public sealed class SanitizerTests
Assert.IsFalse(SampleSanitizer.LooksLikeSecretKey("username"));
}
[TestMethod]
public void WordsOfSomeoneElsesTextInsideKeptValuesAreNotLeaksButTheTextStillIs()
{
// From the HAR of 12 November 2026: the Italian word «altro» and a short word inside a media type or a date
// occur in other people's text; the cleaned samples write «altro.esempio», «.avif», «text/javascript» and keep
// dates on purpose. Those are not leaks. A name put back by hand still is, and the check says under which key.
using var temp = new TempFolder("ripulitura");
var raw = Directory.CreateDirectory(temp.Combine("grezzi")).FullName;
File.WriteAllText(Path.Combine(raw, "000001.json"), """
{
"descrittore": { "indirizzo": "https://www.instagram.com/graphql/query", "host": "sito", "stato": 200, "tipo": "text/javascript" },
"corpo": {
"didascalia": "Altro script di Lucia, 17914",
"link": "https://esterno.example/pagina",
"foto": "https://scontent.cdninstagram.com/v/t51/123_456_n.avif?firma=x",
"taken_at": 1791791400
}
}
""");
var clean = temp.Combine("ripuliti");
new SampleSanitizer(key: new byte[32]).SanitizeFolder(raw, clean);
var verify = SampleVerifier.Verify(raw, clean);
Assert.IsTrue(verify.Passed, string.Join("; ", verify.Leaks.Select(l => $"{l.CleanFile} {l.Length} {l.Kind} {l.Key}")));
var path = Path.Combine(clean, "000001.json");
var node = JsonNode.Parse(File.ReadAllText(path))!;
node["corpo"]!["link"] = "https://altro.esempio/lucia";
File.WriteAllText(path, node.ToJsonString());
var leak = SampleVerifier.Verify(raw, clean).Leaks.Single();
Assert.AreEqual(new SampleLeak("000001.json", 5, "lettere", "link"), leak);
}
[TestMethod]
public void ARawDataKeyLeftInTheCleanCopyFailsWhateverItsParentKeyAllows()
{
// A data key (an identifier or a name used as a key) is always faked: the rule of its parent key («*_at» keeps
// dates, «type» keeps codes) must not make the check skip it when a raw one is left behind.
using var temp = new TempFolder("ripulitura");
var raw = Directory.CreateDirectory(temp.Combine("grezzi")).FullName;
File.WriteAllText(Path.Combine(raw, "000001.json"), """
{
"descrittore": { "indirizzo": "https://www.instagram.com/graphql/query", "host": "sito", "stato": 200, "tipo": "text/javascript" },
"corpo": { "updated_at": { "17841400123": 1 }, "type": { "lucia.rossi": true } }
}
""");
var clean = Directory.CreateDirectory(temp.Combine("ripuliti")).FullName;
File.Copy(Path.Combine(raw, "000001.json"), Path.Combine(clean, "000001.json"));
var leaks = SampleVerifier.Verify(raw, clean).Leaks;
Assert.IsTrue(leaks.Any(l => l.Kind == "cifre" && l.Key == "(chiave di dati)"), string.Join("; ", leaks));
Assert.IsTrue(leaks.Any(l => l.Kind == "lettere" && l.Key == "(chiave di dati)"), string.Join("; ", leaks));
}
[TestMethod]
public void LongNumbersWithAnExponentOrAFractionStayNumbers()
{
// Instagram writes some large numbers with an exponent: only the digits are faked, the «e» and the sign stay.
var sanitizer = new SampleSanitizer(key: new byte[32]);
var node = sanitizer.Sanitize(JsonNode.Parse("""{"a":1.7976931348e+21,"b":-12345.678,"c":98765432109876}"""))!;
foreach (var key in new[] { "a", "b", "c" })
{
Assert.AreEqual(JsonValueKind.Number, node[key]!.GetValueKind(), key);
}
StringAssert.Contains(node["a"]!.ToJsonString(), "e+");
StringAssert.StartsWith(node["b"]!.ToJsonString(), "-");
Assert.AreNotEqual("98765432109876", node["c"]!.ToJsonString());
}
[TestMethod]
public void TheProbeReadsOnlyThroughAReadOnlyScript() =>
Febe.Browser.Cdp.ReadOnlyScriptGuard.EnsureReadOnly(ProbeRecorder.InteractionScript);