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-10-16 22:02:11

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Strange problem with telnet

I don't undestand
i can use telnet from a linux console or win98 telnet. but with xterm, xp telnet or XP hyperterminal busybox (ash) don't work correctly. :[

Have you the same problem ? a solution ?

Offline

 

#2 2006-10-17 08:08:15

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

Re: Strange problem with telnet

"don't work correctly" what do you mean by that?
I am using xp telnet and sometimes putty telnet, nothing wrong here smile


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

Offline

 

#3 2006-10-17 17:46:01

StevieP
Member
Registered: 2006-08-19
Posts: 21

Re: Strange problem with telnet

This is just a guess, but it might be something to do with the terminal type. I use teraterm with what I believe are the default settings - the terminal gets recognised as vt102 and ash seems to work fine.

Offline

 

#4 2006-10-17 22:38:34

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: Strange problem with telnet

StevieP wrote:

This is just a guess, but it might be something to do with the terminal type. I use teraterm with what I believe are the default settings - the terminal gets recognised as vt102 and ash seems to work fine.

No i've found two problems with my fun_plug
first one i commented out the line to update /etc/shadow and /etc/passwd from the sala one

second one i have some commands after
/mnt/HD_a2/busybox telnetd &
And it seems make problems

i change the launch of telnetd by
/mnt/HD_a2/busybox telnetd -l /bin/login (without ampersand)
and now it's ok
i don't understand why

(you can try "/mnt/HD_a2/busybox telnetd -l /mnt/HD_a2/ash" but it's definetly not secure)

Offline

 

#5 2006-10-21 21:17:04

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: Strange problem with telnet

I try to make a telnet connection with only one busybox.
I compile the utelnetd but i have the same problem as when you try to launch /bin/sh (or /bin/ash) under telnet.

What's hell's problem with the orignal busybox ?

Code:

BusyBox v1.2.1 (2006.08.16-19:37+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

# ls -l /bin/busybox /mnt/HD_a2/busybox
-rwxr-xr-x    1 root     root       309564 Mar 14  2006 /bin/busybox
-rwxrwxrwx    1 bb       502        515228 Oct 15 18:02 /mnt/HD_a2/busybox
# /bin/ash
BusyBox v1.00-pre1 (2005.10.27-08:04+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

kkmkm
kmklm
kmm

I think that the Sala's busybox would be too large to feet in a ramdisk ...

Offline

 

#6 2006-10-21 22:10:09

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

Re: Strange problem with telnet

Busybox inside D-Link firmware does not have any usable shells.


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

Offline

 

#7 2006-10-22 11:31:24

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: Strange problem with telnet

sala wrote:

Busybox inside D-Link firmware does not have any usable shells.

Yes inded they don't work with any telnetd but why ? probably a problem with tty ?

Code:

BusyBox v1.2.1 (2006.08.16-19:37+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
# /bin/busybox busybox
BusyBox v1.00-pre1 (2005.10.27-08:04+0000) multi-call binary

Usage: busybox [function] [arguments]...
   or: [function] [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use, and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, arping, ash, autoip, basename, busybox, cat, chgrp, chmod,
        chown, cmp, cp, crond, crontab, date, df, dmesg, echo, egrep,
        env, expr, false, fgrep, find, free, fsck.minix, goweb, grep,
        gunzip, head, hostname, id, ifconfig, init, insmod, kill, ln,
        ls, lsmod, mkdir, mkfs.minix, mkswap, modprobe, more, mv, pidof,
        ping, ps, pwd, rdate, reboot, rm, rmmod, route, sh, sleep, swapoff,
        swapon, sync, tail, tar, test, touch, true, udhcpc, uname, zcat 
# /bin/busybox sh <<EOT
> ls
> echo "scrogneugneu je fonctionne"
> EOT
bin          etc          lib          proc         sys          var
default      home         lost+found   root         tmp          web
dev          image.cfs    mnt          sbin         usr          welcome.msg
scrogneugneu je fonctionne
#

Code:

# ./busybox-chroot ash


BusyBox v1.00-pre1 (2006.07.26-08:39+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

and here is blocked

the old busybox in the dsm box is guilty.

Last edited by BertrandB (2006-10-23 19:53:46)

Offline

 

#8 2006-10-22 17:37:07

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

Re: Strange problem with telnet

Try makedevs for ttys fix.


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

Offline

 

#9 2006-10-24 08:32:21

vic_macky
Member
Registered: 2006-10-22
Posts: 20

Re: Strange problem with telnet

ok so i tried telnet on my DSM on Windows XP and i'm getting the message "Could not open connection to the host, on port 23: connect failed". What else do i need to do? How do i open connection on port 23. BTW, My DSM is connceted to a linksys WRT54G running on a DD-WRT firmware. Do i need to port forward port 23?

Offline

 

#10 2006-10-24 12:56:20

Grouper
Member
Registered: 2006-09-19
Posts: 33

Re: Strange problem with telnet

@vic_macky: no,you do not need a port forward since you and the DSM are both behind the firewall, not on different sides. Iīm running the exact same set-up as you do, somaybe I can help.
Wehn you get the above message that means that the port 23 is not open on your dsm. Check whethter the chmod of your fun_plug did work and the flag for execute is set. (I did it with WS_FTP_LE first, did not work,CYGWIN did the job). Then check whether you have the latest busybox an sed binary from this page in your root path (/mnt/HD_a2) and everything should work fine.
Regards, Grouper

Offline

 

#11 2006-10-31 10:22:24

krishna
New member
Registered: 2006-10-29
Posts: 4

Re: Strange problem with telnet

vic_macky, your problem looks like you do not have the required terminal devices set up.
First, make sure that your telnetd is compiled without unix98 pty support (as this uses a different mechanism to find pty devices than we will use here.)
Then in your fun_plug script, add the following lines:

Code:

for i in 0 1 2 3 4 5 6 7
do
/bin/mknod /dev/ttyp$i c 3 $i
/bin/mknod /dev/ptyp$i c 2 $i
done

then put in the line that starts telnetd.

Offline

 

#12 2006-10-31 17:59:36

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

Re: Strange problem with telnet

krishna, thanks for your fix smile

I did add a another way to enable telnet, without having custom busybox in telnet thread.


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

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB