-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6,474 changed files
with
357,355 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
|
||
import glob | ||
import os | ||
import shutil | ||
import sys | ||
import xml.dom.minidom | ||
|
||
#------------------------------------------------------------------------------------------ | ||
# DOM helper functions | ||
#------------------------------------------------------------------------------------------ | ||
def getMatchingChildNodes(node, name): | ||
l = list() | ||
for item in node.childNodes: | ||
if (item.nodeType == node.ELEMENT_NODE) and (item.nodeName == name): | ||
l.append(item) | ||
return l | ||
|
||
def getText(nodelist): | ||
rc = "" | ||
for node in nodelist: | ||
if node.nodeType == node.TEXT_NODE: | ||
rc = rc + node.data | ||
return rc | ||
|
||
#------------------------------------------------------------------------------------------ | ||
def copyFiles(files): | ||
|
||
for item in files: | ||
src = item[0] | ||
dst = item[1] | ||
#print "%s -> %s" % (src, dst) | ||
try: | ||
os.makedirs(os.path.dirname(dst)) | ||
except: | ||
pass | ||
|
||
shutil.copy2(src, dst) | ||
|
||
return True | ||
|
||
#------------------------------------------------------------------------------------------ | ||
def handleDir(dirName, dstDir, root, recursive=False): | ||
|
||
#print "handleDir: ENTER (%s)" % dirName | ||
fileList = list() | ||
fileNodes = getMatchingChildNodes(root, "File") | ||
for fileNode in fileNodes: | ||
name = getText(fileNode.childNodes) | ||
if (fileNode.getAttribute("name")): | ||
newName = fileNode.getAttribute("name") | ||
else: | ||
newName = None | ||
|
||
files = glob.glob("%s/%s" % (dirName, name)) | ||
for item in files: | ||
item = os.path.basename(item) | ||
dstName = newName | ||
if (dstName == None): | ||
dstName = item | ||
if (len(dirName) > 0): | ||
if (os.path.isfile("%s/%s" % (dirName, item))): | ||
fileList.append(("%s/%s" % (dirName, item), "%s/%s/%s" % (dstDir, dirName, dstName))) | ||
else: | ||
if (os.path.isfile(item)): | ||
fileList.append((item, "%s/%s" % (dstDir, dstName))) | ||
|
||
# handle any sub-dirs | ||
if (recursive): | ||
dirNodes = [root] | ||
else: | ||
dirNodes = getMatchingChildNodes(root, "Dir") | ||
for dirNode in dirNodes: | ||
if (recursive): | ||
ignoreNodes = list() | ||
if (len(dirName) > 0): | ||
subDirName = "%s/*" % dirName | ||
else: | ||
subDirName = "*" | ||
else: | ||
ignoreNodes = getMatchingChildNodes(dirNode, "Ignore") | ||
if (len(dirName) > 0): | ||
subDirName = "%s/%s" % (dirName, dirNode.getAttribute("name")) | ||
else: | ||
subDirName = dirNode.getAttribute("name") | ||
|
||
subRecursive = recursive | ||
if (not subRecursive): | ||
rStr = dirNode.getAttribute("recursive") | ||
if ((rStr != None) and (rStr == "true")): | ||
subRecursive = True | ||
#print "RECURSIVE (%s)" % subDirName | ||
|
||
#print "Checking for '%s'" % subDirName | ||
names = glob.glob("%s" % subDirName) | ||
for name in names: | ||
if (os.path.basename(name) == ".svn"): | ||
continue | ||
|
||
# make sure it's not ignored | ||
ignore = False | ||
for ignoreNode in ignoreNodes: | ||
ignoreName = getText(ignoreNode.childNodes) | ||
#print "<----------------Checking '%s' for ignored '%s'" % (os.path.basename(name), ignoreName) | ||
if (ignoreName == os.path.basename(name)): | ||
ignore = True | ||
|
||
if (ignore): | ||
#print "IGNORING %s" % name | ||
continue | ||
|
||
if (os.path.isdir(name)): | ||
dirList = handleDir(os.path.normpath(name), dstDir, dirNode, subRecursive) | ||
for item in dirList: | ||
fileList.append(item) | ||
|
||
return fileList | ||
|
||
#------------------------------------------------------------------------------------------ | ||
def main(argv): | ||
|
||
# rootDir = os.path.dirname(argv[0]) | ||
# if (len(rootDir) == 0): | ||
# rootDir = "." | ||
# xmlName = "%s/replay.xml" % rootDir | ||
|
||
rootDir = "." | ||
xmlName = "%s/replay.xml" % rootDir | ||
|
||
dom1 = xml.dom.minidom.parse(xmlName) | ||
root = dom1.getElementsByTagName("ReplayFiles") | ||
|
||
dstDir = None | ||
while (dstDir == None): | ||
dstDir = os.path.normpath("%s/../ReplayDisk" % rootDir) | ||
sys.stdout.write("Enter the replay destination directory [%s]:" % dstDir) | ||
dir = sys.stdin.readline().rstrip('\r\n') | ||
if (len(dir) > 0): | ||
dstDir = dir | ||
|
||
fileCopyList = list() | ||
|
||
rootList = handleDir(rootDir, dstDir, root[0]) | ||
for item in rootList: | ||
fileCopyList.append(item) | ||
|
||
if (not copyFiles(fileCopyList)): | ||
return False | ||
|
||
print "\n-----------------------------" | ||
print "Replay disk creation complete" | ||
print "-----------------------------" | ||
return True | ||
|
||
#------------------------------------------------------------------------------------------ | ||
|
||
if __name__ == '__main__': | ||
if (main(sys.argv) != True): | ||
sys.exit(-1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0"?> | ||
<t:config id="0" | ||
name="Fuzzbunch" | ||
version="3.5.1" | ||
configversion="3.5.1.0" | ||
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' | ||
xmlns:t='tc0'> | ||
|
||
<t:banner value="FuZZbuNch" /> | ||
|
||
<t:parameter name="NetworkTimeout" | ||
description="Network timeout (in seconds)" | ||
type="U16" | ||
default="60"/> | ||
|
||
<t:parameter name="ResourcesDir" | ||
description="Absolute path of the Resources Directory" | ||
type="String" | ||
default="D:\DSZOPSDISK\Resources"/> | ||
|
||
<t:parameter name="LogDir" | ||
description="Absolute path of an Initial Log Directory" | ||
type="String" | ||
default="D:\logs"/> | ||
|
||
<t:parameter name="Color" | ||
description="Enable or disable color within Fuzzbunch" | ||
type="Boolean" | ||
default="True"/> | ||
|
||
<t:parameter name="ShowHiddenParameters" | ||
description="Enable showing hidden XML parameters" | ||
type="Boolean" | ||
default="False"/> | ||
|
||
<t:redirection value="on" /> | ||
|
||
<t:runmode value="interactive" /> | ||
|
||
<t:autorun value="on"> | ||
<t:category name="ImplantConfig"> | ||
<t:command value="prompt confirm"/> | ||
<t:command value="execute"/> | ||
</t:category> | ||
<t:category name="Exploit"> | ||
<t:command value="apply"/> | ||
<t:command value="touch all" msg="Running Exploit Touches"/> | ||
<t:command value="prompt confirm"/> | ||
<t:command value="execute"/> | ||
</t:category> | ||
<t:category name="Special"> | ||
<t:command value="apply"/> | ||
<t:command value="touch all" msg="Running Exploit Touches"/> | ||
<t:command value="prompt confirm"/> | ||
<t:command value="execute"/> | ||
</t:category> | ||
<t:category name="Payload"> | ||
<t:command value="apply"/> | ||
<t:command value="prompt confirm"/> | ||
<t:command value="execute"/> | ||
</t:category> | ||
</t:autorun> | ||
</t:config> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import os | ||
import re | ||
import sys | ||
import time | ||
|
||
|
||
port = "" | ||
while (port == ""): | ||
port = raw_input("Please enter the dump port: ") | ||
try: | ||
port = int(port) | ||
break | ||
except: | ||
port = "" | ||
pass | ||
|
||
logDir = raw_input("Please enter the target log directory") | ||
|
||
logFile = "%s/Dump-%d.txt" % (logDir, port) | ||
|
||
cmd = "java -cp Resources/Dsz/Tools/java-j2se_1.5/FullThreadDump.jar FullThreadDump localhost:%d > %s" % (port, logFile) | ||
|
||
os.system(cmd) | ||
|
||
sys.exit(0) |
Oops, something went wrong.