What is this talk about?
● JavaScript
● Brief About Js Engines
● DevTools (V8)
● Extra Security layer implemented inside banking application
● How to break it, fuzz it and bypass something?
● How to debug JavaScript based mobile application?
● How to debug Add-on or web browser extensions?
Don’t worry, this session will have lot of demos!!!
What you can do with JavaScript?
● How Developers see it : Building stuff
● How Attackers see it : Breaking stuff
● Using JS, you can build a complete -
a. web/mobile applications.
b. Real-time networking apps (chats, video streamings).
c. Command line tools.
d. Games.
e. Desktop Application.
f. Windows 95 using electron.
Javascript vs ECMAScript?
Where does JavaScript code run?
● Browser Engines
● JavaScript engines (V8 for Chrome, spidermonkey for firefox etc.)
● Previously, we were able to run javascript inside browsers only.
● Later on, Node was developed (which is nothing but Javascript engine
outside browser).
Debugging
with
Chrome
DevTool
Debugging is the process of finding and fixing errors within a script
Debugger is your friend.
function hello(name) {
let phrase = `Hello, ${name}!`;
Debugger; //Let’s have a cup of Tea.
alert(phrase);
}
What Developer Thinks?
Proper Server
Side Validation
Encrypt the
Encrypted Data
Breaking and Bypassing
What?
How?
1. Understand the application and It’s flow.
2. When you found something, is it on client side?
3. Look for all the files.
4. Want to break encryption? Or bypass something?
5. Find the Logic
We are fully charged now.
DEMO
Lets Debug!
1. Monitor()
2. Debug()
3. Memory analysis
4. Network
5. Snippet
6. Extension based
7. console.save()
8. Save all Javascript file
…….
Fuzzing?
function fuzz(){
var textArea = document.getElementById('payloads');
var lines = textArea.value.split('n');
for (var j = 0; j < lines.length; j++) {
console.log('Payload: ' + lines[j]);
var mykey = "myKey123"
otpEncrypt = CryptoJS.AES.encrypt( lines[j],
mykey, {format: CryptoJSAesJson} );
$.post("otpvalidate.php",{
otp: otpEncrypt.toString()
},
function(res){
var data2 =
CryptoJS.AES.decrypt(JSON.stringify(res), mykey,
{format:
CryptoJSAesJson}).toString(CryptoJS.enc.Utf8);
var data = JSON.parse(data2);
console.log(data);
}
DEMO
Lets Fuzz!
Mobile
Applications
Mobile Application
Cordova and React:
Android Application Remote debugging
Debugging
Web Browser Extensions
chrome://extensions
about:debugging
Reality……….
Obfuscation:
Github: bhattsameer Twitter: sameer_bhatt5

JS debugging - Sameer Bhatt