This is a simple useful script which I learned from “Coding For Penetration Testers” book. Check it out.