Colorectal cancer (CRC) ranks as the third most prevalent cancer globally, both in terms of diagnoses and cancer-related mortality. Increasing evidence suggests that an imbalance in intestinal flora can contribute to the progression of CRC, and fecal microbiota may serve as potential biomarkers for its screening and diagnosis. Notably, Porphyromonas gingivalis has been identified in the malignant tissues and feces of CRC patients, establishing it as a significant biomarker for early screening, diagnosis, and prognostic assessment of CRC. Current methods for detecting P. gingivalis face numerous challenges, including high costs, complex procedures, and lengthy implementation times. Therefore, developing rapid, highly specific, and sensitive detection methods for P. gingivalis is of great importance. In this study, we utilized the whole-bacterium systematic evolution of ligands by exponential enrichment method to identify highly specific and high-affinity aptamers targeting P. gingivalis through 15 selection cycles. Subsequently, we developed an aptasensor driven by MoS2 nanoflowers, which integrates strand displacement amplification and CRISPR/Cas12a double amplification for sensitive detection of P. gingivalis, achieving a limit of detection of 10 CFU/mL. Using this aptasensor, we evaluated the abundance of P. gingivalis in clinical fecal samples and observed significantly higher levels in the feces of CRC patients compared to healthy individuals, corroborating the results obtained from quantitative polymerase chain reaction. In summary, we developed a highly specific and sensitive aptasensor for the first time, representing a promising new approach for the identification of P. gingivalis, with significant potential for CRC screening and diagnosis.