Posts

Where's the Fun in That?

Any solution starts with a problem. In my case, that problem is how do I find duplicate files in a directory on a Linux server? “Easy”, you may say, “Just write a python script”, or “There’s an app for that”. Fair enough, but where’s the fun in that? Why not challenge yourself? Let’s do it in a single bash line!! Here’s the beautiful, and ugly mess I came up with: find /root/ -type f -exec md5sum '{}' \; > md5.txt && cat md5.txt | sort -u -k1 | cut -d' ' -f1| uniq -c | awk 'int($1)>1' | sort -rn | awk '{print $2}' > 2uniq.txt && md5s=$(cat 2uniq.txt) && for md5 in $md5s; do grep $md5 md5.txt; done >> matches.txt Let’s break the command, and make since of it, but before that a few bash basics. A pipe | takes the results from a previous command and runs it against another command. The && allow for a new series of bash commands to run on the same line. The highlighted section performs a find command aga...

Paul's Security Weekly Sysmon: Gaining Visibility Into Your Enterprise

CloudTrail and You

Image
  Introduction Traditional cyber or IT security folks have difficulty with the Cloud. The best way to remove the fear of monitoring the Cloud is to use method that we’re used to, which is to think of it an application (please be kind in the comments), such as Apache, SQL, or IIS. For years we have aggregating application logs and ingesting them into logging tools. With regards of Amazon Web Services AWS, one event sources we want to monitor is called CloudTrail. CloudTrail is: “AWS CloudTrail is a service that enables governance, compliance, operational auditing, and risk auditing of your AWS account. With CloudTrail, you can log, continuously monitor, and retain account activity related to actions across your AWS infrastructure. CloudTrail provides event history of your AWS account activity, including actions taken through the AWS Management Console, AWS SDKs, command line tools, and other AWS services. This event history simplifies security analysis, resource change tra...