Many active substances in nature are in complex environments, such as animal populations passing through the jungles, microorganisms migrating in the soil, and bacteria designed to sense the porous environment of tumors. The behavior of active substances in complex environments is a subject worth exploring, because they have great application significance in biophysics, medical engineering, and industrial fields. In this work, we use active dumbbells to represent bacteria and other active substances with shape anisotropy, and use Langevin dynamics simulation to study their permeation behaviors in finite porous media. We find that under low temperature and appropriate activity, active dumbbells can aggregate inside and outside the medium and form four stable aggregation structures, they being hollow giant aggregation, hollow aggregation in medium, dense giant aggregation, and dense aggregation in medium. The aggregation is caused by the small space of the medium region, and the geometric trap is easily formed when the active dumbbells meet in the medium. Unlike motility-induced phase separation, the formation of such an aggregation relies on the assistance of obstacles. The persistence of directional motion determines the degree of aggregation of active dumbbells. There are significant differences among the four aggregation structures in density distribution, polar order parameter, and thermodynamic temperature inside and outside the medium. Under certain conditions, the disorder of medium arrangement can promote the aggregation behavior of active dumbbells, and the increase of lattice constant makes it easier for active dumbbells to form dense aggregation. Our research findings contribute to a more in-depth understanding of the life activities of active substances in complex environments, thus providing new ideas for designing microfluidic devices, drug delivery and other medical operations.