MCPcopy Index your code
hub / github.com/cSploit/android / run

Method run

cSploit/src/org/csploit/android/plugins/mitm/MITM.java:210–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

208 public void onSessionReady(){
209 MITM.this.runOnUiThread(new Runnable(){
210 @Override
211 public void run(){
212 System.getProxy().setFilter(new Proxy.ProxyFilter(){
213 @Override
214 public String onDataReceived(String headers, String data){
215 String resource = System.getServer().getResourceURL();
216
217 // handle img tags
218 data = data.replaceAll
219 (
220 "(?i)<img([^/]+)src=(['\"])[^'\"]+(['\"])",
221 "<img$1src=$2" + resource + "$3"
222 );
223
224 // handle css background declarations
225 data = data.replaceAll
226 (
227 "(?i)background\\s*(:|-)\\s*url\\s*[\\(|:][^\\);]+\\)?.*",
228 "background: url(" + resource + ")"
229 );
230
231 return data;
232 }
233 });
234
235 Toast.makeText(MITM.this, getString(R.string.tap_again), Toast.LENGTH_LONG).show();
236 }
237 });
238 }
239

Callers

nothing calls this directly

Calls 3

getProxyMethod · 0.95
setStoppedStateMethod · 0.95
setFilterMethod · 0.45

Tested by

no test coverage detected