Add dirt to textures

Is there a simple way to add dirt to textures (for example in the corner of walls) using opensource software?
Is there any tool that authomatically generates the dirt, or some kind of “template dirt” with alpha channel that can be added to the textures?

You could bake an Ambient Occlusion map in blender

There are some good grime maps available through one of the 3D magazines, can’t remember which though. They were free last I checked.