Perl Script Collection |
This is a collection of Perl scripts I've written over the last few years. Some are dated but I still find them quite useful at times.
| Simple Stock Quote Ticker | This is a very simple stock ticker. It sends the current price of
the requested stock to STDERR, and on updates will clear the line
and write out the update followed by the previous price. If the
price went up, the output it green. If it went down, the output is
red. Syntax: stocktick.pl <exchange> <symbol> Modules Required: Finance::Quote, Getopt::Std |
| Telnet Brute Force Password Tester | This script attempts to brute force a telnet password of up to
eight characters. Edit the script and in the top part for each
character place, enter all of the possible characters to try. The
script will make a new directory in /tmp/<pid> and create one
file in it for each password attempt. You can check this to see if
one of the attempts succeeded. With minor modifications it could be
made to test anything you telnet to or ssh to. May require some
modifications based on the system you are connecting to, at the end
of the script. guess-pass.pl will only connect and wait for a string
matching "/assword/". If this doesn't arrive by itself, it will not
continue. You may need to add lines to send a username. Check the
Net::Telnet man page on how to do this. Syntax: guess-pass.pl <hostname | ip address> Modules Required: Net::Telnet |
| Exim Mail Queue Cleaner | If you use Exim and need to remove messages a particular user has
sent through your systems using SMTP AUTH. You specify the login
name, and if you really want to 'clean'. If you modified the order
in which your log line data is ordered, you may need to edit this
script. It expect the using name to be the 10th field matching the
pattern "/A=.*<email address>/" Syntax: clean_smtpauth.pl <e-mail address> Modules Required: None |
| Simple Host Monitoring via Ping | This tool was written as a test of my scripting skills. The
objective, was to script a tool which would ping a host every 60
seconds. If the ping failed 5 consecutive times, an e-mail would be
sent to a pre-determined address in the script. After 5 successful
pings the host would be marked back up. The script takes into
account intermittent failures and doesn't alarm on those. Syntax: ping.pl <host> Modules Required: None |
| Project Time Accounting CGI | This CGI was written when I needed to find a simple way, to report
how much time was being spent on various projects. The tool needed
to be simple to use, allow new projects to be submitted from the
CGI, allow for multiple users, and produce simple reports by project
name, or SysAdmin. It uses a MySQL backed. PostgreSQL could be use
with minor modifications to the types of columns used. Drop this
into your cgi-bin directory, and a also grab a copy of the
database scheme (tps.sql) Syntax: None Modules Required: CGI, DBI, Date::Calc |
| Exim Rejected Mail Statistics | If you want a very quick and dirty way to find all the reasons for
which Exim rejected an imcoming e-mail, just download and run this.
It expects the exim mainlog to be
/var/log/exim/mainlog. It's not very pretty or spot on,
but it's fast and cheap.Syntax: exim-rejectstats.pl Modules Required: None |
| Test Time Taken To Resolve DNS | This script will repeatedly lookup a hostname or IP address
against one or more specified DNS servers. After all servers have
been checked, the script returns the server name, number of queries
performed, time taken for the last query, and the fastest, average
and slowest query times against that DNS server. We use the `host`
command to do the lookups quickly. Syntax: test-dns.pl <hostname | ip address> <dns server> [<dns server>...] Modules Required: Time::HiRes, Text::Table |
| Real-time HTTP Log Statistics | Sometimes it is nice to be able to see how your webpages are
performing, which IP addresses are causing the most hits, and which
referrers are sending people to you at this moment in time.
webwatch.pl uses ncurses to offer a simple, but useful display of
the current state of your web statistics. Syntax: webwatch.pl --usage Modules Required: Curses |