Hooking Storage Objects

Can we hook Storage APIs?

By
Anonymous 1 Seen 731 times
Tags
storage hooking overriding
Run this test now.

Results


Tested on
Android - 2.2 - Android
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Chrome - 65 - Windows 7
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Chrome Mobile - 41 - Android
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Chromium - 49 - Ubuntu
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Firefox - 51 - Windows 7
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Unknown Browser - Unknown Version - Unknown OS
Storage MethodHookable?
window.localStoragefalse
window.sessionStoragefalse

Tested on
Googlebot - 2.1 - undefined
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
IE - 11 - Windows 7
Storage MethodHookable?
window.localStorageThe Property does not exist
window.sessionStorageThe Property does not exist

Tested on
IE Mobile - 10 - Windows Phone 8
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Mobile Safari - 8 - iOS
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Safari - 11 - Mac OS X
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
undefined - undefined - undefined
Storage MethodHookable?
window.localStoragefalse
window.sessionStoragefalse

Tested on
Chrome Mobile iOS - 58 - iOS
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

Tested on
Opera - 47 - Windows 10
Storage MethodHookable?
window.localStoragetrue
window.sessionStoragetrue

User Script (ENUM_FUNCTION)

					
function test(data){
	// We need to separate properties and access one by one.
try{
    console.log(data);
    var prop = Object.getOwnPropertyDescriptor(window, data);
    if(typeof prop != 'undefined'){
        if(prop.configurable === true){
            addError('window.'+ data, prop.configurable);
        } else {
            addSuccess('window.'+ data, prop.configurable);
        }    
    } else {
        addInfo('window.'+ data,  "The Property does not exist", '');
    }
}

catch(err){
	addInfo('window.'+ data,  'Error Occured. Probably not configurable.');
}

}
	
					
				

Enum Data (ENUM_FUNCTION)

					
var data = ['localStorage', 'sessionStorage'];