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-06-13 23:54:02

Headcase_Fargone
Member
Registered: 2009-11-06
Posts: 44

Help with telnet login

So I very stupidly removed the "-l /ffp/bin/sh" switch in telnetd.sh.  Now when I telnet into my DNS-321 I put in my password (the only one I could think of was the password that I use to log in to the box's web GUI) it brings me to some shell which reads: "BusyBox v1.00-pre1 (2009.02.11-09:07+0000) Built-in shell (ash)"

Typing in the 5784468 code I found on the funplug wiki gets me to a prompt, but I don't appear to have any permissions to do much of anything.  I can't stop any scripts running and I can't edit telnetd.sh to put that switch back so I can have full control from telnet.

What do I do?

Edit:  I've tried su - but everything I enter yields a password incorrect.  I can't seem to get root back.  There's only one password that I ever would have chosen for this and it doesn't work, nor does leaving the password blank.

There has to be some way to edit that telnetd.sh file to put that switch back in and get me back to normal, but I can't for the life of me figure out how.

Last edited by Headcase_Fargone (2010-06-14 00:02:16)

Offline

 

#2 2010-06-14 07:35:29

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: Help with telnet login

I am sure there are many ways to do this.

This is one.
make a fun_plug scripts with only a copy command.
With this you can overwrite the telnetd.sh with whatever you have edited.

Offline

 

#3 2010-06-14 15:07:20

Headcase_Fargone
Member
Registered: 2009-11-06
Posts: 44

Re: Help with telnet login

Being fairly new to Linux (obviously since I screwed this up) care to walk me through that?  Would be greatly appreciated.

Offline

 

#4 2010-06-14 21:35:04

bjby
Member
Registered: 2009-02-22
Posts: 265

Re: Help with telnet login

fun_plug is a script excuted on bootup with root access. You can write commands to pretty much do whatever. The fonz funplug installs FFP and starts various services. It is quite complex. This provided below is very simple.


Take a backup of current fun_plug
replace code with this.


Code:

#!/bin/sh

#simple fun_plug
#copies telnet start script to root of harddisk and sets full access.

#copy file to root folder on first disk.
cp /ffp/start/telnetd.sh /mnt/HD_a2/telnetd.sh.copy

#All can do all (accessrights)
chmod 777 /mnt/HD_a2/telnetd.sh.copy

# Remove this if you copy an edited copy back. Do you get it? 
# cp -f /mnt/HD_a2/telnetd.sh /ffp/start/telnetd.sh

Last edited by bjby (2010-06-14 21:40:00)

Offline

 

#5 2010-06-16 01:32:06

Headcase_Fargone
Member
Registered: 2009-11-06
Posts: 44

Re: Help with telnet login

I just add those lines to /etc/fun_plug.init then?  Seems easy enough, but I'm sure I'll find a way to screw it up.

Edit: Am I adding or replacing?

Last edited by Headcase_Fargone (2010-06-16 01:33:31)

Offline

 

#6 2010-06-16 19:12:17

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

Re: Help with telnet login

Assuming:

1) You are on a Windows box which can see and use the files on the DNS-323.
2) You have a share defined on the DNS-323 that lets you see the entire disk (Volume_1) in read/write mode. 

You should probably already have these things in place if you installed ffp by copying files to the 323.  If you used FTP, then replace the file moving instructions below with FTP operations.

First, on the Windows box, go to the network share that is the root (Volume_1) of the DNS-323 disk.  Navigate down to ffp/start.  Copy the telnetd.sh file to someplace on the Windows box like the Desktop.

Obtain and install the notepad++ text editor on the Windows box.  Linux uses a different line separator convention than Windows, and this editor preserves it.

Edit the copy of telnet.sh on your Desktop with notepad++ and restore the line you messed up.  It should be:

telnetd_flags="-l /ffp/bin/sh"

Save the file to your Windows desktop.

In your explorer window containing the DNS-323 files, navigate back up to the root or top of that disk.  You should see the fun_plug file there.

Drag/Copy the modified telnet.sh file from your Desktop to the root of the DNS-323 tree.  In other words, the same place as the fun_plug file.  You cannot drag it back to ffp/start because you do not have write permissions there.

Edit the fun_plug file directly in the DNS-323 root with notepad++.  Don't copy it to the Desktop or anything.  Just edit it directly on the DNS-323 disk if you can.  If using FTP, get it, edit it, and then put it back.

Add the following lines at the bottom of the fun_plug file:

Code:

cp -f /mnt/HD_a2/telnetd.sh /ffp/start/telnetd.sh
chmod 755 /ffp/start/telnetd.sh

These lines copy your modified file to the place it belongs and sets the permissions correctly.

Reboot twice.

Yes, twice because the first reboot was still using the old telnetd.sh.  If you want, you can put the two lines in the "right place" in the fun_plug script and achieve this with just one reboot.  I would try just before the "#run fun_plug.init, if present" comment.  But putting the lines at the bottom and rebooting twice is less risky and easier to explain.

You should be able to telnet in now.
If successful, edit the fun_plug file to remove the two lines that you added.
You can also delete the telnetd.sh file in the root - not the one in ffp/start.


If you have not done very much customization, you might just consider reinstalling ffp.  I think that this can be done by just putting the fun_plug.tgz file back in the 323 root.


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

Offline

 

#7 2010-06-16 20:38:26

Headcase_Fargone
Member
Registered: 2009-11-06
Posts: 44

Re: Help with telnet login

Now those are the kind of instructions I needed.  I'll give that a try as soon as I get home.  I've added a few items (Automatic, LightTPD and the like) since installing FFP so I'd hate to have had to re-install it.

Thanks much to both of you in advance.

Offline

 

#8 2010-06-17 04:19:24

Headcase_Fargone
Member
Registered: 2009-11-06
Posts: 44

Re: Help with telnet login

Success!  Thanks again, guys.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB