commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Output contains also garbage (text parts from netstat's output) but it's good enough for quick check who's overloading your server.
I have found that base64 encoded webshells and the like contain lots of data but hardly any newlines due to the formatting of their payloads. Checking the "width" will not catch everything, but then again, this is a fuzzy problem that relies on broad generalizations and heuristics that are never going to be perfect.
What I have done is set an arbitrary threshold (200 for example) and compare the values that are produced by this script, only displaying those above the threshold. One webshell I tested this on scored 5000+ so I know it works for at least one piece of malware.
Usefull if you only want to see the package names, or if you want to use them in a script.
On the Mac, the 'ls' function can sort based on month/day/time, but seems to lack ability to filter on the Year field (#9 among the long listed fields). The sorted list continuously increases the 'START' year for the most recently accessed set of files. The final month printed will be the highest month that appeared in that START year. The command does its magic on the current directory, and suitably discards all entries that are themselves directories. If you expect files dating prior to 2002, change the START year accordingly.
This version also attaches to new processes forked by the parent apache process. That way you can trace all current and *future* apache processes.
On wired connections set 'eth0' instead of 'wlan0'
Replace \-dev with whatever you wanna search for
completely remove those packages that leave files in debian / ubuntu marked with rc and not removed completely with traditional tools
It'll print the file names preserving the spaces in their names and adding new line after every new filename.
I wrote this to quickly find out how many files in any directory is owned by a particular user. This can be extended using pipe and grep to do much more.
Also removes translator comments. You can remove the header by omitting --keep-header, but if your msgids contain non-ASCII characters you will need the header to specify a suitable charset.