Checking exhaust system for leaks

yea I did see someone on the internet that stuck a rag in the pipe. Also rather not feel around on the pipes and get burned.
I do have a smoke machine, how would I make that work? And wouldnt the smoke machine residue gum up the valves?