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 2006-11-20 17:23:05

mitsus
New member
Registered: 2006-11-17
Posts: 4

SSH and scp tool problem

Hi all,
i've load into my dsm g600 telnet+sed binary and dropbear binary files.
My fun_plug file is:

Code:

# cat fun_plug
#!/bin/sh
dmesg > /mnt/HD_a2/dmesg.out

/mnt/HD_a2/busybox nc -l -p 10000 -e /bin/sh

if [ ! -e /mnt/HD_a2/ash ]
then
  ln -s /mnt/HD_a2/busybox /mnt/HD_a2/ash
fi
if [ ! `grep root /etc/shadow` ]
then
  echo kontroll.`grep admin /etc/shadow` >> /etc/shadow
  /mnt/HD_a2/sed -i -e 's/kontroll.admin/root/' /etc/shadow
fi
/mnt/HD_a2/sed -i -e 's/root:.*/root:x:0:0:Linux User,,,:\/:\/mnt\/HD_a2\/ash/' /etc/passwd
cd /dev && /mnt/HD_a2/busybox makedevs ptyp c 2 0 0 9
cd /dev && /mnt/HD_a2/busybox makedevs ttyp c 3 0 0 9
/mnt/HD_a2/busybox telnetd -l /bin/login

sleep 30

Dir_len=28
Filename_Len=26
CUSTOMIZEHDPATH=/sys/custom/shared_name/HD

file=$(find "$CUSTOMIZEHDPATH"/*)
HD_Path='expr substr "$file" "$Dir_Len" "$Filename_Len"'
HD_Path=$HD_Path"a2"

if [ -e /mnt/$HD_Path/fun_plug ]; then
        echo "function plug enable"
        /mnt/$HD_Path/fun_plug
fi
if [! -e/mnt/HD_a2/ash]
then
        ln -s /mnt/HD_a2/busybox /mnt/HD_a2/ash
fi
echo "/mnt/HD_a2/ash" >> /etc/shells
if [! 'grep root /etc/shadow']
then
        echo kontroll.'grep admin /etc/shadow' >> /etc/shadow
        /mnt/HD_a2/sed -i -e 's/kontroll.admin/root/' /etc/shadow
fi
/mnt/HD_a2/sed -i -e 's/root:.*/root:x:0:0:Linux User,,,:\/:\/mnt\/HD_a2\/ash/' /etc/passwd
cd /dev && /mnt/HD_a2/busybox makedevs ptyp c 2 0 0 9
cd /dev && /mnt/HD_a2/busybox makedevs ttyp c 3 0 0 9
if [ ! -e /mnt/HD_a2/dropbear ]
then
  ln -s /mnt/HD_a2/dropbearmulti /mnt/HD_a2/dbclient
  ln -s /mnt/HD_a2/dropbearmulti /mnt/HD_a2/dropbear
  ln -s /mnt/HD_a2/dropbearmulti /mnt/HD_a2/dropbearconvert
  ln -s /mnt/HD_a2/dropbearmulti /mnt/HD_a2/dropbearkey
  ln -s /mnt/HD_a2/dropbearmulti /mnt/HD_a2/scp
fi
if [ ! -e /mnt/HD_a2/dropbear_rsa_host_key ]
then
  /mnt/HD_a2/dropbearkey -t rsa -f /mnt/HD_a2/dropbear_rsa_host_key
  /mnt/HD_a2/dropbearkey -t dss -f /mnt/HD_a2/dropbear_dss_host_key
fi
/mnt/HD_a2/dropbear -d /mnt/HD_a2/dropbear_dss_host_key -r /mnt/HD_a2/dropbear_rsa_host_key -a &

I'm able to connect at my dsm g600 with an SSH client (on my workstation), but if i try to load a file into dsm g600 with SCP command i've this error:

Code:

# scp microperl root@192.168.1.147:/mnt/HD_a2
root@192.168.1.147's password:
ash: scp: not found
lost connection
#

Please help me.

Regards

Offline

 

#2 2006-12-01 05:24:16

hyde
Member
Registered: 2006-10-23
Posts: 15

Re: SSH and scp tool problem

I'm having problems with scp as well, both directions.

Trying to copy a file from the DSM-G600 to "angus" (a soho router running OpenWRT (inc. busybox)):
root@angus:~# pwd
/tmp
root@angus:~# scp root@nas:/mnt/HD_a2/notes.txt .
Password:
ash: scp: not found
root@angus:~#

So it makes a connection and takes the pswd, then errs out.

Trying it from the d-stink:
# pwd
/mnt/HD_a2
# ./scp notes.txt root@angus:/tmp/
/usr/bin/dbclient: No such file or directory
lost connection
# ./scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 [...] [[user@]host2:]file2
#

Anyone help with this?

TIA,
hyde

Last edited by hyde (2006-12-01 05:24:44)

Offline

 

#3 2006-12-01 08:57:28

Max
Member
Registered: 2006-09-12
Posts: 6

Re: SSH and scp tool problem

hyde,
mitsus,

scp must be in your path when you log in for scp to work. From your fun_plug, it looks like you symlnk scp to /mnt/HD_a2, which is not in the default path. Try symlinking it to /usr/bin instead.

hth

Max

Offline

 

#4 2006-12-01 10:58:25

hyde
Member
Registered: 2006-10-23
Posts: 15

Re: SSH and scp tool problem

whoops! i thought i'd already tried that, but i guess i forgot. thx for the tip, that worked.

although i should mention - when scp'ing from dlink, i get the following:

WARNING: Ignoring unknown argument '-x'
WARNING: Ignoring unknown argument '-oForwardAgent no'
WARNING: Ignoring unknown argument '-oPermitLocalCommand no'
WARNING: Ignoring unknown argument '-oClearAllForwardings yes'
Password:

it then takes my pswd, and successfully copies the file, but i'm wondering what that's about. bug in the compile?

hm, i also see the dropbear documentation recommends:
ln -s /mnt/HD_a2/system/bin/dropbearmulti /bin/scp

but i think it used to be what mitsus has, or it's cited somewhere else, because that's what i have too. (or had rather - i've changed it now.)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB