When we talk about brick counterflashing we mean the metal flashing that attaches to the brick and mortar used for walls and fireplace chimneys (figs. 1 and 2) 
Do It Yourself Roof Repair Brick Counterflashing Figure 1

Do It Yourself Roof Repair Brick Counterflashing Figure 2
Its function is to waterproof the metal stepflashing behind it which is woven into the shingles abutting the brick (chimney). Normally there is one piece of āLā shaped stepflashing for each shingle.
Brick counterflashing is a longer piece of metal which steps up with the brick mortar so it can be more easily turned into the mortar joint and fastened. A groove should be cut out of the mortar joint and the metal edge bent into it so it is more secure which enables a better seal for watertightness. Polyurethane sealant is then applied liberally with a caulking gun to make the seal as permanent as possible (figs. 3 and 4) .
Do It Yourself Roof Repair Brick Counterflashing Figure 3

Do It Yourself Roof Repair Brick Counterflashing Figure 4
Inferior sealants will crack loose sooner and be ineffective often causing regular chimney leaks and necessary roofing repairs near the chimney (fig. 5)

Do It Yourself Roof Repair Brick Counterflashing Figure 5