Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GWTMap not compatible with GWT files as HTML #3

Open
CFPrulez opened this issue Apr 21, 2022 · 0 comments
Open

GWTMap not compatible with GWT files as HTML #3

CFPrulez opened this issue Apr 21, 2022 · 0 comments

Comments

@CFPrulez
Copy link

CFPrulez commented Apr 21, 2022

I came across multiple GWT applications that cannot be processed and analyzed by GWTMap. What all these GWT apps have in common is that they deliver their code inside html files.

  1. Initial URL is something like https://test.customer.com/apps/path/secure/com.customer.myApp.gwt.myGwtAppDesktop/com.customer.myApp.gwt.myGwtAppDesktop.nocache.js.

This URL is provided to GWTMap.
The server response looks like the following:

(...)
function com_customer_myapp_gwt_myGwtAppDesktop(){var U='',Cb='" for "gwt:onLoadErrorFn"',Ab='" for "gwt:onPropertyErrorFn"',nb='"><\/script>',cb='#',Kb='&',xc='.cache.html',eb='/',qb='//',ac='<snip>',bc='<snip>',cc='<snip>',ec='<snip>',gc='<snip>',hc='<snip>',ic='<snip>',jc='<snip>',kc='<snip>',lc='<snip>',mc='<snip>',nc='<snip>',oc='<snip>',pc='9A44xxxxxxxxxxxxxxxxxxxxxxxxAB34',wc=':',ub='::',zc='<script defer="defer">com_customer_myapp_gwt_myGwtAppDesktop.onInjectionDone(\'com.customer.myApp.gwt.myGwtAppDesktop\')<\/script>',mb='<script id="',xb='=',db='?',qc='<snip>',rc='<snip>',sc='<snip>',zb='Bad handler "',tc='<snip>',uc='<snip>',yc='DOMContentLoaded',vc='<snip>',ob='SCRIPT',Nb='Unexpected exception in locale detection, using default: ',Mb='_',Lb='__gwt_Locale',lb='__gwt_marker_com.customer.myApp.gwt.myGwtAppDesktop',pb='base',hb='baseUrl',Y='begin',X='bootstrap',gb='clear.cache.gif',V='com.customer.myApp.gwt.myGwtAppDesktop',jb='com.customer.myApp.gwt.myGwtAppDesktop.nocache.js',tb='com.customer.myApp.gwt.myGwtAppDesktop::',wb='content',_b='de',fc='de_CH',Ib='default',bb='end',dc='fr',Vb='gecko',Wb='gecko1_8',Z='gwt.codesvr=',$='gwt.hosted=',_='gwt.hybrid',Bb='gwt:onLoadErrorFn',yb='gwt:onPropertyErrorFn',vb='gwt:property',Zb='hosted.html?com_customer_myapp_gwt_myGwtAppDesktop',Sb='ie10',Ub='ie8',Tb='ie9',Db='iframe',fb='img',Eb="javascript:''",Yb='loadExternalRefs',Hb='locale',Jb='locale=',rb='meta',Gb='moduleRequested',ab='moduleStartup',Rb='msie',sb='name',Fb='position:absolute;width:0;height:0;border:none',Qb='safari',ib='script',$b='selectingPermutation',W='startup',kb='undefined',Xb='unknown',Ob='user.agent',Pb='webkit';
(...)

However, GWTMap can't process this first response as extract_permutations() returns None (https://github.com/FSecureLABS/GWTMap/blob/main/gwtmap.py#L304).

Even if the permutation is detected correctly, the futher processing will fail as GWTMap does not expect HTML files:

.\gwtmap.py: error: target resource seems invalid...
Target resource must be:
 1) Obfuscated {name}.nocache.js GWT bootstrap file
 2) Obfuscated {hex}.cache.js GWT permutation file
 3) Obfuscated {int}.cache.js GWT deferred fragment file

In the browser, the file 9A44xxxxxxxxxxxxxxxxxxxxxxxxAB34.cache.html is now being requested (URL: https://test.customer.com/apps/path/secure/com.customer.myApp.gwt.myGwtAppDesktop/9A44xxxxxxxxxxxxxxxxxxxxxxxxAB34.cache.html) with the following content:

<html><head><meta charset="UTF-8" /><script>var $gwt_version = "2.6.1";var $wnd = parent;var $doc = $wnd.document;var $moduleName, $moduleBase;var $strongName = '9A44xxxxxxxxxxxxxxxxxxxxxxxxAB34';var $stats = $wnd.__gwtStatsEvent ? function(a) {return $wnd.__gwtStatsEvent(a);} : null,$sessionId = $wnd.__gwtStatsSessionId ? $wnd.__gwtStatsSessionId : null;$stats && $stats({moduleName:'com.customer.myApp.gwt.myGwtAppDesktop',sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date()).getTime(),type:'moduleEvalStart'});</script></head><body><script><!--
function db(){}
function mb(){}
function Yb(){}
function Tk(){}
function Tq(){}
function Pq(){}
(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant