Tools and Utilities

Occasionally, staff members here write quick utilities and scripts to help perform a task. Often times these are quite simple but you may find them very useful. As new versions of each utility are written, they will be added here. We welcome suggestions, comments and especially bugs/errors in any of the tools found here.

Installation For all perl scripts (those ending in .pl), make sure that Perl is installed on your system. For all C programs (those ending in .c), you will need to compile the programs before running them. In many cases, you will need to copy the data file (usually named list.*) to /usr/local/bin, or change the location of the file in the program before compiling. To compile the program:

forced /home/web# ls ani*
-rw-------   1 root     root         8632 Sep  1 09:20 ani.c
forced /home/web# gcc -o ani ani.c
forced /home/web# ./ani 602
ANI for 602 is 958-3474         Phoenix, AZ. 
forced /home/web# 
The above example assumes that the file "list.ani" exists in /usr/local/bin.
Cron-based Utilities

log_rotate.tar.gz
  This shell script was created to overcome inadequacies in both Apache rotatelogs
  and cron's inability to natively run tasks on the last day of any given month.
  Rather than have to have 12 separate cron entries and not be able to handle
  Leap Days, this script allows the admin to have just one crontab entry to handle
  end-of-month processing.  This script automatically archives the past month's
  Apache access and error logs during the last minute of the last hour of the last
  day of the month.  This script can also be adapted to suit other end-of-month
  processing.

  More information is available here.

Local Information Utilities

temp.sh and temp.c Celsius/Farenheit Converter
  forced /home/web# temp 92 f
  92 Farenheit     <-->    33.33 Celsius
  forced /home/web# temp 23 c
  23 Celsius       <-->    73.40 Farenheit
  forced /home/web# 

10code.tgz	10xxx Phone Code Lookup (no 10-10-xxx yet)
  forced /home/web# 10xxx 234
  10xxx Code   234 is ACC Long Distance Corporation
  forced /home/web# 

airport.tgz Airport TLA Lookup
  forced /home/web# airport bwi
  BWI => BALTIMORE, MARYLAND, U-INT'L
  forced /home/web# 

ani.tgz ANI (Automated Number Identification) Lookup
  forced /home/web# ani 602
  ANI for 602 is 958-3474         Phoenix, AZ. 
  forced /home/web# 

areacode.tgz
  forced /home/web# ac 602
  Areacode 602: AZ Arizona (Central Phoenix only)<Mountain Time Zone>
  forced /home/web# 

consent.tgz Age of Consent Lookup
  forced /home/web# consent ca
  Age of Consent in CA..  Male/Female:18  Male/Male:17/18 Female/Female:17/18
  forced /home/web# 

country.tgz Internet Country Codes
  forced /home/web# country my
  country my: malaysia
  forced /home/web# 

esn.tgz Cellular ESN Prefix Lookup
  forced /home/web# esn 129
  ESNs beginning with 129 (or 81 HEX) are Oki
  forced /home/web# 

lass.tgz LASS Phone Code Lookup
  forced /home/web# lass 67
  LASS Code *67 Number Display Blocking         *67 (tone)  1167 (rotary)
  forced /home/web# 

ports.tgz TCP/UDP Ports 
  forced /home/web# tcp-port 25
  smtp               25/tcp Simple Mail Transfer [102,JBP]
  forced /home/web# udp-port 7
  echo                7/udp Echo [95,JBP]
  forced /home/web# 

rfc.tgz RFC Assignments
  forced /home/web# rfc 1280
  1280: IAB OFFICIAL PROTOCOL STANDARDS. J. Postel. March 1992. (Format: TXT=70458 bytes)
 (Obsoletes RFC1360) (Obsoleted by RFC2200, RFC2300, RFC2400) (Also STD0001)
 (Status: HISTORIC)
  forced /home/web# 

social.tgz Social Security Prefix Lookup
  forced /home/web# ss 417
  SS#'s beginning with 417 were issued in the state of Alabama
  forced /home/web# 
  [Diff for Windows functionality]

states.tgz State Abbreviations
  forced /home/web# state mn
  mn: Minnesota
  forced /home/web# 

zipcode.tgz Zip Code Lookup
  forced /home/web# zipcode 80235
  Zipcode 80235 is Denver, CO
  forced /home/web# 

Mailing List-Related Tools

subprobe.pl Subscription Bounce Probe
(Created due to vanity forwards and lame MTAs not providing adequate
destination address bounce information, this program provides Subject
Line and X- Header information on the destination address that will
bounce back to an address the list maintainer specifies.  Bad addresses
can then be removed manually.)

  forced /usr/local/majordomo/lists# subprobe.pl maillist
Address Bounce Probe started on: Sat Jan 22 01:11:16 MST 2000
[snip..]
Address count : 3
Blank lines   : 1
Start time    : Sat Jan 22 01:11:16 MST 2000
Finish time   : Sat Jan 22 01:11:21 MST 2000
Elapsed time  : 0 days, 0 hours, 0 minutes, 5 seconds.

Network Based Tools

fdaemon.tgz Fake Daemon is a simple little
  daemon that captures input and logs it. This is good for detecting 
  simple attempted intrusions by logging the person's IP and what they
  attempted to input.

nph-attrition1.pl by webmaster@cyberarmy.com
nph-attrition2.pl by bansh33@r00tabega.com
nph-attrition.cgi by webmaster@cyberarmy.com
nph-attrition.php by Max@Wackowoh.com
nph-attrition.py by mystik@twoteeth.net
  Scripts to yank the last 10 defacements from attrition.org/mirror/attrition/
  and place them on your web page.

att-news.pl Grabs the news listings off
  www.attrition.org/news/ and places them in the KDE disknavigator.

dict.pl Dictionary Lookup
  forced /home/web/mirror/attrition/com# dict attrition
  Definition of: attrition
  [snip..]   
     3. (Theol.) Grief for sin arising only from fear of punishment or
     feelings of shame. See [8]Contrition. --Wallis.
     Source: [9]Webster's Revised Unabridged Dictionary, © 1996, 1998 MICRA, Inc.

rfc.pl RFC Lookup
  Unlike the local version, rfc.pl remotely queries for the target
  RFC, displays it, allows searches by keyword and more. Far superior
  to rfc.c above.

ros Remote Operating System
  forced /home/web# ros www.l0pht.com
  Netcraft:    [9]www.l0pht.com is running Apache/1.3.4 (Unix) on [10]NetBSD or OpenBSD
  NMAP: Remote operating system guess: OpenBSD 2.2 - 2.3
  www.l0pht.com: Server: Apache/1.3.4 (Unix)
  forced /home/web# 

sftp Secure FTP: Wrapper for SSH Secure Copy (scp)
  sftp <put|get> <remote system> <remote path> <remote file> <local file> <userid>
  (wildcards are permitted)
  -----
  Examples:
    TO GET: sftp get othersystem /export/home/username remote.file . userid
    TO PUT: sftp put othersystem /export/home/username . local.file userid

temp.pl Temperature Lookup by ZIP code (derived from dict.pl)
   $ ./temp.pl 80202
   It is 70° F in Denver, CO (80202)


Questions, comments or suggestions: staff@attrition.org Thanks to: Cancer Omega, Jericho, Alhambra, Lurid, Munge and Str