Intercept Log Writing (Hack post)
Dear Colleges:
I had try so hard to intercept the write to a log in my server and until now the most near that I'm is running this bash script:
<code>
#!/bin/bash
function Recur(){
### Write here what you want to execute #######
My Cleaner Code
###############################################
sleep 900 ### Delayed time
Recur
}
Recur
</code>
Obviously this can be mash with a funny(or like real name) but still will not avoid the well know tail command and an admin still can read what the service is writing to the log file.
Also I tried using <code>tee</code> and <code>logger</code>, something like that:
<code>TheLog "|/bin/sh -c '/usr/bin/tee -a /var/log/file.log | /usr/bin/logger -service -plocal6.err'"</code>
But futile cause the service return me an error in this line.
What I want is to intercept the writing before "happen"; and, of course, must be in real time. I think that the idea is to pass the write line trough my Clean Code and then write it to the log file.
I don't want miss understandings, this a full hack action; also the examples are "examples" and not the real code.