Perl Sonicwall configuration dump decoder

Many times I run into horrible network configuration’s.  The most popular firewall I see out in the field within a major portion of clients unfortunately is the Sonicwall series (NSA, TZ).  The popularity of these firewalls spans from both small and medium businesses.  In VOIP, it is VERY necessary to make sure the client’s configuration is compatible with the VOIP configuration.  In the past, Sonicwall has a bad habit of causing problems, but admittedly are becoming better.  They may be horrid, they may not do things correctly, but they still need to be addressed accordingly.

Below is a script I put together when I found out that the Sonicwall dump (.exp) that was given to me was just a base64 conversion.  This is very useful to help troubleshoot when you do not have remote access to the unit.

#decode sonicwall exported config files
#Usage: cat sonicwall.exp | ./ > output.txt

use strict;
use MIME::Base64;

local($/) = undef; # slurp
my $decodesw = decode_base64(<STDIN>);
$decodesw =~ s/&/\n/gms;
print $decodesw;

One thought on “Perl Sonicwall configuration dump decoder

  1. Works on my Mac, and I couldn’t get anything else to decode this config Mac or Win.

Leave a Reply

Your email address will not be published. Required fields are marked *