I can’t see syphilis, herpes or another STI passing with the type of sex you have described.
We usually see herpes and syphilis being passed by direct skin to skin contact with an area that has the bacteria or virus on it. Given this it would be passed by genital to genital rubbing, anal sex or oral sex.
Please leave a comment to let us know if this answers your question or if you need more information.
For other readers, please feel free to leave a comment, or let us know if this was helpful.