To investigate the Gquadruplex DNA (G4DNA) structure, the electrochemical biosensor was prepared by modifying the screen-printed graphite electrode (SPE) with the synthesized SBA-N-propylpipyrazine-N-(2-mercaptopropane-1-one) (SBA@NPPNSH) mesoporous structures and Au nanoparticles (AuNPs). The pores of SBA@NPPNSH structures can act as a good platform for the preconcentration of AuNPs. The SH organic groups inside these pores help to increase the electrodeposition of the AuNPs on the surface. Then SH-G4DNA was linked to the modified electrode by an AuNPs–S bond. This platform was used to study the G4DNA/drug interaction. The morphology of the modified electrode was characterized by the scanning electron microscope (SEM). The interaction of different ligands, such as Cephalexine (CEF), with G4DNA was studied in a Tris–HCl buffer as well as in the presence of [Fe (CN)6]3− , a redox label, using the CV method. The CV current decreased in response to increasing the concentration of drug due to the G4DNA/drug interaction. The G-quadruplex formation and the interaction mechanism between G4DNA and the drug were also identified by the circular dichroism (CD) measurements. Studying the selectivity was performed using different double-stranded (ds) DNA sequences.