PDA

View Full Version : ISP PAP modem fix



catdog
29-09-2006, 11:22 AM
I finally got around to making a fix so tivo can connect to ISPs who don't support plain text authentication, and instead jump straight to a PPP session to authenticate using PAP (which seems to be a large number of the ISPs in NZ).

Previously trying to connect would give a result in the tclient log like:

Sep 29 01:18:58 (none) comm[148]: Trying to connect
Sep 29 01:19:12 (none) comm[148]: ATDTxxxxxxxx
Sep 29 01:19:12 (none) comm[148]: CONNECT 19200/
Sep 29 01:19:12 (none) comm[148]: Got a connection.
Sep 29 01:19:12 (none) comm[148]: Trying to login
Sep 29 01:19:24 (none) comm[148]: ModemImpl: EXP_TIMEOUT

What this means is that tivo is waiting for the ISP to say in plain text "Login:". Because the ISP has already started PPP, the tivo never sees this string (instead it sees something like "~ÿ}#À!}!} } }7}"}&} } } } }%}&}83jO}'}"}(}"}-}#}&¦•~") and times out.

This mod means that Tivo never tries to authenticate using plaintext, and instead immediately starts PPP once the modem connects. PAP authentication is done and the tclient log now looks like:

Sep 29 01:26:28 (none) comm[150]: Trying to connect
Sep 29 01:26:41 (none) comm[150]: ATDTxxxxxxxx
Sep 29 01:26:41 (none) comm[150]: CONNECT 19200/ARQ
Sep 29 01:26:41 (none) comm[150]: Got a connection.
Sep 29 01:26:41 (none) comm[150]: Trying to login
Sep 29 01:26:41 (none) comm[150]: Login is complete.
Sep 29 01:26:41 (none) comm[150]: Modem dialcode is 1
Sep 29 01:26:41 (none) comm[150]: CallStatusReporter: Phase: Calling, Status In Progress
Sep 29 01:26:41 (none) comm[150]: CallStatusReporter: sending message "CL|31"
Sep 29 01:26:41 (none) comm[150]: CallStatusReporter: Phase: Start_PPP, Status In Progress
Sep 29 01:26:41 (none) comm[150]: CallStatusReporter: sending message "ST|33"
Sep 29 01:26:41 (none) comm[150]: Going to start pppd.
Sep 29 01:26:41 (none) comm[150]: Pppd:Start: enter
Sep 29 01:26:41 (none) comm[150]: Pppd::Start: fork()ed (pid = 178)
Sep 29 01:26:41 (none) comm[150]: Pppd::Start: storing child pid as 178
Sep 29 01:26:41 (none) comm[150]: Pppd::Start: waiting for PPP - 1
Sep 29 01:26:41 (none) comm[178]: Pppd::Start: fork()ed (pid = 0)
Sep 29 01:26:41 (none) comm[178]: Pppd::Start: spawning pppd on /dev/ttyDSS at 19200 baud
Sep 29 01:26:44 (none) comm[150]: Pppd::Start: waiting for PPP - 2
Sep 29 01:26:44 (none) comm[150]: Pppd::Start: exit (succeeded)
Sep 29 01:26:44 (none) comm[150]: ModemImpl::enableLineStatusInterrupt: modem of type 6, lineStatusInterrupt DISABLED
Sep 29 01:26:44 (none) comm[150]: CallStatusReporter: Phase: Start_Auth, Status In Progress
Sep 29 01:26:44 (none) comm[150]: CallStatusReporter: sending message "ST|33"
Sep 29 01:26:44 (none) comm[150]: CommUtil: connection to host 127.0.0.1, port 8000, err 0x0

Hence it connects successfully and downloads :)

How apply the patch:
At your own risk - if you screw up the file chances are that your tivo will not boot properly and require reimaging the drive!

UPDATE: The hack can be performed without having to copy the file to a PC. Instructions are further down this page Click Here! (http://forums.oztivo.net/showpost.php?p=10428&postcount=9)

FTP into tivo and copy the file /tvbin/tivoapp to your PC. Open the file in a hex editor and change:

Address From To
0x5132A7 03 3F 20 01 DA 3F 00 3F 20 01 DA 3F
0x5133AF 00 80 01 00 34 7C 01 80 01 00 34 7C

save the file as tivoapp.isp Note if the values shown here do not match then it is possible you have a different version of the file to mine - DO NOT CONTINUE!

Telnet into tivo and run the command (make the filesystem read/write)
rw FTP your tivoapp.isp file to /tvbin/tivoapp.isp
In the telnet session type:


cd /tvbin
mv tivoapp tivoapp.bak
mv tivoapp.isp tivoapp
ro
reboot

You can now connect to your ISP assuming you have already setup the modem (especially the files /etc/ppp-options and /etc/pap-secrets) as described in the oztivo wiki (http://minnie.tuhs.org/twiki/bin/view/Network/NetworkingWithBuiltinModem)

Comments/suggestions welcome :)

petestrash
01-10-2006, 01:49 AM
Thanks for your work on this, I'm sure it will be handy for many people who still use dialup.

I have corrected the wiki link in your post as the tag and name were reversed, so the link did not work.

I also added a link back here from the wiki.

Peter.

catdog
02-10-2006, 07:42 AM
Thanks for fixing up the link and linking back petestrash.

I'm not sure if there will be much demand for this fix, but it might be worth making a script to run on the tivo to automatically apply the patch?

Skolink
07-11-2006, 06:52 PM
Hi, thanks for working out how to do this! Now I can use (Dad's) very cheap dialup (E3.net.nz) instead of expensive Paradise dialup. I have a few tips for people.

If you are using dialup you probably wont have a network card and therefor no FTP. You will need to enter the following commands in Tera Term via a serial link instead. commands are in bold. lower case is important.

rw
cd /tvbin
cp tivoapp tivoapp.bak
stty speed 57600 then change the speed in TeraTerm; 'Setup' menu, 'Serial port...', 'Baud rate' to 57600. Otherwise it will take forever to transfer the file at 9600. You could try 115200 instead but it will probably fail during file transfer.
sz tivoapp then in Teraterm go to 'File' menu, 'Transfer', 'ZMODEM', 'Receive...'. The file will by default be copied to your TeraTerm folder.
Edit it with a hex editor, as described by catdog, then copy it back:
rz In TeraTerm 'File' menu, Transfer, ZMODEM, Send... and browse to the file you edited called tivoapp.isp. After 10min or so the file will hopefully have got to 100% and finished.
rm tivoapp
mv tivoapp.isp tivoapp
chmod 755 tivoapp otherwise gets stuck at bootup screen.
Now edit ppp-options chap-secrets pap-secrets tclient.conf with the ISP phone number, user name and password, as described here http://minnie.tuhs.org/twiki/bin/view/Network/NetworkingWithBuiltinModem.
ro
reboot

I guess I won't need the Terbonet cards I'll be building in two weeks...just kidding. ;)

I'm running 3.0 v1.4 but will be upgrading to NZv1.6 soon to fix having to reboot to index guide data, and seasons-passes and browse-by-title not working.

mpnash
29-03-2007, 11:01 PM
Will the mod'ed tivoapp also work for ISPs that just use plain text [login] authentication?

I assume that we need to FTP tivoapp in binary mode (right?).


Also, it would be good to list the ISPs that do/do not need the mod'ed tivoapp.

A start (prefixed by country):

* tivoapp mod not needed:
NZ-PlaNet
NZ-xtra (needs confirming?)
NZ-paradise.net (needs confirming?)

* tivoapp mod needed:
?

mpnash
01-04-2007, 06:49 PM
Just found some related info at this post:
http://forums.oztivo.net/showthread.php?p=10110
which suggests that the mod works for many NZ ISPs.

catdog
02-04-2007, 06:01 AM
Will the mod'ed tivoapp also work for ISPs that just use plain text [login] authentication?
This mod bypasses the plain text login procedure - if your ISP only needs a plain text login then there is no need to implement this mod as the standard tivo files can handle that ok.

On saying this, an ISP which does plain text (eg xtra) will almost certainly also support PAP if the tivo initiates it, so the mod should not break anything.



I assume that we need to FTP tivoapp in binary mode (right?).

Yes, it is a binary file. Also make sure the new file on the tivo is executable as Skolink pointed out (chmod 755 tivoapp) - the FTP program may do this for you automatically.


Also, it would be good to list the ISPs that do/do not need the mod'ed tivoapp.

A start (prefixed by country):

* tivoapp mod not needed:
NZ-PlaNet
NZ-xtra (needs confirming?)
NZ-paradise.net (needs confirming?)

* tivoapp mod needed:
?
The trouble is that ISPs tend to change things with out telling anyone (and windows machines dont need to be reconfigured after each change so most people dont notice).


Just found some related info at this post:
http://forums.oztivo.net/showpost.ph...0&postcount=14
which suggests that the mod works for many NZ ISPs.

Yep - works on every NZ isp I have tested: slingshot, e3, xnet, xtra.

mpnash
07-04-2007, 06:58 AM
For info, it turns out that NZ Xtra *requires* catdog's tivoapp fix (thanks mate!). I also tried maxnet, which did not require the tivoapp fix.

catdog
17-04-2007, 05:30 PM
To make things easier (and quicker over a serial connection) the hack can be done without having to copy the file to PC.
Use at your own risk.
The commands to enter are in bold. Make sure the filesize is reported as 6575372 after entering the first command before continuing with the remaining commands.



[TiVo [p0] ~]# ls -al /tvbin/tivoapp
-rwxrwxr-x 1 0 0 6575372 May 30 2002 /tvbin/tivoapp
[TiVo [p0] ~]# rw
File system is now READ/WRITE.
[TiVo [p0] ~]# cp /tvbin/tivoapp /tvbin/tivoapp.isp
[TiVo [p0] ~]# echo -ne "\x0" | dd conv=notrunc of=/tvbin/tivoapp.isp bs=1 seek=5321383
1+0 records in
1+0 records out
[TiVo [p0] ~]# echo -ne "\x1" | dd conv=notrunc of=/tvbin/tivoapp.isp bs=1 seek=5321647
1+0 records in
1+0 records out
[TiVo [p0] ~]# mv /tvbin/tivoapp /tvbin/tivoapp.bak
[TiVo [p0] ~]# mv /tvbin/tivoapp.isp /tvbin/tivoapp
[TiVo [p0] ~]# chmod +x /tvbin/tivoapp
[TiVo [p0] ~]# ro
[TiVo [p0] ~]# reboot


If you experience problems, make sure your ISP details are correctly set in the following files (the installer cd should do this for you if the modem option was selected):
/etc/tclient.conf - telephone number
/etc/ppp-options - username
/etc/pap-secrets - password
Details can be found in the oztivo wiki (http://minnie.tuhs.org/twiki/bin/view/Network/NetworkingWithBuiltinModem)

NoSignal
22-08-2007, 08:07 AM
Hi Catdog. Great job on making it easier to do.
Could you just confirm the image version you are doing this to - I suspect it will be included in the next image, and may have already been included in the ozTivo image.

NoSignal
22-08-2007, 08:17 AM
PAP authentication has a simple description in http://www.nztivo.net/index.php/Modem#PAP_authehtication but it does not seem to need hex editing. I don't know why - maybe because it is suggested for a different image.

catdog
22-08-2007, 06:20 PM
Hi Catdog. Great job on making it easier to do.
Could you just confirm the image version you are doing this to - I suspect it will be included in the next image, and may have already been included in the ozTivo image.This hack is applicable to US 3.0 images, which includes all current nztivo/oztivo Philips and Sony images. It cannot be directly applied to the UK 2.5.5 image as the offsets would be different for that binary.

It is NOT already applied in the current (1.6.2) ozTivo image, and is unlikely to be in the future. If needed, it must be applied using the instructions above.


PAP authentication has a simple description in http://www.nztivo.net/index.php/Modem#PAP_authehtication but it does not seem to need hex editing. I don't know why - maybe because it is suggested for a different image.
This thread is to make the tivo use ONLY pap authentication when connecting to the ISP.

If you setup the modem with the installer, it automatically adds your ISP username to /etc/ppp-options and your ISP password to /etc/pap-secrets to allow pap authentication. In this case, the tivo must first authenticate in plain text, and then authenticate a second time using pap. Basically it sends your username and password twice! If your ISP supports this (or just plain text login) then fine, you do not need this hack. If your ISP ONLY supports pap and does not send a plain text login prompt then this hack is required.

P.S. The nztivo page you linked is missing details about adding username to /etc/ppp-options, although the installer should do it for you so it is not really a huge issue.