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 2009-03-03 00:50:34

diablo2man
Member
Registered: 2009-02-24
Posts: 17

Can't telent to the NAS because of the buggy sh

I incorrectly create a xx.sh file which has bugs in ffp/bin. Now when I try to telnet to the server, it shows the error message and "Connection to host lost."

How can I delete that file? I can't do it in windows sharing. Thanks.

Offline

 

#2 2009-03-03 04:30:33

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Can't telent to the NAS because of the buggy sh

change the fun_plug so you run a different telnet binary (see wiki howto: telnet) then delete your xx.sh, or

enable the ftp server (web interface of your dns-323) then open an ftp console and cd to ffp/start (or make this directory your root ftp folder with full permissions) then type

quote site chmod 777 xx.sh

then try deleting the file from windows file manager.  Remeber to disable ftp server afterwards and/or restore your fun_plug if you changed it.

Offline

 

#3 2009-03-03 04:40:36

diablo2man
Member
Registered: 2009-02-24
Posts: 17

Re: Can't telent to the NAS because of the buggy sh

luusac wrote:

change the fun_plug so you run a different telnet binary (see wiki howto: telnet) then delete your xx.sh, or

enable the ftp server (web interface of your dns-323) then open an ftp console and cd to ffp/start (or make this directory your root ftp folder with full permissions) then type

quote site chmod 777 xx.sh

then try deleting the file from windows file manager.  Remeber to disable ftp server afterwards and/or restore your fun_plug if you changed it.

Thanks. I've already opened a ftp console. But when I try to run "quote site chmod 777 xx.sh" in directory of ffp/start, it shows no such file exsits. If i change to ffp/bin (where my sh is), it shows not permitted. Could you tell me which part is wrong? Thanks.

Offline

 

#4 2009-03-03 04:55:37

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Can't telent to the NAS because of the buggy sh

did you put xx.sh in ffp/start ?  what is your output of ls when in ffp/start ?  If your ftp root is ffp/start you won't be able to get to ffp/bin as it is at a parrallel level and not a subordinate level (i.e. if it were to be ffp/start/bin then you would).  Try changing your ftp root to just ffp.  However, I would have thought that xx.sh is in ffp/start.  What does the end of your ffp.log say with regard to xx.sh (in the root of Volume_1).

Offline

 

#5 2009-03-03 05:49:37

diablo2man
Member
Registered: 2009-02-24
Posts: 17

Re: Can't telent to the NAS because of the buggy sh

luusac wrote:

did you put xx.sh in ffp/start ?  what is your output of ls when in ffp/start ?  If your ftp root is ffp/start you won't be able to get to ffp/bin as it is at a parrallel level and not a subordinate level (i.e. if it were to be ffp/start/bin then you would).  Try changing your ftp root to just ffp.  However, I would have thought that xx.sh is in ffp/start.  What does the end of your ffp.log say with regard to xx.sh (in the root of Volume_1).

no. I put it in ffp/bin. The output of ls in ffp/start does not contain xx.sh. I change to ftp root to ffp/bin but still can't get permission to chmod.

There is nothing related with xx.sh in the log

* Running /ffp/etc/rc ...
* /ffp/start/syslogd.sh inactive
* /ffp/start/SERVERS.sh inactive
* /ffp/start/portmap.sh inactive
* /ffp/start/unfsd.sh inactive
* /ffp/start/nfsd.sh inactive
* /ffp/start/ntpd.sh inactive
* /ffp/start/LOGIN.sh inactive
* /ffp/start/telnetd.sh ...
Starting /ffp/sbin/telnetd -l /ffp/bin/sh
* /ffp/start/sshd.sh inactive
* /ffp/start/rsyncd.sh inactive
* /ffp/start/mediatomb.sh inactive
* /ffp/start/kickwebs.sh inactive
* /ffp/start/lighttpd.sh inactive
* /ffp/start/inetd.sh inactive
*  OK


Here i paste the xx.sh:

#!/bin/sh
#################################################################
# —-[ torrentwatchdog.sh ] —-
# script to monitor a specific directory for new .torrent files.
# if found, queue them up in transmission
# TODO:  make transmission stop after seeding 1:1
# w 10/20/08 horto
#################################################################
TORRENTDIR=/mnt/HD_a2/torrents
WDLOG=$TORRENTDIR/.torrentwd.log
TRANSMISSION_REMOTE=/ffp/bin/transmission-remote

for FILE in $TORRENTDIR/*.torrent; do
if ["$FILE" != "$TORRENTDIR/*.torrent" ]; then
echo [`date`] "$FILE" added to queue. >> $WDLOG
$TRANSMISSION_REMOTE -a "$FILE"
rm "$FILE"
echo [`date`] "$FILE" deleted from directory. >> $WDLOG
sleep 1
fi
done
exit 0

The error when telnet is:
/ffp/bin/sh: [/mnt/HD_a2/torrents/*.torrent: No such file or directory

Offline

 

#6 2009-03-03 14:48:03

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Can't telent to the NAS because of the buggy sh

ok it is probably a permissions issue on the folder - I am assuming that the ftp daemon doesn't run as root (lets hope :-)

I assume that you are calling xx.sh from fun_plug or your profile.  Edit whichever file you are calling it from and then comment it out and reboot.  If that doesn't work rename the fun_plug file in the root of Volume_1 to something else and put a minimal one in its place to just fire up the telnet daemon.  see the wiki how:to telnet under the "Create the fun_plug" heading.  This does not require changing the firmware.  Once your minimal fun_plug is there reboot and get console access and edit/delete your xx.sh  Afterwards swap your fun_plug files and reboot and you will have ffp back.

Offline

 

#7 2009-03-04 12:18:36

diablo2man
Member
Registered: 2009-02-24
Posts: 17

Re: Can't telent to the NAS because of the buggy sh

luusac wrote:

ok it is probably a permissions issue on the folder - I am assuming that the ftp daemon doesn't run as root (lets hope :-)

I assume that you are calling xx.sh from fun_plug or your profile.  Edit whichever file you are calling it from and then comment it out and reboot.  If that doesn't work rename the fun_plug file in the root of Volume_1 to something else and put a minimal one in its place to just fire up the telnet daemon.  see the wiki how:to telnet under the "Create the fun_plug" heading.  This does not require changing the firmware.  Once your minimal fun_plug is there reboot and get console access and edit/delete your xx.sh  Afterwards swap your fun_plug files and reboot and you will have ffp back.

I tried your solution and now I deleted the scripts. But when I change ffp back, it still shows the same error. I didn't copy the sh to anywhere. Do you know why it is so weird? Thanks.

Offline

 

#8 2009-03-04 15:00:35

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Can't telent to the NAS because of the buggy sh

maybe it wasn't xx.sh that was causing the problem.  Are there any clues in ffp.log ?  Can you post the last boot output of ffp.log  Also have you been shutting down the box, or just restarting it?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB