Preheat oven to 350 degrees. Sift the flour, baking soda, and salt into a medium bowl and set aside.
Place the cocoa in a medium mixing bowl. Add the ½ cup lukewarm water, and whisk to combine; set aside to cool. In a large liquid measuring cup, add the buttermilk, the ½ cup water, and the vanilla. Beat together the eggs in a small bowl and set aside.
In a large mixing bowl, cream the butter on medium speed using a hand mixer or stand mixer fitted with a paddle attachment until the butter is smooth and light in color (2-3 minutes). Reduce to low speed and add the granulated and brown sugars. Stop the mixer and scrape down the sides of the bowl as needed. The mixture will appear sandy. Increase to medium speed, cream until the mixture is light in color and fluffy in texture (about 4 to 5 minutes).
With the mixer on medium speed, add the eggs slowly and add the sour cream. Continue to cream, scraping the sides of the bowl as needed, until the mixture is smooth and velvety. Add in the cocoa mixture and mix just until combined.
Using a spoon or spatula, stir in one-fourth of the flour mixture, followed by one-third of the buttermilk mixture. Repeat these steps, alternating dry and liquid. Mix until fully incorporated.
Place your cupcake liners into your muffin tin and pour the batter into each cupcake liner, about ⅔ of the way full. Bake for 10-15 minutes. Check with a toothpick to ensure the cupcakes are done. Allow the cupcakes to cool in the pan for 10-15 minutes.
FOR THE FROSTING
Place your softened butter in a large mixing bowl. Using a hand mixer or stand mixer with a paddle attachment, cream the butter for 5-7 minutes until light and fluffy in texture and pale in color.
Add the powdered sugar in small batches (about a cup at a time), mixing between each addition.
Mix in the vanilla extract and peppermint extract and check the consistency of the frosting. If it’s too thick, add the milk or heavy until the desired consistency is reached.
When your cupcakes are completely cooled, fill your piping bag with frosting and frost your cupcakes. Crush up your candy canes and sprinkle them on top. Enjoy!