Sha256: d99ba115c5b9cc952390ad823ea1c15c9c3ff0198af590eb173257827d2d731a

Contents?: true

Size: 1.66 KB

Versions: 813

Compression:

Stored size: 1.66 KB

Contents

#!/bin/bash --login
pwn_provider=`echo $PWN_PROVIDER`

# Clenup History
sudo /bin/bash --login -c 'find /home -type f -name ".*history" -exec shred -u {} \;'
sudo /bin/bash --login -c 'find /root -type f -name ".*history" -exec shred -u {} \;'

# Cleanup Logs
sudo /bin/bash --login -c 'find /var/log -type f -name "*.log" | while read log; do > $log; done'
sudo /bin/bash --login -c 'find /var/log -type f -name "dmesg.*" -exec rm {} \;'
sudo /bin/bash --login -c '> /var/log/debug'
sudo /bin/bash --login -c '> /var/log/dmesg'
sudo /bin/bash --login -c '> /var/log/lastlog'
sudo /bin/bash --login -c '> /var/log/messages'
sudo /bin/bash --login -c '> /var/log/syslog'
sudo /bin/bash --login -c '> /var/log/wtmp'

# Disable Local Root Access
sudo passwd -l root

if [[ $pwn_provider == 'aws' ]]; then
  sudo /bin/bash --login -c 'find /etc/ssh -type f -name "*_key*" -exec shred -u {} \;'
  sudo /bin/bash --login -c 'find /home -type f -name "authorized_keys" -exec shred -u {} \;'
  sudo /bin/bash --login -c 'apt autoremove -y --purge'
  # This allows for PacketFu::Utils.whoami? to properly fuction (Used in PWN::Plugins::Packet)
  # Socket.getifaddrs.each {|ifaddr| puts ifaddr.addr.inspect}; << return nil when teredo interface exists
  # this breaks https://github.com/packetfu/packetfu/blob/master/lib/packetfu/utils.rb#L196
  # which tries to call ifaddr.addr.ip? when ifaddr.addr == Nil
  sudo systemctl stop miredo
  sudo systemctl disable miredo
fi

# Clear Bash History
history -c

if [[ $pwn_provider != 'aws' ]]; then
  # Create lame password for admin user & reset during deployment via Vagrant
  echo -e "changeme\nchangeme" | sudo passwd admin

  sudo passwd --expire pwnadmin
fi

Version data entries

813 entries across 813 versions & 1 rubygems

Version Path
pwn-0.5.90 packer/provisioners/post_install.sh
pwn-0.5.89 packer/provisioners/post_install.sh
pwn-0.5.88 packer/provisioners/post_install.sh
pwn-0.5.87 packer/provisioners/post_install.sh
pwn-0.5.86 packer/provisioners/post_install.sh
pwn-0.5.85 packer/provisioners/post_install.sh
pwn-0.5.84 packer/provisioners/post_install.sh
pwn-0.5.83 packer/provisioners/post_install.sh
pwn-0.5.81 packer/provisioners/post_install.sh
pwn-0.5.80 packer/provisioners/post_install.sh
pwn-0.5.79 packer/provisioners/post_install.sh
pwn-0.5.78 packer/provisioners/post_install.sh
pwn-0.5.77 packer/provisioners/post_install.sh
pwn-0.5.76 packer/provisioners/post_install.sh
pwn-0.5.75 packer/provisioners/post_install.sh
pwn-0.5.74 packer/provisioners/post_install.sh
pwn-0.5.73 packer/provisioners/post_install.sh
pwn-0.5.72 packer/provisioners/post_install.sh
pwn-0.5.71 packer/provisioners/post_install.sh
pwn-0.5.70 packer/provisioners/post_install.sh