Israel targeted "military sites" in Gaza after four rockets were fired from the Palestinian enclave into Israeli territory.