Skip to content

Commit d62ecd7

Browse files
committed
fixes #200
1 parent 2ccf165 commit d62ecd7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

cSploit/src/org/csploit/android/plugins/mitm/hijacker/HijackerWebView.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.content.SharedPreferences;
2222
import android.os.Bundle;
2323
import android.support.v7.app.AppCompatActivity;
24+
import android.util.Patterns;
2425
import android.view.Menu;
2526
import android.view.MenuInflater;
2627
import android.view.MenuItem;
@@ -113,8 +114,14 @@ public void onProgressChanged(WebView view, int progress) {
113114
&& session.mUserAgent.isEmpty() == false)
114115
mSettings.setUserAgentString(session.mUserAgent);
115116

116-
mWebView.loadUrl((session.mHTTPS ? "https" : "http") + "://www."
117-
+ domain);
117+
String url = (session.mHTTPS ? "https" : "http") + "://";
118+
119+
if(domain != null && !Patterns.IP_ADDRESS.matcher(domain).matches())
120+
url += "www.";
121+
122+
url += domain;
123+
124+
mWebView.loadUrl(url);
118125
}
119126
}
120127

0 commit comments

Comments
 (0)