diff --git a/README.md b/README.md index 78b7ed6f..18da1414 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,33 @@ # wtv minisrv node.js -The ***wtv minisrv***, or "***hacktv_updsrv***" project is an ambitious node.js project to have a mini WebTV server that supports wtv-encryption for advanced level access. +The ***wtv minisrv***, or "***hacktv_updsrv***" project is a node.js project that provides a mini WebTV Server, with wtv-encryption support for advanced level box access. -This open source server is not yet ready for public use, but is available for anyone wanting to try to help advance it. +This open source server is in alpha status. Use at your own risk. + +### Current status: +- Can encrypt and decrypt SECURE ON and arbitrary encrypted data +- Can handle psuedo encryption (box sends SECURE ON but does not encrypt) +- Can handle client "relogin" and "reconnect" events + +### Current issues: +- Probably can't handle more than one box at a time +- Power cycling box and re-connecting via ConnectSetup may invalidate encryption until server is restarted +- wtv-update:/update does not yet function as intended + +### Feature Todo: +- Test and enable flashrom flashing functionality (at least for LC2 and higher) +- (maybe) Proper wtv-star (generic service outage page) support (maybe useful for allowing a unit to multiple sub-minisrvs). +- (maybe) implement HTTP proxy (needs to be able to defluff most of the web, think retro WAP converter) +- (maybe) enable "internet mode" (let user outside of minisrv) +- (maybe) wtvchat stuff +- (probably not) url tokenizer + +### How To Use: +- Install [node.js](https://nodejs.org/en/download/) +- Download a snapshot (either of master, or of any commit/branch/relase/tag etc) +- Extract zip somewhere and enter that directory with a command prompt +- Run `npm install` +- Check any configuration (services.json) +- Run `node app.js` +- Test with a WebTV Viewer or connect with a real box +- To connect with a real box, you will need to open ports in your firewall and have a way to connect your WebTV (and preferably reroute 10.0.0.1 to the server) diff --git a/hacktv_updsrv/README.md b/hacktv_updsrv/README.md deleted file mode 100644 index 6d21e995..00000000 --- a/hacktv_updsrv/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# wtv minisrv node.js - -The ***wtv minisrv***, or "***hacktv_updsrv***" project is an ambitious node.js project to have a mini WebTV server that supports wtv-encryption for advanced level access. - -This open source server is not yet ready for public use, but is available for anyone wanting to try to help advance it. - -Current status: -- Can encrypt and decrypt SECURE ON and arbitrary encrypted data -- Can handle psuedo encryption (box sends SECURE ON but does not encrypt) -- Can handle client "relogin" and "reconnect" events - -Current issues: -- Probably can't handle more than one box at a time -- Power cycling box and re-connecting via ConnectSetup may invalidate encryption until server is restarted -- wtv-update:/update does not yet function as intended - -Feature Todo: -- Test and enable flashrom flashing functionality (at least for LC2 and higher) -- Proper wtv-star (generic service error page) support. -- (maybe) implement HTTP proxy (needs to be able to defluff most of the web, think retro WAP converter) -- (maybe) enable "internet mode" (let user outside of minisrv) -- (maybe) wtvchat stuff -- (probably not) url tokenizer \ No newline at end of file diff --git a/hacktv_updsrv/ServiceVault/wtv-head-waiter/test.js b/hacktv_updsrv/ServiceVault/wtv-head-waiter/test.js deleted file mode 100644 index 14640344..00000000 --- a/hacktv_updsrv/ServiceVault/wtv-head-waiter/test.js +++ /dev/null @@ -1,2 +0,0 @@ -var wtvtest = new WTVSec(); -wtvtest.Test(); \ No newline at end of file diff --git a/hacktv_updsrv/ServiceVault/wtv-tricks/blastcache.txt b/hacktv_updsrv/ServiceVault/wtv-tricks/blastcache.txt index d25940c4..a26fd7cd 100644 --- a/hacktv_updsrv/ServiceVault/wtv-tricks/blastcache.txt +++ b/hacktv_updsrv/ServiceVault/wtv-tricks/blastcache.txt @@ -7,8 +7,11 @@ Content-type: text/html - + +Successfully expired service URL cache
+Any previously cached pages should be reloaded from the network.

+Go Home \ No newline at end of file diff --git a/hacktv_updsrv/app.js b/hacktv_updsrv/app.js index dce6d78f..f4cfc40c 100644 --- a/hacktv_updsrv/app.js +++ b/hacktv_updsrv/app.js @@ -12,13 +12,10 @@ var WTVSec = require('./wtvsec.js'); var zdebug = false; -var pubip = "192.168.11.8"; var ports = []; var service_vault_dir = __dirname + "/ServiceVault"; -//pubip = getPublicIP(); - function getServiceString(service) { if (service === "all") { var out = ""; @@ -59,22 +56,6 @@ function setSessionData(ssid, key, value) { } -function getPublicIP() { - var options = { - host: 'www.planeptune.org', - path: '/ip.php' - } - var request = https.get(options, function (res) { - var data = ''; - res.on('data', function (chunk) { - data += chunk; - }); - res.on('end', function () { - return data; - }); - }); -} - function getFile(path, deps = false) { var dir = null; if (deps) dir = __dirname + "/ServiceDeps/"; @@ -660,11 +641,16 @@ async function handleSocket(socket) { var z_title = "zefie's wtv minisrv v" + require('./package.json').version; console.log("**** Welcome to " + z_title + " ****"); console.log(" *** Reading service configuration..."); -var services_configured = JSON.parse(fs.readFileSync(__dirname + "/services.json")); +try { + var services_configured = JSON.parse(fs.readFileSync(__dirname + "/services.json")); +} catch (e) { + throw("ERROR: Could not read services.json", e); +} +var service_ip = services_configured.config.service_ip; Object.keys(services_configured.services).forEach(function (k) { services_configured.services[k].name = k; if (!services_configured.services[k].host) { - services_configured.services[k].host = pubip; + services_configured.services[k].host = service_ip; } if (services_configured.services[k].port) { ports.push(services_configured.services[k].port); @@ -700,5 +686,5 @@ bind_ports.forEach(function (v) { }); initstring = initstring.substring(0, initstring.length - 2); -console.log(" * Started server on ports " + initstring + "... Public IP is " + pubip); +console.log(" * Started server on ports " + initstring + "... Service IP is " + service_ip); diff --git a/hacktv_updsrv/hacktv_updsrv.njsproj b/hacktv_updsrv/hacktv_updsrv.njsproj index 4111df51..44cc8b5b 100644 --- a/hacktv_updsrv/hacktv_updsrv.njsproj +++ b/hacktv_updsrv/hacktv_updsrv.njsproj @@ -42,8 +42,7 @@ - - + @@ -58,14 +57,12 @@ - Code - diff --git a/hacktv_updsrv/package.json b/hacktv_updsrv/package.json index bf401f16..621ec144 100644 --- a/hacktv_updsrv/package.json +++ b/hacktv_updsrv/package.json @@ -1,6 +1,6 @@ { "name": "hacktv_updsrv", - "version": "0.5.2", + "version": "0.6.0", "description": "hacktv_updsrv", "main": "app.js", "author": { diff --git a/hacktv_updsrv/services.json b/hacktv_updsrv/services.json index 82d4a766..ca27d2a5 100644 --- a/hacktv_updsrv/services.json +++ b/hacktv_updsrv/services.json @@ -1,4 +1,7 @@ { + "config": { + "service_ip": "192.168.11.8" + }, "services": { "wtv-1800": { diff --git a/hacktv_updsrv/wtvsec.js b/hacktv_updsrv/wtvsec.js index c23b2d8c..485b1b2e 100644 --- a/hacktv_updsrv/wtvsec.js +++ b/hacktv_updsrv/wtvsec.js @@ -4,7 +4,7 @@ var crypto = require('crypto'); class WTVSec { //initial_shared_key = CryptoJS.lib.WordArray.random(8); - initial_shared_key_b64 = "CC5rWmRUE0o="; + initial_shared_key_b64 = "CC5rWmRUE0o="; // You can change this but it doesn't mean much for security. Just make sure its static. 8 bytes base64 encoded. initial_shared_key = null; current_shared_key = null; challenge_key = null;