In some scenarios, you may have a list of employees for a target company and you want to generate a list of e-mail addresses. E-mail addresses can be potentially useful. You might want to use them to perform a phishing attack, or you might want to use them to try and log on to a company's application, such as an e-mail or a corporate portal containing sensitive internal documentation.
Before you can use this recipe, you will want to have a list of names to work with. If you don't have a list of names, you might want to consider first performing an open source intelligence exercise on your target.
The following code will take a file containing a list of names and generate a list of e-mail addresses in varying formats:
import sys if len(sys.argv) !=3: print "usage: %s name.txt email suffix" % (sys.argv[0]) sys.exit(0) for line in open(sys.argv[1]): name = ''.join([c for c in line if c == " " or c.isalpha()]) tokens = name...