Skip to content

Instantly share code, notes, and snippets.

@Hiromi-nee
Last active August 29, 2015 14:09
Show Gist options
  • Save Hiromi-nee/58d0e95b0328f0c5385d to your computer and use it in GitHub Desktop.
Save Hiromi-nee/58d0e95b0328f0c5385d to your computer and use it in GitHub Desktop.
[QIWICTF2014 - MISC100] Stolen prototype - Accounts.java Excerpt
private String d;
private String a()
{
StringBuilder stringbuilder;
DefaultHttpClient defaulthttpclient;
UsernamePasswordCredentials usernamepasswordcredentials;
HttpGet httpget;
Character character = Character.valueOf('n'); //note this
String s = d.substring(0, 1); //note this
Log.d(getPackageName(), s);
stringbuilder = new StringBuilder();
defaulthttpclient = new DefaultHttpClient();
String s1 = (new StringBuilder()).append(s).append("vty").toString(); //note this
Log.d(getPackageName(), (new StringBuilder()).append(character).append("s").append(s1).append("f").append(character).append("j").append(s).toString());
usernamepasswordcredentials = new UsernamePasswordCredentials("xxx", (new StringBuilder()).append(character).append("s").append(s1).append("f").append(character).append("j").append(s).toString()); //note this
httpget = new HttpGet((new StringBuilder()).append("https://qiwictf2014.ru:54321/account?key=").append("").append("&account=").append("afgssdfgsdgsfgdfbxcbsdbkjnkwej").toString());
BufferedReader bufferedreader;
httpget.addHeader(BasicScheme.authenticate(usernamepasswordcredentials, "UTF-8", false));
HttpResponse httpresponse = defaulthttpclient.execute(httpget);
if (httpresponse.getStatusLine().getStatusCode() != 200)
{
break MISSING_BLOCK_LABEL_350;
}
...
protected void onCreate(Bundle bundle)
{
super.onCreate(bundle);
StrictMode.setThreadPolicy((new android.os.StrictMode.ThreadPolicy.Builder()).permitAll().build());
Random random = new Random();
String s = (new StringBuilder()).append("ctf201").append("444444".charAt(random.nextInt("444444".length()))).toString(); //note this
d = (new StringBuilder()).append("https://qiwi").append(s).append(".ru:").append("40443").toString(); //note this
setContentView(0x7f030000);
b = (TextView)findViewById(0x7f080003);
c = (Button)findViewById(0x7f080008);
c.setOnClickListener(new a(this));
Log.d(getPackageName(), (new StringBuilder()).append("Init for:https://qiwictf2014.ru:54321").append(a()).toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment