The proinflammatory cytokines of TNF-α and IL-1β have been reported to be increased in gastric mucosal surfaces in people with Helicobacter pylori infection. Accordingly, this study was conducted to investigate the relationship between the presence of H. pylori genes and the serum oscillations of these cytokines. In this study, DNA was first extracted from the stool samples of infected individuals and used as DNA template to investigate the presence of glmM and 16S rRNA genes in PCR. The ELISA assay was employed to examine serum levels of TNF-α and IL-1β cytokines. According to statistical analysis, there was a significant correlation between the presence of glmM and 16S rRNA genes in the stool samples of infected persons and the serum oscillations of TNF-α and IL-1β cytokines. At the end of study and analysis of the data in case group with HPSAg+, 47.6% of the glmM gene and 23.6% of the 16S rRNA gene were positive. In addition, a significant correlation was observed between the presence of glmM and 16S rRNA genes in the stool specimens of infected individuals and the serum levels of TNF-α and IL-1β cytokines (p < 0.05). Considering the results, it can be concluded that fluctuations in the amount of HPSA, TNF-α, and IL-1β in H. pylori infection depend on the presence of glmM and 16S rRNA genes. The presence of glmM and 16S rRNA in the stool sample increases by boosting the response level to stool antigen (HPSA), IL-1β, and TNF-α, suggesting the prognosis of the disease with a bacterial virulence form using stool tests.