• Home
  • About

Bash

Bash, System Administration, VBScript

Finding Malware URLs in W97M infected Word Docs

An email with a trojan Microsoft Word document made it past the spam filter today at work. At least one user reported opening the attachment. The attachment was named: DOCO943488.doc, but running the file through virustotal.com it was clear that it’s been known by other names.. To help affected people find this page here are…

Bash

Bash Snippet: Luhn Algorithm

I like Bash, but it isn’t well suited for some tasks. For fun I sometimes ignore that. Occasionally people seem to find this useful. In that spirit, here is my implementation of the popular Luhn / mod10 algorithm used in credit card, IMEI, and other number sequences. download [luhn.zip] # Returns Luhn checksum for supplied…

Bash

Bash Snippet: Decimal to Binary Conversion

Convert a decimal value into the binary representation and vice versa in Bash using only built-ins. If you know a better way, please let me know. To ensure a properly formatted expression for the arithmetic expansion in bin2dec, the dec2bin function prefixes zeros as needed to pad to a character count evenly divisible by 8….

Bash, System Administration

Detect Wi-Fi Clients on your DD-WRT Router

Here is a script I wrote that scrapes the web interface of a router running DD-WRT. The script looks for the MAC addresses of wireless users. When it sees a MAC address that it hasn’t logged before it issues an alert. To help identify the new equipment, a portion of the MAC address is sent…

Bash

Bash Snippet: Trim Function

Occasionally I find myself wanting to removing leading and/or trailing occurrences of a character or string from a larger string in bash. A couple common uses are removing quotes, or stripping an unknown number of spaces leading into the data of interest. This can be done pretty easily with other methods such as awk or…

Bash, System Administration

Zombie Process: Killing the Undead

Is your Ubuntu MOTD warning you of a zombie process? Welcome to Ubuntu 11.10 (GNU/Linux 3.0.0-20-server x86_64) * Documentation: https://help.ubuntu.com/11.10/serverguide/C System information as of Thu Jun 28 18:36:57 EDT 2012 System load: 0.0 Processes: 94 Usage of /: 68.2% of 1.79TB Users logged in: 1 Memory usage: 29% IP address for eth0: 10.0.0.10 Swap usage:…

Posts pagination

1 2 NEXT

Search