2007年12月4日

My NAS-01G debian

  1. Download debian for nas-01g & telnetd


    http://www.planex.co.jp/support/driver/drive/nas-01g/nas-01g_debian.zip
    unzip =>=> nas01g_debian.tgz backdoor

  2. modify backdoor (* unix fomat not dos format)

    ------------ copy after this line---------------------------------------------

    if [ -e /mnt/Share/nas01g_debian.tgz ]; then

    cd /mnt

    tar xvzf /mnt/Share/nas01g_debian.tgz

    rm -rf /mnt/Share/nas01g_debian.tgz

    fi


    cp /mnt/Share/telnetd /mnt

    sed -i "/telnet/s/.*/telnet stream tcp nowait root telnetd/" /etc/inetd.conf

    killall inetd inetd

    rm -f /mnt/mldonkey/*.tmp

    ln -sf /mnt/mldonkey /mnt/Share/mldonkey

    ----------------------- end 0f backdoor ----------------------------

  3. put nas01g_debian.tgz backdoor telnetd to Share

    Reboot your NAS-01G and wait for few minutes

    nas01g_debian.tgz will disapper ,

    and you a folder "debian" will creat .

    Now you can telnet to NAS-01G login as all/all

    excute

    /mnt/debian/bin/chroot /mnt/debian /bin/bash

    and you will see root@NAS-01G#

    Now you can change root password

    su -

    passwd

    enter the passwd for your root then exit

    3.1 modify backdoor again

    ------------ copy after this line---------------------------------------------

    #!/bin/sh


    if [ -d /mnt/debian ]; then


    /mnt/debian/bin/chroot /mnt/debian /etc/rc3.d/S20ssh restart

    if [ ! -e /mnt/debian/proc/cpuinfo ]; then

    mount -t proc proc /mnt/debian/proc

    fi

    fi


    ----------------------- end 0f backdoor ----------------------------

    reboot NAS-01G

    upgrade your debian

  4. use putty ssh to NAS-01G

    login nas01g/nas01g ( nas01g system default user )

    su - ( enter the passwd for root )


    chmod 777 /tmp nano /etc/apt/sources.list

    ------------------------------------------------------------------------------------


    deb
    ftp://ftp.isu.edu.tw/pub/Linux/Debian/debian/ stable main contrib non-free

    deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free

    deb http://security.debian.org/ sarge/updates main contrib non-free


    -------------------------------------------------------------------------------------


    apt-get update

    apt-get upgrade