dropbear: hide dropbear version
authorKevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
Thu, 31 Aug 2017 12:32:39 +0000 (14:32 +0200)
committerZoltan HERPAI <wigyori@uid0.hu>
Thu, 31 Aug 2017 12:32:39 +0000 (14:32 +0200)
As security precaution and to limit the attack surface based on
the version reported by tools like nmap mask out the dropbear
version so the version is not visible anymore by snooping on the
wire. Version is still visible by 'dropbear -V'

Based on a patch by Hans Dedecker <dedeckeh@gmail.com>

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/dropbear/Makefile

index 8c9b45f..7caf0c7 100644 (file)
@@ -104,6 +104,10 @@ define Build/Configure
          mv $(PKG_BUILD_DIR)/options.h.new $(PKG_BUILD_DIR)/options.h || exit 1; \
        done
 
+       # remove protocol idented software version number
+       $(SED) 's,^#define LOCAL_IDENT .*$$$$,#define LOCAL_IDENT "SSH-2.0-dropbear",g' \
+               $(PKG_BUILD_DIR)/sysoptions.h
+
        # Enforce rebuild of svr-chansession.c
        rm -f $(PKG_BUILD_DIR)/svr-chansession.o
 endef