Thursday, August 16, 2012

Checking Varnish Auth via terminal

Trick! is the auth of Varnish working?: https://gist.github.com/vicendominguez/8803517
#!/usr/bin/env perl
#
#
# If you don't have access to:
# * shell
# * varnishadm
# you can try this to pass the challenge in varnish auth-session console
#
# Vicente
use strict;
use warnings;
use Digest::SHA qw (sha256 sha256_hex);
my $challenge = $ARGV[0];
my $key = $ARGV[1];
my $result= sha256_hex($challenge . "\n" . $key . "\n" . $challenge . "\n");
print $result ."\n";
view raw varnish-pass.pl hosted with ❤ by GitHub
The first script parameter should be your password (in clear) ;)