I have a smart energy plug which is running Busybox and works over Wifi to my local LAN. I can telnet into it, but lack crucial binaries like vi. I'd like to add a few scripts to the device, but cannot at this moment. There is however a webserver running on it that serves ASP pages for config. Could something be done with that? Below some more information about what's available. Ideally, I'd like to extend Busybox with the binaries that I need.

# uname -a
Linux (none) 2.6.21 #324 Mon Aug 25 16:53:40 CST 2014 mips unknown

# /bin/busybox
BusyBox v1.12.1 (2014-07-31 06:32:52 CEST) multi-call binary
Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

Currently defined functions:
        [, [[, ash, brctl, cat, chmod, chpasswd, cp, crond, date, dd, df,
        du, echo, expr, free, grep, halt, ifconfig, init, init, insmod, kill,
        killall, login, ls, lsmod, mkdir, mknod, mount, ping, poweroff, printf,
        ps, pwd, reboot, rm, rmmod, route, sed, sh, sleep, syslogd, telnetd,
        test, tftp, top, touch, tr, udhcpc, udhcpd, umount, uname, uptime,
        vconfig, wc

# cat /proc/filesystems
nodev   rootfs
nodev   bdev
nodev   proc
nodev   sockfs
nodev   pipefs
nodev   futexfs
nodev   tmpfs
nodev   devpts
nodev   ramfs
nodev   jffs2

# mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw)
none on /var type ramfs (rw)
none on /etc type ramfs (rw)
none on /tmp type ramfs (rw)
none on /media type ramfs (rw)
none on /dev/pts type devpts (rw)

# df
Filesystem           1k-blocks      Used Available Use% Mounted on
  • How much free space do you have on that thing (your df output is somehow empty)? You can download precompiled busybox with (almost) all applets enabled directly from the busybox site. – frostschutz Jul 6 '16 at 12:59

You can can transfer files using tftp. With it you can transfer various tools on your device, including another busybox which has vi and other utilities you need in it (check /proc/cpuinfo for the architecture).

Should there be no working busybox with vi for your architecture you can try to compile it yourself (preferably statically linked to uClibc) using Buildroot (https://buildroot.org/) or Crosstools-NG (http://crosstool-ng.org/) as a toolchain or like +Gilles pointed out have a look at: http://packages.debian.org/sid/busybox-static (unpack it using ar vx).

  • 3
    You can get a statically-linked busybox with most features enabled for most architectures from debian. – Gilles Jul 6 '16 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.