re-write security system to be more like WNI

- can get telly and reach stage-two
- narrow whitelist of allowed URLS in WTVClientSessionData constructor
- enough to show wtv-1800:/unauthorized with trust priv
- Times out lockeddown users really fast ;)
- untested disk error page
This commit is contained in:
zefie
2021-11-12 15:35:40 -05:00
parent 2f51c3e7b5
commit 3da57455eb
12 changed files with 352 additions and 163 deletions

View File

@@ -0,0 +1,63 @@
var minisrv_service_file = true;
ssid_sessions[socket.ssid].disableLockdown();
data += `<html>
<head>
<display switchtowebmode nooptions nostatus skipback clearback> <title>Please Call</title>
</head>
<body bgcolor="#191919" text="#42CC55" link="36d5ff" fontsize="large" hspace=0 vspace=0>
<table cellspacing=0 cellpadding=0>
<tr><td width=104 height=74 valign=middle align=center bgcolor="3B3A4D">
<img src="wtv-flashrom:/ROMCache/WebTVLogoJewel.gif" width=86 height=64><td width=20 valign=top align=left bgcolor="3B3A4D">
<img src="ROMCache/Spacer.gif"
width=1 height=1>
<td colspan=10 width=436 valign=middle align=left bgcolor="3B3A4D">
<font color="D6DFD0" size="+2">
<blackface>
<shadow>
<img src="ROMCache/Spacer.gif"
width=1 height=4>
<br>
Please Call
</shadow>
</blackface>
</font>
<tr>
<td colspan=12 width=560 height=10 valign=top align=left>
<img src="file://ROM/Cache/Shadow.gif" width=560 height=6>
<tr>
<td width=104 height=10 valign=top align=left>
<td width=20 valign=top align=left>
<td width=67 valign=top align=left>
<td width=20 valign=top align=left>
<td width=67 valign=top align=left>
<td width=20 valign=top align=left>
<td width=67 valign=top align=left>
<td width=20 valign=top align=left>
<td width=67 valign=top align=left>
<td width=20 valign=top align=left>
<td width=68 valign=top align=left>
<td width=20 valign=top align=left>
<tr>
<td width=104 valign=middle align=center>
<td width=20 valign=middle align=center>
<td colspan=9 width=100 height=258 valign=top align=left>
<font size=+1>
Your Internet terminal needs to be repaired
or replaced before you can connect to WebTV.
<!-- Disabled until we can reliably grab the user's box manufacturer
<p>Call Philips customer service at<br>1-888-813-7069 -->
<tr><td colspan=2>
<td colspan=99 abswidth=436 absheight=2 bgcolor=2B2B2B> <img src="wtv-flashrom:/ROMCache/Spacer.gif" width=1 height=1> <tr><td absheight=1>
<tr><td colspan=2>
<td colspan=99 abswidth=436 absheight=2 bgcolor=0D0D0D> <img src="wtv-flashrom:/ROMCache/Spacer.gif" width=1 height=1> <tr><td height=7>
<tr>
<td width=104 valign=middle align=center> <td width=20 valign=middle align=center> <td colspan=9 width=416 valign=top align=left> <table cellspacing=0 cellpadding=0>
<tr>
<td width=306 valign=top align=right><td width=20> <td width=112 valign=top align=right>
<form action="client:poweroff"> <FONT COLOR="#E7CE4A" SIZE=-1><input type="Submit" value="Power Off" BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" usestyle selected></font>
<input type="Hidden" name="version" value=""> </form>
</table>
</BODY>
</html>`;

View File

@@ -53,7 +53,10 @@ Content-type: text/html`;
data = '';
}
else {
if (request_headers.query.guest_login && minisrv_config.config.allow_guests) {
if (ssid_sessions[socket.ssid].lockdown) {
home_url = minisrv_config.config.unauthorized_url;
}
else if (request_headers.query.guest_login && minisrv_config.config.allow_guests) {
var namerand = Math.floor(Math.random() * 100000);
var nickname = (minisrv_config.config.service_name + '_' + namerand)
var human_name = nickname;
@@ -89,42 +92,66 @@ wtv-expire-all: client:closeallpanels
wtv-transition-override: off
wtv-force-lightweight-targets: webtv.net:/
wtv-smartcard-inserted-message: Contacting service
wtv-bypass-proxy: false
wtv-bypass-proxy: false`;
if (!ssid_sessions[socket.ssid].lockdown) {
headers += `
wtv-offline-user-list: ${offline_user_list}
wtv-messenger-authorized: ${messenger_authorized}
wtv-messenger-enable: ${messenger_enabled}
wtv-messenger-enable: ${messenger_enabled}`;
}
headers += `
wtv-noback-all: wtv-
wtv-service: reset
`+ getServiceString('all', { "exceptions": ["wtv-register"] }) + `
`;
if (!ssid_sessions[socket.ssid].lockdown) {
headers += getServiceString('all', { "exceptions": ["wtv-register"] });
} else {
headers += getServiceString('wtv-1800') + "\n";
headers += getServiceString('wtv-head-waiter') + "\n";
headers += getServiceString('wtv-star') + "\n";
}
headers += `
wtv-ticket: ${wtvsec_login.ticket_b64}`;
if (!ssid_sessions[socket.ssid].lockdown) {
headers += `
user-id: ${userid}
wtv-human-name: ${human_name}
${ssid_sessions[socket.ssid].setIRCNick(nickname)}
wtv-domain: wtv.zefie.com
wtv-input-timeout: 14400
wtv-ticket: ${wtvsec_login.ticket_b64}
wtv-domain: ${minisrv_config.config.domain_name}
wtv-messagewatch-checktimeoffset: off
wtv-input-timeout: 14400
wtv-connection-timeout: 90
wtv-fader-timeout: 900
wtv-smartcard-inserted-message: Contacting service
wtv-inactive-timeout: 0
wtv-connection-timeout: 90
wtv-show-time-enabled: true
wtv-fader-timeout: 900
wtv-tourist-enabled: true`
wtv-connection-timeout: 1440
wtv-fader-timeout: 1440
wtv-inactive-timeout: 1440`;
} else {
headers += `
user-id: 0
wtv-human-name: Unauthorized User
wtv-domain: ${minisrv_config.config.domain_name}
wtv-input-timeout: 30
wtv-connection-timeout: 60
wtv-fader-timeout: 60
wtv-inactive-timeout: 60`;
}
headers += "\nwtv-relogin-url: wtv-head-waiter:/relogin?relogin=true";
if (request_headers.query.guest_login) headers += "&guest_login=true";
headers += "\nwtv-reconnect-url: wtv-head-waiter:/login-stage-two?reconnect=true";
if (request_headers.query.guest_login) headers += "&guest_login=true";
headers += "\nwtv-boot-url: wtv-head-waiter:/relogin?relogin=true";
if (request_headers.query.guest_login) headers += "&guest_login=true";
headers += "\nwtv-allow-dsc: true";
headers += "\nwtv-home-url: wtv-home:/home?";
if (ssid_sessions[socket.ssid].get('wtv-need-upgrade') != 'true' && !request_headers.query.reconnect) {
if (!ssid_sessions[socket.ssid].lockdown) headers += "\nwtv-home-url: wtv-home:/home?";
if (ssid_sessions[socket.ssid].get('wtv-need-upgrade') != 'true' && !request_headers.query.reconnect && !ssid_sessions[socket.ssid].lockdown)
headers += "\nwtv-settings-url: wtv-setup:/get";
}
headers += `
wtv-show-time-enabled: true
wtv-allow-dsc: true
wtv-tourist-enabled: true
wtv-log-url: wtv-log:/log
wtv-ssl-log-url: wtv-log:/log
wtv-ssl-timeout: 240