- Mitglied seit
- 3 Apr 2006
- Beiträge
- 639
- Punkte für Reaktionen
- 1
- Punkte
- 18
my_busybox=/var/custom/bin/busybox
my_address=192.168.178.1
my_port=69
source_dir=/var/media/ftp
$my_busybox udpsvd -v -c 3 -E $my_address $my_port $my_busybox tftpd -r -l $source_dir
# wget http://yourfritz.de/inject_shellinabox_vr9_nand_sqfs4.tar
# ls -la
drwxr-xr-x 2 root root 4096 Jan 1 16:08 .
drwxrwxrwx 32 root root 4096 Jan 1 15:51 ..
-rw-r--r-- 1 root root 539648 Jan 1 15:50 inject_shellinabox_vr9_nand_sqfs4.tar
# tar xvpf inject_shellinabox_vr9_nand_sqfs4.tar
./var/
./var/install
./var/signature
./var/tmp/
./var/tmp/kernel.image
./var/tmp/filesystem.image
# mkdir temp_dir
# mount -t squashfs var/tmp/filesystem.image temp_dir
# find temp_dir
temp_dir
temp_dir/bin
temp_dir[COLOR="#0000FF"]/bin/busybox[/COLOR]
temp_dir/etc
temp_dir/etc/init.d
temp_dir/etc/init.d/rc.custom
temp_dir/lib
temp_dir/lib/libprivatekeypassword.so
temp_dir/usr
temp_dir/usr/bin
temp_dir/usr/bin/privatekeypassword
temp_dir/usr/bin/shellinaboxd
# temp_dir/bin/busybox
BusyBox v1.23.2 (2015-12-15 09:59:22 CET) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.
Usage: busybox [function [arguments]...]
or: busybox --list
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:
[, [[, addgroup, adduser, arp, arping, ash, awk, base64, basename, bash, bbconfig, blkid, blockdev, brctl, bunzip2, bzcat, bzip2, cat, chat, chattr, chgrp, chmod, chown, chpst,
chroot, cksum, clear, cmp, comm, conspy, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg,
dnsd, dnsdomainname, dos2unix, dpkg, dpkg-deb, du, dumpleases, echo, egrep, env, envdir, envuidgid, ether-wake, expand, expr, false, fatattr, fdisk, fgconsole, fgrep, find,
findfs, flash_eraseall, flash_lock, flash_unlock, flashcp, flock, fold, free, fsck, fsync, ftpd, ftpget, ftpput, fuser, getopt, grep, groups, gunzip, gzip, halt, hd, hdparm, head,
hexdump, hostid, hostname, httpd, id, ifconfig, ifdown, ifenslave, ifup, inetd, init, inotifyd, insmod, install, iostat, ip, ipaddr, ipcalc, ipcs, iplink, iproute, iprule,
iptunnel, kill, killall, killall5, klogd, last, less, ln, logger, login, logname, logread, losetup, ls, lsattr, lsmod, lsof, lspci, lsusb, lzcat, lzma, makedevs, makemime, md5sum,
microcom, mkdir, mkfifo, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mv, nanddump, nandwrite, nbd-client, nc, netstat, nice, nmeter,
nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, poweroff, printenv, printf, ps, pscan, pstree, pwd, pwdx,
rdate, rdev, readlink, realpath, reboot, reformime, renice, reset, rev, rfkill, rm, rmdir, rmmod, route, rpm, rpm2cpio, run-parts, runsv, runsvdir, rx, sed, sendmail, seq,
setconsole, setlogcons, setserial, setsid, setuidgid, sh, sha1sum, sha256sum, sha3sum, sha512sum, shuf, slattach, sleep, smemcap, softlimit, sort, split, start-stop-daemon, stat,
strings, stty, stun-ip, sv, svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, taskset, tcpsvd, tee, telnet, telnetd, test, tftp, [COLOR="#0000FF"]tftpd[/COLOR], time, timeout,
top, touch, tr, traceroute, traceroute6, true, tty, tunctl, tune2fs, ubiattach, ubidetach, ubimkvol, ubirmvol, ubirsvol, ubiupdatevol, udhcpc, udhcpc6, udhcpd, udpsvd, umount,
uname, unexpand, uniq, unix2dos, unlink, unlzma, unxz, unzip, uptime, users, usleep, uudecode, uuencode, vconfig, vi, watch, watchdog, wc, wget, which, who, whois, xargs, xz,
xzcat, yes, zcat, zcip
#
# temp_dir/bin/busybox tftpd
BusyBox v1.23.2 (2015-12-15 09:59:22 CET) multi-call binary.
Usage: tftpd [-cr] [-u USER] [DIR]
Transfer a file on tftp client's request
tftpd should be used as an inetd service.
tftpd's line for inetd.conf:
[COLOR="#0000FF"]69 dgram udp nowait root tftpd tftpd -l /files/to/serve[/COLOR]
It also can be ran from udpsvd:
udpsvd -vE 0.0.0.0 69 tftpd /files/to/serve
-r Prohibit upload
-c Allow file creation via upload
-u Access files as USER
-l Log to syslog (inetd mode requires this)
#
# ls -la /etc/inetd.conf
lrwxrwxrwx 1 root root 21 Dec 10 19:23 /etc/inetd.conf -> ../var/tmp/inetd.conf
# cat /etc/inetd.conf
21 stream tcp6 nowait.30 root /bin/sh sh /bin/inetdftp
139 stream tcp6 nowait root /bin/sh sh /bin/inetdsamba
445 stream tcp6 nowait root /bin/sh sh /bin/inetdsamba
#
# mkdir /var/media/ftp/bin
# cp -p bin/busybox /var/media/ftp/bin/busybox_pp
# mkdir /var/media/ftp/tmp
#
# vi /etc/inetd.conf
21 stream tcp6 nowait.30 root /bin/sh sh /bin/inetdftp
139 stream tcp6 nowait root /bin/sh sh /bin/inetdsamba
445 stream tcp6 nowait root /bin/sh sh /bin/inetdsamba
[COLOR="#0000FF"]69 dgram udp nowait root /var/media/ftp/bin/busybox_pp tftpd -l /var/media/ftp/tmp[/COLOR]
# ps | grep inetd
[COLOR="#0000FF"]3111[/COLOR] root 1376 S /usr/sbin/inetd
6134 root 1372 S grep inetd
# kill -SIGHUP [COLOR="#0000FF"]3111[/COLOR]
#
Hallo columbo1979,wie bekomme ich dieses nun umgesetzt?
EDIT2: ...
Vielleicht habe ich es mißverständlich formuliert ... der Autor erwartet nach meinem Verständnis, daß der Client sich die eigene IP-Adresse vom DHCP-Server auf dem NAS besorgt.Ich sehe da (wenn es ordentlich konfiguriert ist) keine Probleme.
In this state, the client must also be prepared to receive one or more standard DHCPOFFER messages from servers. Each of these messages will contain configuration information as specified in RFC 2131. Each extended DHCPOFFER message can also contain configuration information as specified in RFC 2132. Which, of these configurations, if any, is used by the client is not defined by this specification.
und die Bilder habe ich nur deshalb jetzt nachträglich angesehen, weil ich nach einer Option für diese "ARP discovery" vor dem DHCPOFFER gesucht habe.Die „Start-IP-Adresse“ ist die erste IP-Adresse, die vom DHCP-Server auf dem NAS vergeben werden darf. Im Abschnitt „Router konfigurieren“ hatten wir hierfür 192.168.178.201 vorgesehen. Als „End-IP-Adresse“ bietet sich 192.168.178.210 an. Sie haben dann zehn IP-Adressen zur Verfügung, die vom DHCP-Server auf dem NAS vergeben werden dürfen.