Preheat the oven to 350°F (175°C) and grease a baking pan.
Melt the butter in a saucepan over low heat.
Mix in the sugar until fully combined.
Add the eggs one at a time, mixing well after each addition.
Stir in vanilla extract, flour, cocoa powder, and salt.
Fold in the chopped pistachios and shredded coconut.
Pour half of the batter into the greased pan and spread it evenly.
Layer the kunafa dough over the batter, followed by the remaining brownie batter.
Bake for 30-35 minutes or until a toothpick comes out clean.
Let the brownies cool before slicing.