Sha256: d99ba115c5b9cc952390ad823ea1c15c9c3ff0198af590eb173257827d2d731a

Contents?: true

Size: 1.66 KB

Versions: 812

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

812 entries across 812 versions & 1 rubygems

Version Path
pwn-0.5.235 packer/provisioners/post_install.sh
pwn-0.5.234 packer/provisioners/post_install.sh
pwn-0.5.233 packer/provisioners/post_install.sh
pwn-0.5.232 packer/provisioners/post_install.sh
pwn-0.5.231 packer/provisioners/post_install.sh
pwn-0.5.230 packer/provisioners/post_install.sh
pwn-0.5.229 packer/provisioners/post_install.sh
pwn-0.5.228 packer/provisioners/post_install.sh
pwn-0.5.227 packer/provisioners/post_install.sh
pwn-0.5.226 packer/provisioners/post_install.sh
pwn-0.5.225 packer/provisioners/post_install.sh
pwn-0.5.224 packer/provisioners/post_install.sh
pwn-0.5.223 packer/provisioners/post_install.sh
pwn-0.5.222 packer/provisioners/post_install.sh
pwn-0.5.221 packer/provisioners/post_install.sh
pwn-0.5.220 packer/provisioners/post_install.sh
pwn-0.5.219 packer/provisioners/post_install.sh
pwn-0.5.217 packer/provisioners/post_install.sh
pwn-0.5.216 packer/provisioners/post_install.sh
pwn-0.5.215 packer/provisioners/post_install.sh