Turkey has attacked Kurdish targets in northern Syria and Iraq in retaliation for Istanbul bombing that killed six people and injured more than 80.