EDIT (2018-11-12): Marcel Dopita wrote a post How to restore modified iOS 12 backup which deals with iOS 12. Give that a read if you need to do this procedure for iOS 12.
So you want to replace one or more files inside an iOS 11 device backup made using iTunes, but you
don’t want to pay for a program that does it would rather do this by hand, as it isn’t that hard and you don’t mind getting your hands dirty. So here is the step-by-step guide to replacing files in an iTunes created device backup.