Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion content/blog/2009-12-04-404-pages-in-wordpress.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ title: 404 Pages in WordPress
tags: [wordpress]
slug: "404-pages-in-wordpress"
date: "04 Dec 2009"
summary: This article provides two possible reasons for receiving a 404 error in WordPress and explains how to resolve the issues.
---

If you are receiving a 404 in WordPress, there are 2 possible causes:

1. .htaccess
This file is located in your web root directory. Change the permissions to 666 then modify your PermaLink settings and save them. This will rewrite your .htaccess for you. Be sure to change it back to 440 when done.
1. apached.conf
In the apache config for your web site, make sure AllowOverides is set to All.
In the apache config for your web site, make sure AllowOverides is set to All.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tags:
- tools
date: "04 Dec 2009"
slug: "create-a-git-archive-in-non-empty-folder"
summary: A guide on how to create a Git archive in a non-empty folder by initializing a Git repository, adding a remote, fetching the remote repository, creating a local branch, and checking out the local branch.
---

```bash
Expand All @@ -13,4 +14,4 @@ git remote add origin remote_machine:~brentg/my_setup.git
git fetch
git branch master origin/master
git checkout master
```
```
3 changes: 2 additions & 1 deletion content/blog/2010-08-03-mysql-and-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: MySQL and Indexes
tags: [mysql, sysadmin, infrastructure]
slug: "mysql-and-indexes"
date: "03 Aug 2010"
summary: Indexes can drastically improve the performance of queries on large tables. Adding indexes to the sha1 and md5 columns of a table with over 1 million rows reduced the query runtime from 1 minute and 47 seconds to 0 seconds.
---
So what happens when you have over 1 million rows in a table and you try to do a lookup?

Expand Down Expand Up @@ -63,4 +64,4 @@ mysql> select hex(sha1), filename, productcode, oscode from file where sha1 = un
8 rows in set (0.00 sec)
```

Indexing. It works ;-)
Indexing. It works ;-)
4 changes: 3 additions & 1 deletion content/blog/2010-08-03-mysql-loading-data-from-csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ title: MySQL - Loading Data from CSV
tags: [infrastructure, mysql]
slug: "mysql-loading-data-from-csv"
date: "03 Aug 2010"
summary: This article explains how to load data from a CSV file into a MySQL table using the LOAD DATA LOCAL INFILE command.
---

I have a 1.86 GB CSV file which I want to put into a table in MySQL. Originally I started by using VIM to modify the source data to add "INSERT INTO ..." statements in front of each line. This approach quickly turned kludgy and took a painfully long time to complete.

Solution? MySQL includes built in support for doing this exact thing. Here is what I did, tailor to your needs:
Expand All @@ -26,4 +28,4 @@ What we are doing is loading the local file NSRLFile.txt. This file is in my pre

Last, we tell MySQL what fields should map to which columns. In my case, I wanted to dehex (or convert hex to binary) on all hash values. by using the @ symbol, I created three variables named @Vsha1, @Vmd51, and @Vcrc. I used a capital V for readability only, you can use almost any name. To perform the actual conversion, I supplied the variable to the dehex function and used the SET clause to assign that new value to the column I wanted to store the value in.

That's it! Super simple. Feel free to email me with questions...
That's it! Super simple. Feel free to email me with questions...
4 changes: 3 additions & 1 deletion content/blog/2010-08-08-mysql-and-efficient-data-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ title: MySQL and Efficient Data Encoding
tags: [mysql, sysadmin]
date: "08 Aug 2010"
slug: "mysql-and-efficient-data-encoding"
summary: This article discusses how to store data efficiently in MySQL to avoid overwhelming the server. The author provides the example of storing hashes for files in the National Software Reference List, and shows how converting the hashes from a hexadecimal string to a binary value can save 50% of the storage space.
---

As I've been working to expose the National Software Reference List via a new webservice, I've had to find ways to store data efficiently to avoid nuking my server. One of the biggest issues was the shear size of the database.

Each file record has 2 hashes, a SHA-1 and a MD5 hex-encoded value. Currently, there are 58,272,836 files hashed as part of the NSRL effort. This means 58,272,836 rows of data and 116,545,672 hash values.
Expand All @@ -19,4 +21,4 @@ By storing the hash as a binary object, we realize IMMENSE space savings. Warnin
+ 288 bits / 576 bits = 50% Savings</li>
+ 36 B * 58,272,836 Records = 2,097,822,096 B = 2.1GB</li>

And there you have it, we reduced our storage utilization by 50% down to 2.1GB. Now that's efficient!
And there you have it, we reduced our storage utilization by 50% down to 2.1GB. Now that's efficient!
3 changes: 2 additions & 1 deletion content/blog/2010-08-12-next-web-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tags:
- XML
date: "12 Aug 2010"
slug: next-web-service
summary: The author is planning to create a new web service that will munge and expose the Microsoft Update list as an XML feed for powering internal patch management tools.
---

So after publishing the NRSL webservice http://brooksgarrett.com:81/json/SHA1_HASH (No longer functional), I'm looking for a new project. I'm thinking of munging and exposing the Microsoft Update list as a XML feed for powering internal patch management tools. I'll post more when I get it implemented.
So after publishing the NRSL webservice http://brooksgarrett.com:81/json/SHA1_HASH (No longer functional), I'm looking for a new project. I'm thinking of munging and exposing the Microsoft Update list as a XML feed for powering internal patch management tools. I'll post more when I get it implemented.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ title: Universal USB Installer – Easy as 1 2 3
tags:
- tools
date: "12 Aug 2010"
slug: universal-usb-installer-easy-as-1-2-3
slug: universal-usb-installer-easy-as-1-2-3"
summary: This site is a great reference for installing Linux onto a bootable flash drive. I highly recommend using the Multiboot ISO Loader.
---
<a href="http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/">Universal USB Installer – Easy as 1 2 3 | USB Pen Drive Linux</a>.

This site is a great reference for installing Linux onto a bootable flash drive. I highly recommend using the Multiboot ISO Loader. I use it to have an Ubuntu installer and DSL on the same jump drive.
<a href="http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/">Universal USB Installer – Easy as 1 2 3 | USB Pen Drive Linux</a>.
3 changes: 2 additions & 1 deletion content/blog/2011-01-04-getting-disk_stat-working-in-sift.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Getting disk_stat Working in SIFT
tags: [forensics, volume analysis]
date: "04 Jan 2011"
slug: "getting-disk_stat-working-in-sift"
summary: This article provides a solution to an error encountered when running disk_stat in the SIFT (SANS Investigative Forensic Toolkit) Workstation VMWare appliance. The error occurs because the libssl.so.7 and libcrypto.so libraries are missing. The solution is to create symbolic links in /usr/lib pointing to these libraries.
---

SANS publishes the SIFT (SANS Investigative Forensic Toolkit) Workstation as a VMWare appliance.
Expand All @@ -27,4 +28,4 @@ sansforensics@SIFT-Workstation:/usr/lib$ sudo ln -s libssl.so libssl.so.7
sansforensics@SIFT-Workstation:/usr/lib$ sudo ln -s libcrypto.so libcrypto.so.7
```

All done! disk_stat will now properly detect HPA's on attached drives. Enojy!
All done! disk_stat will now properly detect HPA's on attached drives. Enojy!
3 changes: 2 additions & 1 deletion content/blog/2011-02-08-wtf-time-give-me-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tags:
- tools
- forensics
date: "08 Feb 2011"
summary: Bash and GNU both have a time command, but they have different options. When using the time command with the -f option to specify the format of the output, you need to use the full path to the GNU time command (/usr/bin/time).
---
I'm looking at the computational cost of computing various hashes. Naturally, I
want to collect run time statistics on each hash command and collect this
Expand Down Expand Up @@ -44,4 +45,4 @@ brooks@saosin:~$ /usr/bin/time -f %e,%S,%U md5sum .viminfo
Better!

You can also use -a -o filename to specify where to put that csv output across
multiple runs.
multiple runs.
4 changes: 3 additions & 1 deletion content/blog/2011-04-25-amazing-poem-about-legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ title: Amazing Poem About Legacy
tags: [poetry]
date: "25 Apr 2011"
slug: amazing-poem-about-legacy
summary: "The Bridge Builder" is an inspiring poem about a man who builds a bridge not for his own benefit, but for the benefit of those who will come after him. It is a reminder that we should always be mindful of the impact our actions will have on future generations.
---

**The Bridge Builder**

```text
Expand Down Expand Up @@ -35,4 +37,4 @@ slug: amazing-poem-about-legacy
Good friend, I am building this bridge for him."
```

By Will Allen Dromgoole
By Will Allen Dromgoole
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,6 @@ tags:
- HTML5
date: "07 Oct 2011"
slug: "html5-input-validation-is-not-sanitization"
summary: HTML5 input types offer client-side validation, but attackers can bypass this validation and submit malicious input. Server-side data validation and sanitization remain essential for security.
---
One of the hyped features of HTML5 is the ability to specify the input "type"
of an input on a form as one of several new options:

+ color
+ date
+ datetime
+ datetime-local
+ month
+ week
+ time
+ email
+ number
+ range
+ search
+ tel
+ url

The implementation of this new feature couldn't be easier, simply specify the
"type" attribute of your input field and let the browser handle the rest. For
example, by specifying an input type of "email", Chrome will validate the input
to ensure it is a validly formed email address. In Safari on iOS devices, the
virtual keyboard will automatically change to be more email address friendly
(by adding the @ sign and .com buttons).

All of this functionality comes with no additional scripting by the developer.
For convenience, this is exciting news. User input can now be validated client
side to ensure users are actually putting an email in that field and not a phone
number. For security though, there is absolutely no added benefit. Much as
attackers have been substituting values for years, so they will continue.
The new input types do not prevent an attacker from submitting values of their
choosing via an intercepting proxy.

The old adage still holds true, "If the user can access it, they can abuse it."
Use these new input types for helping good users submit accurate data on the
first attempt, but continue server side data validation and sanitization to
prevent attackers from owning your application.
One of the hyped features of HTML5 is the ability to specify the input "type" of an input on a form as one of several new options. This provides client-side validation, ensuring users enter valid data. However, this validation does not prevent attackers from submitting malicious input. Server-side data validation and sanitization are still necessary to protect against attacks.
3 changes: 2 additions & 1 deletion content/blog/2013-11-23-roughhousing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tags: [discovered]
date: "23 Nov 2014"
draft: false
slug: "roughhousing"
summary: The author explains the benefits of roughhousing with children, such as forming a trust bond and gaining a better ability to read and understand them. While playful physical contact may seem aggressive, it can actually be beneficial, as long as parents can distinguish between playful and serious resistance.
---

![Family Roughhousing](http://www.gscdn.org/library/cms/28/19128.jpg)
Expand All @@ -18,4 +19,4 @@ To clarify I'm not injuring him or punishing him but instead engaging in old-fas

I believe most of the benefits the video below describes are real from personal experience and add on that not only do you form trust bonds but you gain a very strong ability to read and understand your child. So go; boldly body slam that kiddo onto the couch!

<iframe width="560" height="315" src="//www.youtube.com/embed/m0Lerbebrdc" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/m0Lerbebrdc" frameborder="0" allowfullscreen></iframe>
3 changes: 2 additions & 1 deletion content/blog/2013-12-28-remap-keys-in-ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tags: [technology, howto, linux]
date: "28 Dec 2013"
draft: false
slug: "remap-keys-in-ubuntu"
summary: This article explains how to remap the Caps Lock key to the Escape key in Ubuntu.
---

![A Keyboard](http://data.brooksgarrett.com/images/keyboard.jpg)
Expand Down Expand Up @@ -35,4 +36,4 @@ xmodmap ~/.Xmodmap

1. Done

You now have remapped your Escape down to the Caps Lock. One pinky finger closer to total world domination!
You now have remapped your Escape down to the Caps Lock. One pinky finger closer to total world domination!
4 changes: 2 additions & 2 deletions content/blog/2014-01-31-intro-to-podcast.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ tags: [technology, howto, linux]
date: "31 Jan 2014"
draft: false
slug: "intro-to-podcast"

summary: The author wants to start a podcast about InfoSec.
---

![An image depicting a podcast](http://www.arktimes.com/binary/dc71/1307133648-podcast.png)

I came about in the InfoSec profession with the likes of [@SpaceRogue](http://twitter.com/spacerog) and [@ThisIsHNN](http://twitter.com/thisishnn) bringing me weekly digestibles of all the things happening in the world of InfoSec. My team would huddle in the forensics lab each Friday and bear witness to a painful ridicule or Adobe each and every week as we heard all about the latest vulns and exploits. Oh, and who would ever forget the running commentary that was the [Summer of Lulz](http://en.wikipedia.org/wiki/LulzSec).

I miss that. I don't think anyone really has a solid rundown on the weekly events in InfoSec and thus I want to start one. This page will document my evolving attempt to launch a podcast. Caveat emptor, it's likely to fail but will be a solid journey.
I miss that. I don't think anyone really has a solid rundown on the weekly events in InfoSec and thus I want to start one. This page will document my evolving attempt to launch a podcast. Caveat emptor, it's likely to fail but will be a solid journey.
3 changes: 2 additions & 1 deletion content/blog/2014-09-16-jekyll-github-travisci-s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tags: [sysadmin]
date: "16 Sep 2014"
draft: false
slug: "jekyll-github-travisci-s3"
summary: This blog post describes a workflow for building and deploying a static site using Jekyll, GitHub, TravisCI, and S3. The workflow involves writing content in markdown, versioning and managing the content with Git on GitHub, and using TravisCI to build and deploy the site to S3 when new content is pushed to GitHub. The post includes instructions on setting up the necessary files and configurations for TravisCI, Jekyll, Ruby, and S3.
---

For a while now I've been exclusively using [Jekyll][jekyll] to publish my site. At first I started with basic [Jekyll][jekyll] running on [DigitalOcean][do]. This worked well but meant I needed to SSH to a server when I wanted to post content. Not _really_ the best requirement for a seamless workflow but it worked for a while. Then I started using Git and GitHub to manage the content as a repository. A bit of php later and I had a post-commit hook in GitHub to notify the [DigitalOcean][do] server that new content was ready. This was better but broke all the time for random reasons.
Expand Down Expand Up @@ -89,4 +90,4 @@ task :default => [ :clean, :build ]
end
```

My Rakefile contains tasks for cleaning up old artifacts, building the site, and deploying the site via s3_website for local testing. Travis calls the :default task by, well, default so I have configured that task to be only a clean and build. This lets Travis handle the deploy independently.
My Rakefile contains tasks for cleaning up old artifacts, building the site, and deploying the site via s3_website for local testing. Travis calls the :default task by, well, default so I have configured that task to be only a clean and build. This lets Travis handle the deploy independently.
3 changes: 2 additions & 1 deletion content/blog/2014-09-16-justgetflux.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ tags: [sysadmin]
date: "16 Sep 2014"
draft: false
slug: "justgetflux"
summary: Flux is a program that adjusts your screen temperature to match ambient light levels, making it more enjoyable to use your computer at night. It is available for Linux, Mac, and Windows.
---

A friend of mine recommended I try out [Flux](https://justgetflux.com) and I'm ever glad I did. The basic premise is that Flux monitors the time of day and adjusts your screen temperature (or hue) to match ambient light levels. The result is a much more enjoyable session at night. I'm sitting in my living room with only a single lamp on and the glow of the light bulb on the keyboard is a near identical match to the color setting suggested by Flux.

To get it working on my Ubuntu laptop I had to do some magic. First install FluxGUI per the instructions and PPA [here](https://justgetflux.com/linux.html). Next, copy the [64 bit binary](https://justgetflux.com/linux/xflux64.tgz) (a [32 bit](https://justgetflux.com/linux/xflux-pre.tgz) is available as well) and extract. Copy the resulting xflux binary to /usr/bin/xflux (yes, overwrite what is there.)

Now sit back and enjoy the pleasant experience!
Now sit back and enjoy the pleasant experience!
3 changes: 2 additions & 1 deletion content/blog/2014-12-29-cordova-browser-on-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tags: [mobile]
date: "29 Dec 2014"
draft: false
slug: "cordova-browser-on-linux"
summary: Running Cordova browser platform on Linux requires a modification to the script used to launch the browser.
---

I'm working on a new mobile application which, of course, means [Cordova](http://cordova.apache.org/). Recently Cordova added the "browser" platform so you can test your application right on the desktop with no hackery required.
Expand All @@ -25,4 +26,4 @@ I, however, am on Linux and when I first tried to run on the browser platform I

Make sure to modify the path to Chrome if needed.

_UPDATE_: I've since discovered you can pull an updated script from [Cordova's GitHub](https://github.com/apache/cordova-browser/blob/master/bin/templates/project/cordova/run).
_UPDATE_: I've since discovered you can pull an updated script from [Cordova's GitHub](https://github.com/apache/cordova-browser/blob/master/bin/templates/project/cordova/run).
3 changes: 2 additions & 1 deletion content/blog/2015-01-05-diffie-hellman-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tags: [vpn, technical, reference]
date: "05 Jan 2015"
draft: false
slug: "diffie-hellman-groups"
summary: This article clarifies the relationship between the bit strength and group number for Diffie-Hellman groups used in VPNs. It provides a table that maps group numbers to bit strengths, including groups 1, 2, 5, 14, 15, 19, and 20.
---

I've been working with VPNs quite a bit recently and keep running into issues where the other party uses the bit strength and group number for Diffie-Hellman groups interchangeably. Here is a quick reference list:
Expand All @@ -14,4 +15,4 @@ I've been working with VPNs quite a bit recently and keep running into issues wh
+ Group 14: 2048-bit
+ Group 15: 3072-bit
+ Group 19: 256-bit EC
+ Group 20: 384-bit EC
+ Group 20: 384-bit EC
3 changes: 2 additions & 1 deletion content/blog/2015-01-21-chuck-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ tags: [sysadmin, tech, linux, fun]
date: "21 Jan 2015"
draft: false
slug: "chuck-cli"
summary: This blog post describes how to install and use the Chuck Norris Joke API as a command-line tool.
---

My good friend [Daniel Miessler](http://danielmiessler.com/) dropped a [tweet](https://twitter.com/DanielMiessler/status/555880967785545728) the other day talking about the Chuck Norris Database API. Now as soon as I heard there is an API available I had to get it into my shell for those days when humor is all that keeps me from rm -rf / the world.
Expand All @@ -17,4 +18,4 @@ alias chuck="curl -s http://api.icndb.com/jokes/random/ | egrep -oh '\"joke\": \
➜ ~ chuck
Chuck Norris doesn't use GUI, he prefers COMMAND line.

```
```
Loading