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.152 packer/provisioners/post_install.sh
pwn-0.5.151 packer/provisioners/post_install.sh
pwn-0.5.150 packer/provisioners/post_install.sh
pwn-0.5.106 packer/provisioners/post_install.sh
pwn-0.5.105 packer/provisioners/post_install.sh
pwn-0.5.104 packer/provisioners/post_install.sh
pwn-0.5.103 packer/provisioners/post_install.sh
pwn-0.5.102 packer/provisioners/post_install.sh
pwn-0.5.101 packer/provisioners/post_install.sh
pwn-0.5.100 packer/provisioners/post_install.sh
pwn-0.5.99 packer/provisioners/post_install.sh
pwn-0.5.98 packer/provisioners/post_install.sh
pwn-0.5.97 packer/provisioners/post_install.sh
pwn-0.5.96 packer/provisioners/post_install.sh
pwn-0.5.95 packer/provisioners/post_install.sh
pwn-0.5.94 packer/provisioners/post_install.sh
pwn-0.5.93 packer/provisioners/post_install.sh
pwn-0.5.92 packer/provisioners/post_install.sh
pwn-0.5.91 packer/provisioners/post_install.sh
pwn-0.5.90 packer/provisioners/post_install.sh