Coder Social home page Coder Social logo

akpotter / embedded-toolkit Goto Github PK

View Code? Open in Web Editor NEW
46.0 3.0 50.0 84.36 MB

Prebuilt statically linked gdbserver and gawk executables for Linux on ARMEL, MIPS/MIPSEL and more platforms for use on embedded devices, including for systems with many different ABIs (including more than 20 statically linked gdbserver executables)

License: Other

Shell 97.38% Standard ML 2.62%

embedded-toolkit's Introduction

embedded-toolkit

Useful executables (statically linked via muslibc or uClibc) for different variants of ARM and MIPS Linux systems (MSB, LSB, different ABIs including the elusive ARMEL-OABI, etc.) meant for doing low-level work on modern or ancient embedded devices (yes, I worked with an ARMEL-OABI system in the year 2017)

Target OS

Just to be clear: this is Linux OS only stuff. No Solaris, AIX, etc, etc.. the aim was embedded devices, hence the title

Recursive clone

git clone --recursive https://github.com/mzpqnxow/embedded-toolkit

A recursive clone will pull in some toolchain helpers into build-script/ that are otherwise hosted @ ssh://github.com/mzpqnxow/gdb-static-cross

Intro

I recently needed a statically linked gdbserver for all of the above platforms, as well as some subtle variants- even MIPS-I and ARM with the "old" ABI! It was a little bit painful to build all of them, so I figured I would share them. If you find them useful, use them and let me know if you have issues, especially if you fix said issues. They are built from vanilla GDB 7.7.1 or gdb-7.12 sources, sometimes with patches found at gdb-static-cross sometimes (rarely) with a small tweak to the final linking to get a static build- which should be an obsolete requirement if you use gdb-static-cross. When compiling on native architectures, in many cases I had to make sure the GDB build process didn't try to include thread support since there aren't any common packages (I've noticed) that have static libraries for libthread_db and the configure script will enable libthread_db if it detects it on your system. This is yet again provided for in gdb-static-cross

This repository has, since creation, expanded to include more than gdbserver (see prebuild-static-bins while the gdbserver specific stuff has been moved to gdb-static-cross

The following software packages are being added slowly for different CPU architectures with varying instruction sets, byte-order, and ABI. They are all statically linked, meant to run standalone on any Linux system, intended for embedded devices. A small handful are untested so YMMV. Only gdbserver has been thoroughly tested. You will only find a few different builds of the following tools in this repository

  • tcpdump (statically linked
  • gawk (statically linked)
  • lsof (statically linked)
  • gdbserv (statically linked)
  • tshd (statically linked)
  • mawk (statically linked)
  • libpcap (static library, used for linking into tcpdump so not present in this repo)

These tools are all of obvious value on embedded devices when doing things like reverse engineering/redteam testing/other low-level fiddling, except maybe gawk. Why gawk?

$ while [ 1 ];
> do
> /usr/sbin/process/that/forks/and/detaches; sleep 1;./gdbs --attach :12345 $(ps w | grep detache[s] | awk '{print $1}')
> done

This is a lot easier than checking the PID after manually restarting the process each time (assuming it is crashing a lot, and it is being analyzed upon each crash remotely. It's a timesaver.

Notes

  • When possible, these executables were built using musl as libc, but some were built with uClibc
  • Some stuff may support or not support something you wanted (i.e. threading, IPv6, etc) and you're just stuck with the judgement call I made at the time :/
  • Yes, you have to just trust me on these being 'safe' otherwise you can go build your own - I offer a $500 bug bounty to anyone who can find a backdoor planted by me (seriously, because I'm sure I didn't)

High level supported targets

At least one of these binaries will work on almost any consumer router or other Linux based embedded device you can find:

  • Linksys (err, Cisco)
  • NETGEAR
  • D-Link
  • Asus
  • .. etc, etc. ..

Also the i486 and x86_64 versions will obviously work on commodity Linux workstations and servers

Other targets

If you'd like another target architecture, either file an issue or send a pull request with your own after you've tested it, I'd be happy to have a wider collection of these as I do a fair amount of work on embedded devices and seem to always be coming across obscure ones that I don't already have a build for.

General tips on performing a static build of GDB 7.7.1

Please see gdb-static-cross as it helps to build the most recent version of gdb and contains some scripts to help you out if you're cross-compiling, which is usually the case with gdbserver, isn't it?

embedded-toolkit's People

Contributors

mzpqnxow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.