Sha256: b01b884bfd9b7357ea354ea631b067e7022fdfdfe4388b615a6c06c4d8c6396d

Contents?: true

Size: 1.41 KB

Versions: 748

Compression:

Stored size: 1.41 KB

Contents

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

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

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

pwn_provider = ENV.fetch('PWN_PROVIDER') if ENV.fetch('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

748 entries across 748 versions & 1 rubygems

Version Path
pwn-0.5.214 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.213 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.212 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.211 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.210 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.209 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.207 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.206 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.205 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.204 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.203 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.202 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.201 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.200 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.199 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.198 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.197 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.196 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.195 vagrant/provisioners/burpsuite_pro.rb
pwn-0.5.194 vagrant/provisioners/burpsuite_pro.rb