cPanel Tutorials | Security Guides | News Feeds | Search
Navigation
Home
Guides
Password Generator
Files
News Feeds
Hosting News
Contact Us
Documentation
Site Search
 
Latest Guides
Largest number of established connections
Kill all processes matching certain strings.
Install FFmpeg-PHP
Install FFmpeg
Configure Squid
Install Squid
Password Security
Install Teamspeak
Disable SELinux
Install RoundCube on cPanel

Viewing Guide 

Log Wget Commands
Written by: HostGeekZ



This guide is wraped for easy viewing, to see the non wraped version Click Here



Logging wget commands is a simple proccess. Remember you will have to set permissions on binarys along with the directory. You dont want people looking to see what the new file is called. Generally, this is a excellent way to pickup problems, due to the fact most attacks now adays are automated and do not put in place checks.

What this simple but useful script does, is first you move the wget binary to a new file name, you extra security you can even move it to a completely different directory. Please remember your wget path will be different, from distro to distro, get the path by typing `whereis wget`

Now, lets move our wget to a new name, for this example I choose ekigrowbwo. For my specific distro wget is located in /usr/bin/wget

To move it we use the mv command, for more information on this command please read the man page, `man mv`

mv /usr/bin/wget /usr/bin/ekigrowbwo



This renames wget to /usr/bin/ekigrowbwo , now all we have to do is create our own wget script, so just open it up with nano,
nano /usr/bin/wget

Now place this simple script inside

#!/bin/bash
ME=`whoami`
TIME=`date`
DIR=`pwd`
echo "$TIME - $ME - $* - >> $DIR" >> /usr/bin/wget.log
/usr/bin/ekigrowbwo $1



and save and exit(ctrl+x)

Now you should have a simple script in your wget binary. Now create the log file, in the script it logs too /usr/bin/wget.log just create that with the touch command.

touch /usr/bin/wget.log



That is you all done, you have now created a simple yet effective wget script, Test it by typing `wget http://www.google.com`, then `cat /usr/bin/wget` , you should see what was downloaded, when, where and by whom.

I hope this helps you.

User Comments 
     
Name:
Email: If you provide your email address you will receive updates for this guide to it.
Comment:
Verification We require you to add the following 2 values together for anti-spam purposes.
17 + 27
   

©Copyright HostGeekZ 2004-2007. All Rights Reserved.
Resources