Technically, you can get syphilis through contact skin to skin if those lesions were produced by syphilis. If you know that guy you can ask him to test for syphilis. If you don't know him and think you won't see him anymore, it would be interesting to test for syphilis, after 3-6 weeks. If you get a negative result, it would be interesting to test again after 3 months, as there are people that take longer to show a positive result.