Boolean networks are conventionally used to represent and simulate gene regulatory networks. In the analysis of the dynamic of a Boolean network, the attractors are the objects of a special attention. In this work, we propose a novel approach based on Answer Set Programming (ASP) to express Boolean networks and simulate the dynamics of such networks. Our work focuses on the identification of the attractors, it relies on the exhaustive enumeration of all the attractors of synchronous and asynchronous Boolean networks. We applied and evaluated the proposed approach on real biological networks, and the obtained results indicate that this novel approach is promising.