modify texture on certain parts of extruded shape
My suggestion would be to switch to Object's texture mapping with a box projection on the texture:

Since your model is basically a box, it will project the texture from an invisible box around your object, with discontinuity between each side (though you can use the &quot;Blend&quot; option below the box projection setting if you ever want a seamless effect).
You can then control the stretch and position of each X Y Z axes, either via the mapping node or by targeting an object in the Texture coordinates node and transforming that object around as you wish.

If this isn't enough, the next easy solution is to set back the texture projection to flat, remove the mapping and texture coordinates nodes, and edit the object's UVs so that they match.
In the top bar, click the UV Editing tab. Your faces'UV are most likely attached to each other's neighbor, which is normal, but in your case you will most likely need to create some seams. You can select some edges and hit Ctrl E → Create seam, or in the 3D viewprt select one face on your whose texture is in the wrong way, then press U → unwrap. Then rotate the faces as you need in the UV editor.