static dropbear for live digital forensics
This commit is contained in:
parent
3ebe1f0df2
commit
3824dbb47c
65
build_static_dropbear
Executable file
65
build_static_dropbear
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage: ./build_static_dropbear
|
||||
# or
|
||||
# bash build_static_dropbear
|
||||
# Description: Download newest stable dropbear release and
|
||||
# compiles static binaries (client, server and scp)
|
||||
# Author: Patrick Neumann (patrick@neumannsland.de)
|
||||
# Platform: Debian or Raspbian GNU/Linux (tested: 9.5)
|
||||
# Version: 1.0
|
||||
# Date: 06.07.2018
|
||||
# License: GPL3
|
||||
# Warranty: This program is distributed WITHOUT ANY WARRANTY
|
||||
|
||||
# autodetect arch:
|
||||
ARCH="$( /bin/uname --machine )"
|
||||
|
||||
# autodetect release or do it manualy:
|
||||
RELEASE="$( /usr/bin/curl --silent https://matt.ucc.asn.au/dropbear/dropbear.html \
|
||||
| /bin/grep --extended-regexp "Latest is [[:digit:]]{4}\.[[:digit:]]{1,3}" \
|
||||
| /bin/grep --extended-regexp --only-matching "[[:digit:]]{4}\.[[:digit:]]{1,3}" )"
|
||||
#RELEASE="2018.76"
|
||||
/usr/bin/test -n "${RELEASE}" || ( echo "Release detection failed - please edit script manually" ; exit 1 )
|
||||
|
||||
# dependencies (static libs):
|
||||
if [ ! -f /usr/share/build-essential/list ] ; then /usr/bin/sudo /usr/bin/apt install build-essential --assume-yes ; fi
|
||||
if [ ! -f /usr/lib/*-linux-gnu*/libc.a ] ; then /usr/bin/sudo /usr/bin/apt install libc6-dev --assume-yes ; fi
|
||||
if [ ! -f /usr/lib/*-linux-gnu*/zlib.a ] ; then /usr/bin/sudo /usr/bin/apt install zlib1g-dev --assume-yes ; fi
|
||||
|
||||
# downloading...
|
||||
/usr/bin/wget https://matt.ucc.asn.au/dropbear/releases/dropbear-${RELEASE}.tar.bz2
|
||||
|
||||
# extracting...
|
||||
/bin/tar xjf dropbear-${RELEASE}.tar.bz2
|
||||
|
||||
# compiling and stripping...
|
||||
cd dropbear-${RELEASE}
|
||||
./configure --enable-static \
|
||||
--disable-syslog \
|
||||
--disable-lastlog \
|
||||
--disable-utmp \
|
||||
--disable-utmpx \
|
||||
--disable-wtmp \
|
||||
--disable-wtmpx
|
||||
/usr/bin/make PROGRAMS="dropbear dbclient scp"
|
||||
/usr/bin/make strip
|
||||
|
||||
# rename binary:
|
||||
BINARY1="dbclient-${ARCH}-${RELEASE}"
|
||||
/bin/mv dbclient "${BINARY1}"
|
||||
BINARY2="scp-${ARCH}-${RELEASE}"
|
||||
/bin/mv scp "${BINARY2}"
|
||||
BINARY3="dropbear-${ARCH}-${RELEASE}"
|
||||
/bin/mv dropbear "${BINARY3}"
|
||||
|
||||
# final instructions:
|
||||
echo
|
||||
echo "Ready to copy:"
|
||||
echo
|
||||
echo " cp $PWD/${BINARY1} /media/POLICE/"
|
||||
echo " cp $PWD/${BINARY2} /media/POLICE/"
|
||||
echo " cp $PWD/${BINARY3} /media/POLICE/"
|
||||
echo
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user