From 1f00f2fa05b04f6e8941b3249722623fb6b033b5 Mon Sep 17 00:00:00 2001 From: dmiller Date: Sun, 2 Sep 2018 20:51:05 +0000 Subject: [PATCH] Simplify backorifice crypt function, remove bin.lua packing. --- CHANGELOG | 2 +- scripts/backorifice-brute.nse | 19 ++++++++----------- scripts/backorifice-info.nse | 31 ++++++++++++++++--------------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 11f72fcf0..3ecf03256 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,7 @@ o Emergency fix to Nmap's birthday announcement so Nmap wishes itself a "Happy 21st Birthday" rather than "Happy 21th" in verbose mode - (-v) on September 1, 2018. [David Fifield] + (-v) on September 1, 2018. [Daniel Miller] o [NSE] Completely removed the bit.lua NSE library. All of its functions are replaced by native Lua bitwise operations, except for `arshift` (arithmetic diff --git a/scripts/backorifice-brute.nse b/scripts/backorifice-brute.nse index 897c7f949..8b27174d2 100644 --- a/scripts/backorifice-brute.nse +++ b/scripts/backorifice-brute.nse @@ -1,5 +1,4 @@ local bits = require "bits" -local bin = require "bin" local brute = require "brute" local creds = require "creds" local nmap = require "nmap" @@ -67,6 +66,7 @@ portrule = function(host, port) not(shortport.port_is_excluded(port.number,port.protocol)) end +local MAGICSTRING ="*!*QWTY?" local backorifice = { new = function(self, host, port) @@ -95,7 +95,7 @@ local backorifice = -- @return err string containing error message on failure try_password = function(self, password, initial_seed) --initialize BackOrifice PING packet: |MAGICSTRING|size|packetID|TYPE_PING|arg1|arg_separat|arg2|CRC/disregarded| - local PING_PACKET = bin.pack("A