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-08-28 18:37:38

Joor
New member
From: Germany
Registered: 2006-08-27
Posts: 4

dropbear ssh

Hi,

I have compiled the dropbear ssh.
It works fine for me, also scp etc.

I tried to upload it somewhere to this forum, but don't know how.
Sala, please tell me your mail address to send you the file.

Joor

Offline

 

#2 2006-08-28 19:27:27

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: dropbear ssh

If the file is under 500kb then you can add attachments to your posts.
Don't use Quick post, insted use Post reply.
If you still fail then you can send it by email support (at) source.pri.ee


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#3 2006-08-29 08:36:42

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: dropbear ssh

Thanks for the binary!
fun_plug and initialize script is kind of messy. I will fix them as soon as I get home smile

http://dns323.kood.org/dsmg600/download … 48.tar.bz2


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#4 2006-08-29 14:18:38

Joor
New member
From: Germany
Registered: 2006-08-27
Posts: 4

Re: dropbear ssh

Yeah,

indeed they are a little bit hacky.

I tried to set up an environment with bin, sbin, usr, var, etc in the system folder on the disk.
The goal is to create a chroot environment to build up a nicer system with dns, dhcp, ftp, nfs and so on.

So the entries in the README and initialize are mixed, sorry.

Joor

Offline

 

#5 2006-08-31 01:54:15

qn1234
Member
Registered: 2006-08-18
Posts: 94

Re: dropbear ssh

This sounds interesting.

I have bash compiled, and it's the root's and admin's login shell.  I have /etc, /bin, /sbin, etc... in /mnt/HD_a2.  With PATH adjusted in /mnt/HD_a2/home/root/.bashrc/.profile to include /mnt/HD_a2/bin, etc... things work out nicely.

I have a 300GB drive.  I notice that when it's formatted, it made a swap partition.  The swap partition is listed in /proc/swaps.

What do you guys think about extracting RPM and DEB packages from one of the PowerPC Linux distributions such as YellowDog or RedHat and use them instead of compiling them piece by piece.  If they're compiled for the same architecture they should work.   Which distribution do you think is a good choice?

--
Quang

Offline

 

#6 2006-08-31 13:20:21

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: dropbear ssh

This should be full fun_plug file for dropbear ssh

Code:

#!/bin/sh
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 &

All needed bin files are here (busybox, sed and dropbearmulti)
http://dns323.kood.org/downloads/busybo … .1.tar.bz2
http://dns323.kood.org/downloads/dropbear-0.48.tar.bz2


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#7 2006-08-31 14:05:12

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: dropbear ssh

qn1234 wrote:

What do you guys think about extracting RPM and DEB packages from one of the PowerPC Linux distributions such as YellowDog or RedHat and use them instead of compiling them piece by piece.  If they're compiled for the same architecture they should work.   Which distribution do you think is a good choice?

First we need to chroot into a libc environment.
Look http://dns323.kood.org/forum/viewtopic.php?id=4


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#8 2006-12-01 05:51:38

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

Re: dropbear ssh

qn1234 (or anybody else who has this working),

i'd like to have tab completion when i shell in, and i assume you have it working on yours from what you describe.

i don't really care if it's bash or a different shell, so if i can implement tab completion under ash, good enough.

but i'm not a linux expert so i'm wondering if you could share your fun_plug, or expand a little more on what you did?

thanks,
hyde

Offline

 

#9 2006-12-05 06:16:39

qn1234
Member
Registered: 2006-08-18
Posts: 94

Re: dropbear ssh

hyde,

I have bash as the default shell.  With bash you can do tab-completion.

Part of my fun_plug looks like this:

#!/bin/sh

echo "fun_plug executed at `date`" >> /mnt/HD_a2/fun_plug.log

# Set up and run telnetd
cp /mnt/HD_a2/etc/passwd /etc/passwd
cp /mnt/HD_a2/etc/shadow /etc/shadow
cd /dev && /mnt/HD_a2/bin/busybox3 makedevs ptyp c 2 0 0 9
cd /dev && /mnt/HD_a2/bin/busybox3 makedevs ttyp c 3 0 0 9
/mnt/HD_a2/bin/busybox3 telnetd &


As you can see, I have a directory in /mnt/HD_a2 called etc with passwd and shadow.

The passwd file looks something like this:

root:x:0:0:Linux User,,,:/mnt/HD_a2:/mnt/HD_a2/bin/bash
admin:x:500:500:Linux User,,,:/mnt/HD_a2:/mnt/HD_a2/bin/bash
nobody:x:501:501:Linux User,,,:/mnt:/bin/sh
xbox:x:503:503:Linux User,,,:/home/ftp:/bin/sh

I also have /mnt/HD_a2/bin which contains binaries such as bash, busybox, etc...

--
Quang

Offline

 

#10 2006-12-05 08:07:54

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: dropbear ssh

Here's a binary for bash I did compile a while ago, but I haven't tested it yet.
http://dns323.kood.org/downloads/untest … .2.tar.bz2


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#11 2006-12-10 05:50:01

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

Re: dropbear ssh

@quang

thanks for the tips. i like what you did for passwd and shadow - simpler than the stock recommendation (although i can appreciate the reasoning behind that too.)

@sala

no tab completion with that binary, unless i neglected an extra step somewhere.

@(everyone)

from what i recall reading, busybox has a compile flag for ash tab completion, so it would seem that the busybox v121 binary from the download section was compiled without it. if that's the case, the question then is: why in the world was that left out?

...well, i'm still a linux noob so pardon me if i mispoke on any of that. when i'm not so busy, i plan to try my hand at building my own binaries with the supplied toolchain. i really want to get this thing running lean and mean.

still, i'm wondering: if you guys have binaries that have been working for you day after day, would you consider sharing them?

Offline

 

#12 2006-12-13 09:27:32

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: dropbear ssh

hyde wrote:

@sala
no tab completion with that binary, unless i neglected an extra step somewhere.

Try this one http://dns323.kood.org/downloads/untest … -1.tar.bz2


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#13 2006-12-13 11:56:29

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

Re: dropbear ssh

testing it out, works well so far.

thanks, sala smile

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB