We propose a probabilistic scheme to prepare a maximally entangled state between a pair of two-level atoms inside a leaking cavity, without requiring precise time-controlling of the system evolution and initial atomic state. We show that the steady state of this dissipative system is a mixture of two parts: either the atoms being in their ground state or in a maximally entangled one. Then, by applying a weak probe field on the cavity mode we are able to distinguish those states without disturbing the atomic system, i.e., performing a quantum nondemolition measurement via the cavity transmission. In this scheme, one has nonzero cavity transmission only when the atomic system is in an entangled state so that a single click in the detector is enough to ensure that the atoms are in an maximally entangled state. Our scheme relies on an interference effect as it happens in electromagnetically induced transparency phenomenon so that it works out even in the limit of decay rate of the cavity mode much stronger than the atom-field coupling.The preparation and manipulation of entangled states have attracted much interest in last years, as they do not have a classical counterpart. These states are key ingredients for quantum nonlocality tests [1] and play an important role in achieving tasks of quantum computation and communication [2], such as quantum cryptography [3], computers [4] and teleportation [5]. Entangled states can be prepared either directly by coherent control of unitary dynamics [6], as consequence of measurements [7], or even using a dissipative process [8]. Recently, preparing quantum systems in an entangled state by dissipative schemes has been actively studied since the noise, which is always present in the experiments, can be used as a resource for entanglement generation, avoiding the usual destructive effect on the quantum system coherence owing to the system-environment interaction.On the other hand, entanglement quantifiers, such as concurrence [9] and negativity [10], are not physical observables, i.e., there are no directly measurable observables, until now, to describe the entanglement of a given arbitrary quantum state. In general, it is necessary to perform the quantum state tomography to calculate these entanglement quantifiers, perturbing the state of the system, although some interesting methods have been recently proposed to construct direct observables related to entanglement [11][12][13][14][15]. Whereas the authors in Refs. [11][12][13][14] can determine the entanglement when few copies of the quantum system are available, in Ref.[15] the authors do this by introducing a probe atom that performs a quantum nondemolition measurement.Here we propose a probabilistic scheme to prepare a maximally entangled state between a pair of two-level atoms inside a leaking cavity, without requiring precise time-controlling of the system evolution or strong atomfield coupling. The steady state (ρ ss ) of this dissipative process is a mixed state with two parts: one of them describing the possibility of h...