Sha256: b388441c9b9fc7e5c29afb64e6cc4e17c3d1c1df6378bdf7d22da82c1ba6f9be

Contents?: true

Size: 1.39 KB

Versions: 64

Compression:

Stored size: 1.39 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'yaml'
require 'digest'
require 'fileutils'

if ENV['PWN_ROOT']
  pwn_root = ENV['PWN_ROOT']
elsif Dir.exist?('/pwn')
  pwn_root = '/pwn'
else
  pwn_root = Dir.pwd
end

pwn_provider = ENV['PWN_PROVIDER'] if ENV['PWN_PROVIDER']
userland_config = "#{pwn_root}/etc/userland/#{pwn_provider}/burpsuite/vagrant.yaml"
userland_burpsuite_pro_jar_path = "#{pwn_root}/third_party/burpsuite-pro.jar"
burpsuite_pro_jar_dest_path = "/opt/burpsuite/#{File.basename(userland_burpsuite_pro_jar_path)}"
if File.exist?(userland_burpsuite_pro_jar_path)
  burpsuite_pro_yaml = YAML.load_file(userland_config)
  burpsuite_pro_jar_sha256_sum = burpsuite_pro_yaml['burpsuite_pro_jar_sha256_sum']
  # license_key = burpsuite_pro_yaml['license_key'].to_s.scrub.strip.chomp

  this_sha256_sum = Digest::SHA256.file(userland_burpsuite_pro_jar_path).to_s

  if this_sha256_sum == burpsuite_pro_jar_sha256_sum
    print "Copying #{userland_burpsuite_pro_jar_path} to #{burpsuite_pro_jar_dest_path}..."
    system("sudo cp #{userland_burpsuite_pro_jar_path} #{burpsuite_pro_jar_dest_path}")
  else
    puts "#{burpsuite_pro_jar_dest_path}: (SHA256 Sum #{this_sha256_sum})"
    puts "!= #{userland_config} (SHA256 Sum: #{burpsuite_pro_jar_sha256_sum})"
    print 'removing...'
    system("sudo rm #{userland_burpsuite_pro_jar_path} #{burpsuite_pro_jar_dest_path}")
  end
  puts 'complete.'
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
pwn-0.4.407 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.406 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.405 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.404 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.403 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.402 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.401 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.400 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.399 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.398 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.396 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.394 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.393 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.391 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.390 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.389 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.388 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.387 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.386 vagrant/provisioners/burpsuite_pro.rb
pwn-0.4.385 vagrant/provisioners/burpsuite_pro.rb