BOI Sentinel: Detecting Banking Anomalies and Securing Mobile APKs at Scale
How we built an award-winning fraud detection engine and AST vulnerability scanner for Bank of India, earning the IIT Hyderabad Valor Award.
Financial applications are prime targets for automated reverse engineering, memory tampering, and credential theft. When we participated in the national cybersecurity hackathons organized with banking infrastructure stakeholders—eventually winning multiple competitions and the Valor Award at IIT Hyderabad—our focus was dual-pronged:
- Client-Side Integrity: Scanning compiled Android banking application packages (APKs) for hidden attack surfaces, leaked secrets, and insecure IPC endpoints using Abstract Syntax Tree (AST) analysis.
- Server-Side Anomaly Detection: Identifying fraudulent transaction graphs in real time without creating artificial checkout latency.
Here is how we designed and engineered BOI Sentinel.
The Threat Landscape: Why Runtime Checks Fail
Most mobile banking apps rely on basic root detection and signature verification. Attackers bypass these defenses in minutes using dynamic instrumentation tools like Frida and Xposed frameworks. If an APK exposes exported Android activities, unencrypted Shared Preferences, or hardcoded API keys in decompiled Smali bytecode, the client becomes an open gateway to core banking APIs.
BOI Sentinel inspects both the static bytecode structure before deployment and the real-time transaction velocity at runtime.
[ Developer APK Build ]
│
▼
[ Sentinel AST Engine ] ──► Extracts Control Flow & Smali OpCodes
│
├── Check 1: Insecure Cryptographic Providers
├── Check 2: Exported Content Providers / Services
└── Check 3: Plaintext Network Cleartext Configs
│
▼
[ Hardened Release APK ] ──► Connects to Core Banking Gateway
│
▼
[ Real-Time Sentinel Graph Engine ]
│
├── Latency: < 8ms
├── Anomaly Scoring
└── Automated Circuit Breaker1. Static AST Bytecode Vulnerability Scanning
Instead of running slow regex pattern matches across raw source files, BOI Sentinel deconstructs the APK into an Abstract Syntax Tree. We parse Dalvik bytecode instructions to inspect how cryptographic ciphers, key managers, and intent filters are configured.
// AST Static Analyzer Rule Example: Insecure Cipher Detection
export interface ASTNode {
type: string;
className: string;
methodName: string;
arguments: string[];
lineNumber: number;
}
export function auditCryptoImplementation(nodes: ASTNode[]): SecurityIssue[] {
const issues: SecurityIssue[] = [];
for (const node of nodes) {
if (node.methodName === 'Cipher.getInstance') {
const algorithm = node.arguments[0];
// Check for ECB mode or weak DES/AES defaults
if (algorithm.includes('ECB') || algorithm === 'AES') {
issues.push({
severity: 'CRITICAL',
title: 'Insecure Cipher Mode Detected',
file: node.className,
line: node.lineNumber,
remediation: 'Always use AES/GCM/NoPadding with a unique 96-bit initialization vector.'
});
}
}
}
return issues;
}By inspecting invocation trees rather than strings, BOI Sentinel eliminates 95% of the false positives common in off-the-shelf static application security testing (SAST) tools.
2. Real-Time Transaction Anomaly Detection
Detecting banking fraud requires evaluating transactions in context. A single ₹50,000 transfer is completely normal for a business owner, but suspicious if preceded by three rapid failed OTP attempts, a SIM swap indicator, and a new device fingerprint.
Our transaction monitoring service evaluates every transaction through a streaming scoring pipeline executing in under 8 milliseconds:
// Transaction Risk Engine Evaluation
interface TransactionEvent {
accountId: string;
amount: number;
receiverVPA: string;
deviceFingerprint: string;
ipSubnet: string;
timestamp: number;
}
export async function scoreTransactionRisk(
event: TransactionEvent,
userProfile: HistoricalBehaviorProfile
): Promise<RiskAssessment> {
let riskScore = 0;
// 1. Velocity Analysis: Unusually frequent transfers in short window
const recentVelocity = await redis.zcount(
`tx_velocity:${event.accountId}`,
event.timestamp - 300000,
event.timestamp
);
if (recentVelocity > 5) riskScore += 35;
// 2. Behavioral Distance: Amount deviating from rolling 90-day mean
const zScore = (event.amount - userProfile.avgAmount) / userProfile.stdDev;
if (zScore > 3.0) riskScore += 30;
// 3. Device & Network Novelty
if (!userProfile.knownDevices.includes(event.deviceFingerprint)) {
riskScore += 20;
}
return {
riskScore,
action: riskScore >= 75 ? 'BLOCK_AND_FLAG' : riskScore >= 45 ? 'REQUIRE_BIOMETRIC_REAUTH' : 'APPROVE',
latencyMs: Date.now() - event.timestamp
};
}3. The Research Paper: Graph Anomaly Surveillance
Following our hackathon victories, we authored an academic research paper documenting this methodology: “AST-Guided Behavioral Tracing for Real-Time Financial Anomaly Detection.”
The paper demonstrates that constructing transaction graphs where nodes represent accounts and edges represent directional fund velocity reveals synthetic mule account rings days before conventional rule engines flag them.
What We Learned
- Security Must Be Integrated into CI/CD: You cannot wait for an annual penetration test to discover that an Android release leaks unencrypted auth tokens. Security scans must run on every single Git commit.
- Latency Is the Primary Engineering Constraint: A fraud detection system that takes 500ms will be disabled by product managers because checkout drop-off kills conversion. Sub-10ms execution is non-negotiable.
- Cybersecurity Demands Continuous Curiosity: Winning hackathons at IIT Hyderabad reinforced that security is an active engineering discipline. Threat actors adapt constantly; defense systems must be built with equal agility.