Since the discovery of the first exoplanets, those most adequate for life to begin and evolve have been sought. Due to observational bias, however, most of the discovered planets so far are gas giants, precluding their habitability. However, if these hot Jupiters are located in the habitable zones of their host stars, and if rocky moons orbit them, then these moons may be habitable. In this work, we present a model for planetary transit simulation considering the presence of moons around a planet. The moon orbit is considered to be circular and coplanar with the planetary orbit. The other physical and orbital parameters of the star, planet, and moon, can be adjusted in each simulation. It is possible to simulate as many successive transits as desired. Since the presence of spots on the surface of the star may produce a signal similar to that of the presence of a moon, our model also allows for the inclusion of starspots. The goal is to determine the criteria for detectability of moons using photometry with the CoRoT and Kepler telescopes taking into account the stellar activity.