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 2008-01-29 06:30:03

jayas
Member
Registered: 2008-01-24
Posts: 151

re: telnetd using busybox from funplug-0.3

Hello,

I am having problems using Fonz's funplug-0.3 for telnetd and I am not exactly sure why. I have included my fun-plug that works below.  If in this script, I do away with telnetd (from utelnet-kit) and replace it with a symbolic link to busybox (from funplug-0.3), telnetd fails to run and I cannot figure out why.  I tried various start up parameters for telnetd but it is a no go.  Perhaps I need other files besides busybox to run it as telnetd?

Kind regards,

Jaya

Code:

#!/bin/sh

# manifests
root=/home/root
disk=/mnt/HD_a2/fun_path
logs=/mnt/HD_a2/fun_logs
export PATH=.:$PATH

# switch to disk path
cd $disk
{
    # boot timestamp
    busybox date

    # execution trace
    set -x

    # install files
    busybox cp busybox $root
    busybox cp telnetd $root
    busybox cp profile $root/.profile

    # replace shell
    busybox mv -f /bin/sh /bin/sh.old
    busybox ln -s $root/busybox /bin/sh

    # establish console
    busybox mknod /dev/ptyp0 c 2 0
    busybox chmod 0666 /dev/ptyp0
    busybox mknod /dev/ttyp0 c 3 0
    busybox chmod 0666 /dev/ttyp0 

} >$logs 2>&1

# switch to root path
cd $root

# restrict telnet users
busybox cp /etc/passwd passwd
busybox sed -e '2,$s|:/home/.*|:/:/bin/sync|' passwd >/etc/passwd
busybox rm -f passwd
busybox echo "/etc/passwd updated" >>$logs

# clone admin password
busybox sed -n -e 's|^admin:|root:|p' /etc/shadow >>/etc/shadow
busybox echo "/etc/shadow updated" >>$logs

# start telnet daemon
telnetd -l /bin/login -d
busybox echo "telnet daemon started" >>$logs

H/W=B1 F/W=1.04; RAID1: SAMSUNG HD501LJ T166 (500GB, SATA 3.0Gb/s 16MB)

Offline

 

#2 2008-01-29 09:59:56

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: re: telnetd using busybox from funplug-0.3

The busybox binary in my funplug is modified to use non-standard directories for profile, shell, etc. You can't use it outside of the fun_plug.d directory structure.

Offline

 

#3 2008-01-29 15:55:59

blbrown
Member
Registered: 2007-11-02
Posts: 88
Website

Re: re: telnetd using busybox from funplug-0.3

fonz, which functions of your busybox would fail outside of fun_plug.d?  I'm also trying to run it stand-alone for a few commands for mounting a USB disk (after which fun_plug.d is available).  So far I haven't had trouble using your busybox for insmod, mount, cp, echo, sleep, date, and more.  In other words, it seems to work for me currently, where busybox is used by itself to mount a USB key, after which fun_plug.d is mounted.  Should I be suspicious, or will I run into problems at some point?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB