DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2010-03-12 22:23:51

j.smith
Member
Registered: 2010-03-12
Posts: 10

FW 1.08; can't get utelnetd to start up?

I just upgraded to FW 1.08, did a reset to defaults and even reformatted my drives (to use ext3 finally).  I obviously lost any fun_plug modifications I had on my NAS, so after the reformat and setting up the system again, I took my backup of my fun_plug script and uploaded it (via FTP server) back on to the NAS (in Volume_1 directory).  I then took my telnet files (from the howto:telnet wiki entry - the package containing utelnetd and busybox3) and put them back up on the server (in the right path).

After doing a reboot, I'm not able to connect to the NAS via telnet.  I've confirmed that the fun_plug script is at least running, and the file paths should be correct but nothing seems to get telnetd working.  My guess is that libraries changed or something in FW 1.08, and the compiled version of utelnetd and/or busybox3 no longer work properly.

I don't have a linux system (nor one set up to cross compile), so I am wondering if someone could compile a new utelnetd and busybox?  I know I could use fonz's fun_plug, but I don't need all that extra stuff - I purely just use telnet to do some CLI work (changing permissions on files, minor stuff like that).

Thanks!

Offline

 

#2 2010-03-14 01:04:43

En3rGy
Member
Registered: 2010-03-09
Posts: 6

Re: FW 1.08; can't get utelnetd to start up?

j.smith wrote:

I took my backup of my fun_plug script and uploaded it (via FTP server) back on to the NAS (in Volume_1 directory).

j.smith wrote:

I know I could use fonz's fun_plug, but I don't need all that extra stuff

Actually, I didn't get if you want / don't want / try to avoid to use fun_plug.

If you uses fun_plug and copy the file attached to this post to the "Volume_1" share will activate telnet access after a reboot. Just in case it was forbidden before the fw update...

Offline

 

#3 2010-03-14 20:58:03

j.smith
Member
Registered: 2010-03-12
Posts: 10

Re: FW 1.08; can't get utelnetd to start up?

En3rGy wrote:

j.smith wrote:

I took my backup of my fun_plug script and uploaded it (via FTP server) back on to the NAS (in Volume_1 directory).

j.smith wrote:

I know I could use fonz's fun_plug, but I don't need all that extra stuff

Actually, I didn't get if you want / don't want / try to avoid to use fun_plug.

If you uses fun_plug and copy the file attached to this post to the "Volume_1" share will activate telnet access after a reboot. Just in case it was forbidden before the fw update...

I use fun_plug, but not fonz's complete ffp package.  I use fun_plug in that I have a simple fun_plug file placed on my NAS which ONLY loads utelnetd (which uses busybox3 as the shell interpreter).  That's all my fun_plug script does.  I don't want to install fonz's complete ffp package - it's complete overkill for what I need.  Also, I can't extract any telnet daemon from his files because they are compiled against a custom library set which is included with his ffp package... and since I don't want to install all of those as well, it wouldn't work.

Offline

 

#4 2010-03-16 18:07:48

karlrado
Member
Registered: 2009-12-07
Posts: 229

Re: FW 1.08; can't get utelnetd to start up?

I think I am trying to do the same thing - trying to get utelnetd running without the full ffp package.

What I am seeing is that /bin/tar cannot correctly expand the utelnet-kit.tar.gz archive.

If I temporarily use ffp to unzip AND untar the file, I can then reboot with a non-ffp fun_plug file that just starts the telnet service, and it works.

Even if I UNZIP the file with /ffp/bin/unzip to get utelnet-kit.tar, /bin/tar still cannot untar it.  So the problem is with the tar format.

This might be a matter an the old version of tar in the firmware not being compatible with the utelnet-kit.tar.gz file.

This may not be caused by the firmware update.  I am seeing this difficultly on 1.07.

You can easily check if this is also your problem by seeing if the lnx_bin dir got created when your fun_plug tried to install it, assuming that your fun_plug attempted to unzip.

If you somehow unzipped the files yourself and installed them on the 323, make sure that the permissions are correct.  Mine wouldn't start until I did that.

For now, I am copying mine to the ram disk.  I keep the utelnet stuff in its own directory:

Code:

cp /mnt/HD_a2/UTelnet/lnx_bin/utelnetd /sbin/utelnetd
cp /mnt/HD_a2/UTelnet/lnx_bin/busybox3 /bin/busybox3
chown root:root /sbin/utelnetd /bin/busybox3
chmod 0755 /sbin/utelnetd /bin/busybox3
chmod u+s /bin/busybox3

# create the terminal device as usual
/bin/busybox3 mknod /dev/ptyp0 c 2 0
/bin/busybox3 chmod 0666 /dev/ptyp0
/bin/busybox3 mknod /dev/ttyp0 c 3 0
/bin/busybox3 chmod 0666 /dev/ttyp0

# make a shell link on the ramdisk
mkdir /bin/busybox3.dir/
PATH="$PATH:/bin/busybox3.dir"

ln -s /bin/busybox3  /bin/busybox3.dir/sh

# and start the Telnet service from the ramdisk as well
/sbin/utelnetd -l /bin/busybox3.dir/sh -d

If it was really important for me to make a minimal bootstrap package consisting of a fun_plug file and a tar file, I would probably consider using the FW's /bin/tar file to CREATE a new tar file consisting of the busybox and utelnetd binaries and a start-telnet script. If the tar file was created with /bin/tar, then /bin/tar should be able to expand it as well.


DNS-323 FW 1.07 : 2 1TB WD Caviar Green SATA : fun_plug: utelnet + optware (no ffp)

Offline

 

#5 2010-03-18 23:30:37

j.smith
Member
Registered: 2010-03-12
Posts: 10

Re: FW 1.08; can't get utelnetd to start up?

My issue isn't with tar - I used IZArc to extract the files and I uploaded them (yes I know they are binary) to the NAS via FTP.  However, I am going to give your mention of changing owner a whirl.  I never had to worry about that before , however it can't hurt and perhaps it's something in new in the kernel from 1.08.  This just made me wonder as well if perhaps making sure the utelnetd program is not only owned by root, but is setuid (since port 23 is privileged) just to ensure it can run as root... hmmm...

In any case, this is my current fun_plug script:

Code:

#!/bin/sh

cp /mnt/HD_a2/Programs/telnet/utelnetd /sbin/utelnetd
cp /mnt/HD_a2/Programs/telnet/busybox3 /bin/busybox3

/bin/busybox3 mknod /dev/ptyp0 c 2 0
/bin/busybox3 chmod 0666 /dev/ptyp0
/bin/busybox3 mknod /dev/ttyp0 c 3 0
/bin/busybox3 chmod 0666 /dev/ttyp0

if [ ! -d /bin/tsh ]; then
    mkdir /bin/tsh
fi

if [ ! -f /bin/tsh/sh ]; then
    ln -s /bin/busybox3 /bin/tsh/sh
fi

/sbin/utelnetd -l /bin/tsh/sh -d

if [ -f /mnt/HD_a2/Programs/smb.conf ]; then
    cp -f /mnt/HD_a2/Programs/smb.conf /etc/samba/smb.conf && /usr/bin/smb restart
fi

I'll try the ownership and setuid ideas and see if it helps any.

Offline

 

#6 2010-03-21 16:38:54

j.smith
Member
Registered: 2010-03-12
Posts: 10

Re: FW 1.08; can't get utelnetd to start up?

Ok, I tried doing this right after I copy the files in to the root fs:

Code:

chown root:root /sbin/utelnetd /bin/busybox3
chmod 0755 /sbin/utelnetd /bin/busybox3
chmod u+s /bin/busybox3

I even tried with changing both utelnetd and busybox3 suid, but neither of those helped get utelnetd to run.  I also piped "ls -l" output to make sure that the permission changes were taking effect (they were), and I also tried piping stdout and stderr from utelnetd starting up to see if I could catch any errors normally thrown to the console but I just got a blank file.

I also tried copying /var/log over to the hdd so I could check out the files via FTP to see if there was anything logged in there, but that turned up nothing important.  I don't think klogd is installed/running so there's no way I could grab any kernel logs.  It also seems that "ldd" doesn't exist, so I can't tell if there are actually any library linking problems with utelnetd or busybox3, though that is still my best guess.

I suppose my next trial could in fact be grabbing the utelnetd/busybox3 files from the latest ffp package and seeing if those will work (without having to also copy over a lib folder full of new libraries)...

On a side note, when telnetting to the NAS *did* work, I used to get a garbled character/data "on the line" randomly - it would be just one character (it would display as a fuzzy character box on the console), or some times I would lose a character I was typing (so if I went to type "ls ..." I would end up with just "s ..." as it consumed the l character).  I had gone over my telnet session settings and had never figured it out; has anyone here had that problem and solved it?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB