Up to 5,000 militants are believed to be hiding in the mountains of northern Iraq from where they have staged attacks on military and civilian targets inside Turkey.