Skip to content

Instantly share code, notes, and snippets.

@potetisensei
Last active December 28, 2015 23:49
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 potetisensei/7581389 to your computer and use it in GitHub Desktop.
Save potetisensei/7581389 to your computer and use it in GitHub Desktop.
bin100 source
public void check_password(string password) {
string environmentVariable = MyProject.Application.GetEnvironmentVariable("USERNAME");
string s = "_P4d11n9_" + environmentVariable + "_P4d11n9_";
MD5CryptoServiceProvider cryptoServiceProvider = new MD5CryptoServiceProvider();
byte[] hash1 = cryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(s));
int[] numArray = new int[6] {1310, 1450, 1435, 1316, 1302, 1439};
int index1 = 0;
int num1 = 0;
int num2 = hash1.Length - 1;
int index2 = num1;
while (index2 <= num2 && ((int) hash1[index2] ^ 1337) == numArray[index1]) {
++index1;
index2 += 3;
}
if (index1 == 6) {
if (Operators.CompareString(password, crackme1.My.Resources.Resources.ResourceManager.GetString("password"), false) == 0) {
byte[] hash2 = cryptoServiceProvider.ComputeHash(Encoding.UTF8.GetBytes(environmentVariable + ":" + password + ":" + crackme1.My.Resources.Resources.ResourceManager.GetString("flag")));
StringBuilder stringBuilder = new StringBuilder();
foreach (byte num3 in hash2)
stringBuilder.Append(num3.ToString("x2").ToUpper());
this.Label2.Text = "Hello " + environmentVariable + ", The Flag is: " + stringBuilder.ToString().ToLower();
} else {
this.Label2.Text = "Invalid Password!";
this.checks = this.checks + 1;
Interaction.Beep();
}
} else {
this.Label2.Text = "You are not allowed to use this application!";
this.checks = this.checks + 1;
Interaction.Beep();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment