Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am pwntester on github.
  • I am pwntester (https://keybase.io/pwntester) on keybase.
  • I have a public key whose fingerprint is 4777 762E 3F49 932D 4CAD 5BFE CB38 D5E4 FEA7 40AB

To claim this, I am signing this object:

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Context fourgoatsAppContext = null;
try {
fourgoatsAppContext = createPackageContext("org.owasp.goatdroid.fourgoats", Context.CONTEXT_IGNORE_SECURITY);
} catch (NameNotFoundException e) {
}
@pwntester
pwntester / ValidateCredsAsyncTask.java
Created November 5, 2012 10:59
ValidateCredsAsyncTask
private class ValidateCredsAsyncTask extends
AsyncTask<Void, Void, HashMap<String, String>> {
Login mActivity;
public ValidateCredsAsyncTask(Login activity) {
mActivity = activity;
}
@Override
@pwntester
pwntester / validateCredentials.java
Created November 5, 2012 11:00
validateCredentials
public HashMap<String, String> validateCredentials(String userName,
String password) throws Exception {
RestClient client = new RestClient("https://" + destinationInfo
+ "/fourgoats/api/v1/login/authenticate");
client.AddParam("userName", userName);
client.AddParam("password", password);
client.Execute(RequestMethod.POST, context);
return LoginResponse.parseLoginResponse(client.getResponse());
@pwntester
pwntester / TrustManager.java
Created November 5, 2012 11:01
TrustManager
public CustomSSLSocketFactory(KeyStore truststore)
throws NoSuchAlgorithmException, KeyManagementException,
KeyStoreException, UnrecoverableKeyException {
super(truststore);
TrustManager tm = new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
@pwntester
pwntester / executeRequest.java
Created November 5, 2012 11:01
executeRequest
private void executeRequest(HttpUriRequest request, String url,
Context context) {
HttpClient client = CustomSSLSocketFactory.getNewHttpClient();
HashMap<String, String> proxyInfo = Utils.getProxyMap(context);
String proxyHost = proxyInfo.get("proxyHost");
String proxyPort = proxyInfo.get("proxyPort");
if (!(proxyHost.equals("") || proxyPort.equals(""))) {
HttpHost proxy = new HttpHost(proxyHost,
@pwntester
pwntester / getNewHttpClient.java
Created November 5, 2012 11:09
getNewHttpClient
public static HttpClient getNewHttpClient() {
try {
KeyStore trustStore = KeyStore.getInstance(KeyStore
.getDefaultType());
trustStore.load(null, null);
SSLSocketFactory sf = new CustomSSLSocketFactory(trustStore);
sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
HttpParams params = new BasicHttpParams();
@pwntester
pwntester / 4g.xml
Created November 17, 2012 14:38
4g1
<activity
android:name=".activities.ViewCheckin"
android:exported="true"
android:label="@string/view_checkin" >
</activity>
<activity
android:name=".activities.ViewProfile"
android:exported="true"
android:label="@string/profile" >
@pwntester
pwntester / g.xml
Created November 17, 2012 14:44
4g2
<service android:name=".services.LocationService" >
<intent-filter>
<action android:name="org.owasp.goatdroid.fourgoats.services.LocationService" />
</intent-filter>
</service>
<receiver
android:name=".broadcastreceivers.SendSMSNowReceiver"
android:label="Send SMS" >
<intent-filter>
Intent tokenIntent = new Intent();
tokenIntent.setComponent(new ComponentName("org.owasp.goatdroid.fourgoats","org.owasp.goatdroid.fourgoats.activities.SocialAPIAuthentication"));
startActivityForResult(tokenIntent, STATIC_INTEGER_VALUE);