Okay-say for instance I have a baby cracker on board who likes to use things like netcat to muss
the admins hair, but I have to give him a shell..
I change permissions and groups for him, restricting the binaries I don't want him to have but he needs access to awk..
With a similaridea(!this code does not work!)
awk '
function my_bad(target, client, port,p) {
client = "/inet/tcp/0/localhost/" port
getline port < "-"
if (port) {
print "shellcode" target |& client
}
p = target":"port
return p
}
BEGIN {
getline victim < "-"
i = 0
while (victim != prev) {
i = i + 1
my_bad(victim)
potvicts
= p
prev = victim
}
for (j in potvicts) {
printf "s" , potvicts[j] >> check_em_later.txt
}
}'
he can be dangerous.
But you could do the same thing with any programming langauge with a socket interface as long as you have
exploit code available...This idea just scratches the surface-if you have trustworthy users that's fine-
otherwise keep in mind that it is just as easy to set up a listening server socket as well that serves something like:
system("/bin/sh"
On the other hand without the newest awk, i really don't think there is too much that can be done as long as permissions are right...
Also I have noticed that I can use awk to look and edit differently formatted code (hex, etc..) more easily
than with tools like cat and strings, ... and do a lot in the shell that is not easily done without. So , like everything else awk can be abused.
Maybe one of the more expert guys would like to comment on this??