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-06-05 17:51:57

thierry
Member
Registered: 2009-06-05
Posts: 30

Lost telnet and SSH

Hi,
I have no idea why, but I lost telnet and SSH yesterday to my 323.
I have ffp installed.

How can I retreive telnet and SSH?
thanks!

Offline

 

#2 2009-06-06 01:16:28

kramed
Member
Registered: 2009-06-02
Posts: 34

Re: Lost telnet and SSH

You sure your ip address didnt change?

Offline

 

#3 2009-06-06 01:26:06

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

sure. I can smb and http to it without problem.

ssh user@192.168.2.10
ssh: connect to host 192.168.2.10 port 22: Connection refused

telnet 192.168.2.10
Trying 192.168.2.10...
telnet: connect to address 192.168.2.10: Connection refused
telnet: Unable to connect to remote host

ping 192.168.2.10
PING 192.168.2.10 (192.168.2.10): 56 data bytes
64 bytes from 192.168.2.10: icmp_seq=0 ttl=64 time=0.513 ms
64 bytes from 192.168.2.10: icmp_seq=1 ttl=64 time=0.422 ms
64 bytes from 192.168.2.10: icmp_seq=2 ttl=64 time=0.338 ms
... etc


thanks!

Offline

 

#4 2009-06-06 01:35:32

kramed
Member
Registered: 2009-06-02
Posts: 34

Re: Lost telnet and SSH

I am just tossing ideas out but my next step would be to portscan it. I would want to verify what services are actually running on the system.

Offline

 

#5 2009-06-07 20:55:16

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

Port Scanning host: 192.168.2.10
     Open TCP Port:     21             ftp
     Open TCP Port:     80             http
     Open TCP Port:     139            netbios-ssn
     Open TCP Port:     443            https
     Open TCP Port:     445            microsoft-ds
     Open TCP Port:     515            printer

Seems the port is not open for SSH or telnet. How can I open the port now that I only have those port open?

thanks for your help!!

Offline

 

#6 2009-06-08 00:50:20

kramed
Member
Registered: 2009-06-02
Posts: 34

Re: Lost telnet and SSH

That is very odd. Did you try reseting to factory defaults from the web interface?

Offline

 

#7 2009-06-08 01:08:00

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

huh, no... Would prefer not unless it's my only exit?!

Offline

 

#8 2009-06-08 01:23:21

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

well, I just did restore to factory default. no change. except port 21 is now closed

Port Scanning host: 192.168.2.10
     Open TCP Port:     80             http
     Open TCP Port:     139            netbios-ssn
     Open TCP Port:     443            https
     Open TCP Port:     445            microsoft-ds
     Open TCP Port:     515            printer

telnet 192.168.2.10
Trying 192.168.2.10...
telnet: connect to address 192.168.2.10: Connection refused
telnet: Unable to connect to remote host

ssh root@192.168.2.10
ssh: connect to host 192.168.2.10 port 22: Connection refused


thanks for your help!

Offline

 

#9 2009-06-08 01:30:21

michalzxc
Member
Registered: 2008-08-04
Posts: 9

Re: Lost telnet and SSH

thierry wrote:

I have ffp installed.

what is in your ffp.log?

Offline

 

#10 2009-06-08 01:38:52

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

* OK
* Running /ffp/etc/fun_plug.init ...
* 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

Offline

 

#11 2009-06-08 01:43:28

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

Also... at the top...

**** fun_plug script for DNS-323 (2008-08-11 tp@fonz.de) ****
Fri May 29 09:07:59 DST 2009
ln -snf /mnt/HD_a2/ffp /ffp
* Installing /mnt/HD_a2/fun_plug.tgz ...
tar: WARNING: Converting hard link to symlink
(last line repeated MANY times)

Offline

 

#12 2009-06-08 02:34:07

Smallstack
Member
From: New Zealand
Registered: 2009-04-05
Posts: 23
Website

Re: Lost telnet and SSH

thierry wrote:

Also... at the top...

**** fun_plug script for DNS-323 (2008-08-11 tp@fonz.de) ****
Fri May 29 09:07:59 DST 2009
ln -snf /mnt/HD_a2/ffp /ffp
* Installing /mnt/HD_a2/fun_plug.tgz ...
tar: WARNING: Converting hard link to symlink
(last line repeated MANY times)

That is normal.

thierry wrote:

Starting /ffp/sbin/telnetd -l /ffp/bin/sh
* /ffp/start/sshd.sh inactive

This tells me that telnet is started but sshd hasn't.

Did you a+x the ssh start script?

Offline

 

#13 2009-06-08 02:40:24

michalzxc
Member
Registered: 2008-08-04
Posts: 9

Re: Lost telnet and SSH

You have wrong date, or it doesn't start. Reboot and check is there (in the log file) anything new. Check if /mnt/HD_a2/fun_plug exist and is it correct.

Last edited by michalzxc (2009-06-08 02:54:36)

Offline

 

#14 2009-06-08 03:43:28

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

1 - The date is right on my device, it seems Volume_1/ffp.log does not get updated when I restart the unit. the file mod date is still dated may 29th... no modification. So it seems that your presumption that telnet is started is comes from an OLD log status value. hmm

-rwx------  1 thierry  staff  47549 29 May 09:08 ffp.log


2- I don't have a /mnt/ directory
cd /Volumes/Volume_1/
ls -l
drwx------  1 thierry  staff  16384 28 May 10:10 dropbear-0.52
drwx------  1 thierry  staff  16384 22 May  2008 ffp
-rwx------  1 thierry  staff  47549 29 May 09:08 ffp.log
-rwx------@ 1 thierry  staff   1778 29 May 09:05 fun_plug

cd ffp
ls -l
drwx------  1 thierry  staff  16384 29 May 09:08 bin
drwx------  1 thierry  staff  16384 29 May 09:08 etc
drwx------  1 thierry  staff  16384 29 May 09:08 lib
drwx------  1 thierry  staff  16384 29 May 09:08 libexec
drwx------  1 thierry  staff  16384 29 May 09:08 sbin
drwx------  1 thierry  staff  16384 29 May 09:08 share
drwx------  1 thierry  staff  16384  1 Jun 15:10 start
drwx------  1 thierry  staff  16384 19 May 19:00 tmp
drwx------  1 thierry  staff  16384 19 May 18:35 var


3- Did you a+x the ssh start script?
do you mean Volume_1/ffp/start/sshd.sh ?

I just did: chmod 777 /Volumes/Volume_1/ffp/start/sshd.sh
and restarted the unit.


cd start
ls -l
total 30
-rwx------  1 thierry  staff    52 25 Oct  2008 LOGIN.sh
-rwx------  1 thierry  staff    35 25 Oct  2008 SERVERS.sh
-rwx------  1 thierry  staff   203 29 Sep  2008 inetd.sh
-rwx------  1 thierry  staff   229 13 Apr 08:30 kickwebs.sh
-rwx------  1 thierry  staff   223 13 Apr 08:30 lighttpd.sh
-rwx------  1 thierry  staff   267 15 Apr  2008 mediatomb.sh
-rwx------  1 thierry  staff  1468 15 Apr  2008 nfsd.sh
-rwx------  1 thierry  staff   526  2 Mar 07:35 ntpd.sh
-rwx------  1 thierry  staff   160 15 Apr  2008 portmap.sh
-rwx------  1 thierry  staff   224  3 Mar 03:11 rsyncd.sh
-rwx------  1 thierry  staff   971 19 May 18:35 sshd.sh
-rwx------  1 thierry  staff   383 29 Sep  2008 syslogd.sh
-rwx------  1 thierry  staff   170  1 Jun 15:10 telnetd.sh
-rwx------  1 thierry  staff   998 26 Feb 11:08 unfsd.sh


Still cannot ssh into the device.
ssh admin@192.168.2.10
ssh: connect to host 192.168.2.10 port 22: Connection refused

thanks again all for your help!

Last edited by thierry (2009-06-08 04:00:43)

Offline

 

#15 2009-06-08 04:04:28

michalzxc
Member
Registered: 2008-08-04
Posts: 9

Re: Lost telnet and SSH

Paste this file: -rwx------@ 1 thierry  staff   1778 29 May 09:05 fun_plug

Last edited by michalzxc (2009-06-08 04:10:10)

Offline

 

#16 2009-06-08 04:12:46

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

#!/bin/sh

# switch to safe working directory on ramdisk
cd /

# write a log, in case sth goes wrong
FFP_LOG=/mnt/HD_a2/ffp.log
#FFP_LOG=/dev/null
exec >>$FFP_LOG 2>&1

# real path to ffp
FFP_PATH=/mnt/HD_a2/ffp

# where to search for the install tarball
FFP_TARBALL=/mnt/HD_a2/fun_plug.tgz

# setup script (used for ffp on USB disk)
FFP_SETUP_SCRIPT=/mnt/HD_a2/.bootstrap/setup.sh

# rc file path
FFP_RC=/ffp/etc/rc


echo "**** fun_plug script for DNS-323 (2008-08-11 tp@fonz.de) ****"
date


# check for setup script. an example use for this is to load USB
# kernel modules and mount a USB storage device. The script is
# sourced, that means you can change variables, e.g. FFP_PATH to point
# to the USB device.
if [ -x $FFP_SETUP_SCRIPT ]; then
    echo "* Running $FFP_SETUP_SCRIPT ..."
    . $FFP_SETUP_SCRIPT
fi

# create /ffp link
echo "ln -snf $FFP_PATH /ffp"
ln -snf $FFP_PATH /ffp

# install tarball
if [ -r $FFP_TARBALL ]; then
    echo "* Installing $FFP_TARBALL ..."
    mkdir -p $FFP_PATH && tar xzf $FFP_TARBALL -C $FFP_PATH && /ffp/bin/tar xzf $FFP_TARBALL -C $FFP_PATH
    if [ $? -eq 0 ]; then
        echo "* OK"
    fi
    rm $FFP_TARBALL
fi

# suid busybox
if [ -x /ffp/bin/busybox ]; then
    chown root.root /ffp/bin/busybox
    chmod 0755 /ffp/bin/busybox
    chmod u+s /ffp/bin/busybox
fi

# run fun_plug.init, if present
if [ -x /ffp/etc/fun_plug.init ]; then
    echo "* Running /ffp/etc/fun_plug.init ..."
    /ffp/etc/fun_plug.init
fi

# run fun_plug.local, if present
if [ -x /ffp/etc/fun_plug.local ]; then
    echo "* Running /ffp/etc/fun_plug.local ..."
    /ffp/etc/fun_plug.local
fi

# run commands
if [ -x $FFP_RC ]; then
    echo "* Running $FFP_RC ..."
    $FFP_RC
    echo "*  OK"
else
    echo "$FFP_RC: Not found or not executable"
fi

Offline

 

#17 2009-06-08 15:42:02

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

hoping this can help. smile

Offline

 

#18 2009-06-10 02:33:16

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

Does anyone have a suggestion for me?
Should I reinstall ffp?
thanks!
--
Thierry

Offline

 

#19 2009-06-10 03:35:19

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

Re: Lost telnet and SSH

have you inserted a new hdd recently?

Offline

 

#20 2009-06-10 06:13:49

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

yes! Volume_2

Offline

 

#21 2009-06-10 12:21:48

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

Re: Lost telnet and SSH

that might explain it.  Was the original drive in the left hand bay?  If so, the unit has swapped the drives - drive 0 is in the righthand bay and drive 1 in the lefthand.  If you drop the two funplug files from fonz (fun_plug and fun_plug.tgz) in the new drive and reboot ffp will install and run again on the new drive and your console access will be back.

Offline

 

#22 2009-06-14 16:30:49

thierry
Member
Registered: 2009-06-05
Posts: 30

Re: Lost telnet and SSH

That did it!
Thanks to everyone who assisted in this thread! smile
THANKS A LOT! smile

Offline

 

#23 2009-06-15 05:54:51

kramed
Member
Registered: 2009-06-02
Posts: 34

Re: Lost telnet and SSH

Very strange. When I installed the single drive that I have in my unit I assumed the left most bay would be the first drive. Good to know.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB