index int64 0 50.7k | project_path stringclasses 279
values | completion_path stringlengths 57 199 | signature_postion stringlengths 3 11 | class_position stringlengths 3 11 | function_name stringlengths 1 62 | class_name stringlengths 0 55 | body_position stringlengths 3 11 | body_position_with_comments stringlengths 3 11 | masked_class stringlengths 14 8.32k | masked_class_with_comment stringlengths 14 8.32k | func_body stringlengths 9 6.72k | func_body_with_comment stringlengths 9 6.72k | len_func_body int64 1 643 | len_input int64 10 2.02k | len_output int64 4 1.9k | total int64 20 2.05k | file_code stringlengths 14 442k | file_code_with_comment stringlengths 14 442k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
487 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/lib/memorpy/Address.py | 32,33 | 23,112 | read | Address | 33,48 | 33,48 | class Address(object):
""" this class is used to have better representation of memory addresses """
def __init__(self, value, process, default_type = 'uint'):
self.value = int(value)
self.process = process
self.default_type = default_type
self.symbolic_name = None
def read(... | class Address(object):
""" this class is used to have better representation of memory addresses """
def __init__(self, value, process, default_type = 'uint'):
self.value = int(value)
self.process = process
self.default_type = default_type
self.symbolic_name = None
def read(... | if maxlen is None:
try:
int(type)
maxlen = int(type)
type = None
except:
pass
if not type:
type = self.default_type
if not maxlen:
return self.process.read(self.value, type=type, erro... | if maxlen is None:
try:
int(type)
maxlen = int(type)
type = None
except:
pass
if not type:
type = self.default_type
if not maxlen:
return self.process.read(self.value, type=type, erro... | 33 | 726 | 130 | 856 | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... |
488 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/lib/memorpy/BaseProcess.py | 59,60 | 14,67 | write | BaseProcess | 60,67 | 60,67 | class BaseProcess(object):
def __init__(self, *args, **kwargs):
""" Create and Open a process object from its pid or from its name """
self.h_process = None
self.pid = None
self.isProcessOpen = False
self.buffer = None
self.bufferlen = 0
def __del__(self):
... | class BaseProcess(object):
def __init__(self, *args, **kwargs):
""" Create and Open a process object from its pid or from its name """
self.h_process = None
self.pid = None
self.isProcessOpen = False
self.buffer = None
self.bufferlen = 0
def __del__(self):
... | if type != 'bytes':
s, l = type_unpack(type)
return self.write_bytes(int(address), struct.pack(s, data))
else:
return self.write_bytes(int(address), data)
| if type != 'bytes':
s, l = type_unpack(type)
return self.write_bytes(int(address), struct.pack(s, data))
else:
return self.write_bytes(int(address), data)
| 16 | 423 | 72 | 495 | #!/usr/bin/env python
# -*- coding: UTF8 -*-
import struct
from .utils import *
""" Base class for process not linked to any platform """
class ProcessException(Exception):
pass
class BaseProcess(object):
def __init__(self, *args, **kwargs):
""" Create and Open a process object from its pid or fr... | #!/usr/bin/env python
# -*- coding: UTF8 -*-
import struct
from .utils import *
""" Base class for process not linked to any platform """
class ProcessException(Exception):
pass
class BaseProcess(object):
def __init__(self, *args, **kwargs):
""" Create and Open a process object from its pid or fr... |
489 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/lib/memorpy/Locator.py | 41,42 | 24,97 | feed | Locator | 42,78 | 42,78 | class Locator(object):
"""
take a memoryworker and a type to search
then you can feed the locator with values and it will reduce the addresses possibilities
"""
def __init__(self, mw, type = 'unknown', start = None, end = None):
self.mw = mw
self.type = type
... | class Locator(object):
"""
take a memoryworker and a type to search
then you can feed the locator with values and it will reduce the addresses possibilities
"""
def __init__(self, mw, type = 'unknown', start = None, end = None):
self.mw = mw
self.type = type
... | self.last_value = value
new_iter = copy.copy(self.last_iteration)
if self.type == 'unknown':
all_types = ['uint',
'int',
'long',
'ulong',
'float',
'double',
'short',
'ushort']
else:
... | self.last_value = value
new_iter = copy.copy(self.last_iteration)
if self.type == 'unknown':
all_types = ['uint',
'int',
'long',
'ulong',
'float',
'double',
'short',
'ushort']
else:
... | 90 | 355 | 359 | 714 | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... |
491 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/lib/memorpy/SunProcess.py | 109,110 | 39,168 | iter_region | SunProcess | 117,153 | 110,153 | class SunProcess(BaseProcess):
def __init__(self, pid=None, name=None, debug=True, ptrace=None):
''' Create and Open a process object from its pid or from its name '''
super(SunProcess, self).__init__()
self.pid = int(pid)
self.pas = None
self.writable = False
if name... | class SunProcess(BaseProcess):
def __init__(self, pid=None, name=None, debug=True, ptrace=None):
''' Create and Open a process object from its pid or from its name '''
super(SunProcess, self).__init__()
self.pid = int(pid)
self.pas = None
self.writable = False
if name... | if not self.isProcessOpen:
return
with open('/proc/%d/map'%(self.pid)) as maps_file:
while True:
mapping = maps_file.read(MAP_T.size)
if not mapping:
break
start, size, name, offset, flags, pagesize, shmid, fi... | """
optimizations :
i for inode==0 (no file mapping)
s to avoid scanning shared regions
x to avoid scanning x regions
r don't scan ronly regions
"""
if not self.isProcessOpen:
return
with open('/proc... | 112 | 794 | 317 | 1,111 | # This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that... | # This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is distributed in the hope that... |
492 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/lib/memorpy/utils.py | 62,63 | 1,122 | hex_dump | 66,122 | 63,122 | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | dump = prefix
slice = ''
if ftype != 'bytes':
structtype, structlen = type_unpack(ftype)
for i in range(0, len(data), structlen):
if addr % 16 == 0:
dump += ' '
for char in slice:
if ord(char) >= 32 and ord(char) <= 126:
... | """
function originally from pydbg, modified to display other types
"""
dump = prefix
slice = ''
if ftype != 'bytes':
structtype, structlen = type_unpack(ftype)
for i in range(0, len(data), structlen):
if addr % 16 == 0:
dump += ' '
for... | 200 | 537 | 543 | 1,080 | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | |
493 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/lib/memorpy/wintools.py | 26,27 | 1,36 | window_foreground_loop | 28,36 | 27,36 | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | hwnd = windll.kernel32.GetConsoleWindow()
HWND_TOPMOST = -1
SWP_NOMOVE = 2
SWP_NOSIZE = 1
while True:
windll.user32.SetWindowPos(hwnd, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE)
time.sleep(timeout)
| """ set the windows python console to the foreground (for example when you are working with a fullscreen program) """
hwnd = windll.kernel32.GetConsoleWindow()
HWND_TOPMOST = -1
SWP_NOMOVE = 2
SWP_NOSIZE = 1
while True:
windll.user32.SetWindowPos(hwnd, HWND_TOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE)
tim... | 21 | 299 | 131 | 430 | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | # Author: Nicolas VERDIER
# This file is part of memorpy.
#
# memorpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# memorpy is di... | |
494 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/manage_modules.py | 79,80 | 1,105 | get_categories | 80,102 | 80,102 | # Browsers
from lazagne.config.soft_import_module import soft_import
from lazagne.softwares.browsers.chromium_browsers import chromium_browsers
from lazagne.softwares.browsers.firefox_browsers import firefox_browsers
def get_modules_names():
return [
("lazagne.softwares.browsers.ie", "IE"),
("laza... | # Browsers
from lazagne.config.soft_import_module import soft_import
from lazagne.softwares.browsers.chromium_browsers import chromium_browsers
from lazagne.softwares.browsers.firefox_browsers import firefox_browsers
def get_modules_names():
return [
("lazagne.softwares.browsers.ie", "IE"),
("laza... | category = {
'browsers': {'help': 'Web browsers supported'},
'chats': {'help': 'Chat clients supported'},
'databases': {'help': 'SQL/NoSQL clients supported'},
'games': {'help': 'Games etc.'},
'git': {'help': 'GIT clients supported'},
'mails': {'help': 'Email clients ... | category = {
'browsers': {'help': 'Web browsers supported'},
'chats': {'help': 'Chat clients supported'},
'databases': {'help': 'SQL/NoSQL clients supported'},
'games': {'help': 'Games etc.'},
'git': {'help': 'GIT clients supported'},
'mails': {'help': 'Email clients ... | 89 | 1,453 | 279 | 1,732 | # Browsers
from lazagne.config.soft_import_module import soft_import
from lazagne.softwares.browsers.chromium_browsers import chromium_browsers
from lazagne.softwares.browsers.firefox_browsers import firefox_browsers
def get_modules_names():
return [
("lazagne.softwares.browsers.ie", "IE"),
("laza... | # Browsers
from lazagne.config.soft_import_module import soft_import
from lazagne.softwares.browsers.chromium_browsers import chromium_browsers
from lazagne.softwares.browsers.firefox_browsers import firefox_browsers
def get_modules_names():
return [
("lazagne.softwares.browsers.ie", "IE"),
("laza... | |
495 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/module_info.py | 42,43 | 20,50 | info | ModuleInfo | 43,45 | 43,45 | class ModuleInfo(object):
def __init__(self, name, category, options={}, suboptions=[], registry_used=False, winapi_used=False,
system_module=False, dpapi_used=False, only_from_current_user=False):
self.name = name
self.category = category
self.options = {
'comm... | class ModuleInfo(object):
def __init__(self, name, category, options={}, suboptions=[], registry_used=False, winapi_used=False,
system_module=False, dpapi_used=False, only_from_current_user=False):
self.name = name
self.category = category
self.options = {
'comm... | print_debug('INFO', message)
| print_debug('INFO', message)
| 2 | 305 | 13 | 318 | """
name => Name of a class
category => windows / browsers / etc
options => dictionary
- command
- action
- dest
- help
ex: ('-s', action='store_true', dest='skype', help='skype')
- options['command'] = '-s'
- options['action'] = 'store_true'
- options['dest'] = 'skype'
- options['help'] = 'skype'
"""
from lazagn... | """
name => Name of a class
category => windows / browsers / etc
options => dictionary
- command
- action
- dest
- help
ex: ('-s', action='store_true', dest='skype', help='skype')
- options['command'] = '-s'
- options['action'] = 'store_true'
- options['dest'] = 'skype'
- options['help'] = 'skype'
"""
from lazagn... |
497 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/soft_import_module.py | 9,10 | 1,33 | soft_import | 12,25 | 10,25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from importlib import import_module
from lazagne.config.module_info import ModuleInfo
def soft_import(package_name, module_name):
FILL_FUNC_BODYclass _MOCK_ImportErrorInModule(ModuleInfo):
def __init__(self, name, exception):
super(_MOCK_ImportErrorInModule... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from importlib import import_module
from lazagne.config.module_info import ModuleInfo
def soft_import(package_name, module_name):
""" Imports module or return mock object which only print error
"""
FILL_FUNC_BODYclass _MOCK_ImportErrorInModule(ModuleInfo):
... | try:
module = import_module(package_name)
return getattr(module, module_name)
except ImportError as ex:
# Emulate import ModuleInfo: return object (function) which generates objects of type ModuleInfo
# This could be done with metaclasses, but now let's just keep it simple.
... | """ Imports module or return mock object which only print error
"""
try:
module = import_module(package_name)
return getattr(module, module_name)
except ImportError as ex:
# Emulate import ModuleInfo: return object (function) which generates objects of type ModuleInfo
#... | 50 | 197 | 159 | 356 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from importlib import import_module
from lazagne.config.module_info import ModuleInfo
def soft_import(package_name, module_name):
FILL_FUNC_BODYclass _MOCK_ImportErrorInModule(ModuleInfo):
def __init__(self, name, exception):
super(_MOCK_ImportErrorInModule... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from importlib import import_module
from lazagne.config.module_info import ModuleInfo
def soft_import(package_name, module_name):
""" Imports module or return mock object which only print error
"""
FILL_FUNC_BODYclass _MOCK_ImportErrorInModule(ModuleInfo):
... | |
498 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/soft_import_module.py | 31,32 | 25,33 | run | _MOCK_ImportErrorInModule | 32,33 | 32,33 | class _MOCK_ImportErrorInModule(ModuleInfo):
def __init__(self, name, exception):
super(_MOCK_ImportErrorInModule, self).__init__(name, "unused")
self.__message_to_print = "Module %s is not used due to unresolved dependence:\r\n%s" % (name, str(exception))
def run(self):
FILL_FUNC_BODY | class _MOCK_ImportErrorInModule(ModuleInfo):
def __init__(self, name, exception):
super(_MOCK_ImportErrorInModule, self).__init__(name, "unused")
self.__message_to_print = "Module %s is not used due to unresolved dependence:\r\n%s" % (name, str(exception))
def run(self):
FILL_FUNC_BODY | self.error(self.__message_to_print)
| self.error(self.__message_to_print)
| 1 | 105 | 15 | 120 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from importlib import import_module
from lazagne.config.module_info import ModuleInfo
def soft_import(package_name, module_name):
""" Imports module or return mock object which only print error
"""
try:
module = import_module(package_name)
re... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from importlib import import_module
from lazagne.config.module_info import ModuleInfo
def soft_import(package_name, module_name):
""" Imports module or return mock object which only print error
"""
try:
module = import_module(package_name)
re... |
499 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/config/users.py | 11,12 | 1,82 | get_user_list_on_filesystem | 15,37 | 12,37 | # -*- coding: utf-8 -*-
# !/usr/bin/python
import os
import ctypes
import sys
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
def get_user_list_on_filesystem(impersonated_user=[]):
FILL_FUNC_BODYdef set_env_variables(user, to_impersonate=False):
# Restore templ... | # -*- coding: utf-8 -*-
# !/usr/bin/python
import os
import ctypes
import sys
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
def get_user_list_on_filesystem(impersonated_user=[]):
"""
Get user list to retrieve their passwords
"""
FILL_FUNC_BODYdef set... | # Check users existing on the system (get only directories)
user_path = u'{drive}:\\Users'.format(drive=constant.drive)
if float(get_os_version()) < 6:
user_path = u'{drive}:\\Documents and Settings'.format(drive=constant.drive)
all_users = []
if os.path.exists(user_path):
all_users... | """
Get user list to retrieve their passwords
"""
# Check users existing on the system (get only directories)
user_path = u'{drive}:\\Users'.format(drive=constant.drive)
if float(get_os_version()) < 6:
user_path = u'{drive}:\\Documents and Settings'.format(drive=constant.drive)
all... | 75 | 693 | 269 | 962 | # -*- coding: utf-8 -*-
# !/usr/bin/python
import os
import ctypes
import sys
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
def get_user_list_on_filesystem(impersonated_user=[]):
FILL_FUNC_BODYdef set_env_variables(user, to_impersonate=False):
# Restore templ... | # -*- coding: utf-8 -*-
# !/usr/bin/python
import os
import ctypes
import sys
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
def get_user_list_on_filesystem(impersonated_user=[]):
"""
Get user list to retrieve their passwords
"""
FILL_FUNC_BODYdef set... | |
501 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/browsers/ie.py | 27,28 | 23,197 | get_hash_table | IE | 28,41 | 28,41 | class IE(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'ie', 'browsers', registry_used=True, winapi_used=True)
def get_hash_table(self):
FILL_FUNC_BODY def get_history(self):
urls = self.history_from_regedit()
try:
urls = urls + self.history_from_powershell()... | class IE(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'ie', 'browsers', registry_used=True, winapi_used=True)
def get_hash_table(self):
FILL_FUNC_BODY def get_history(self):
urls = self.history_from_regedit()
try:
urls = urls + self.history_from_powershell()... | # get the url list
urls = self.get_history()
# calculate the hash for all urls found on the history
hash_tables = []
for u in range(len(urls)):
try:
h = (urls[u] + '\0').encode('UTF-16LE')
hash_tables.append([h, hashlib.sha1(h).hexdige... | # get the url list
urls = self.get_history()
# calculate the hash for all urls found on the history
hash_tables = []
for u in range(len(urls)):
try:
h = (urls[u] + '\0').encode('UTF-16LE')
hash_tables.append([h, hashlib.sha1(h).hexdige... | 39 | 1,757 | 142 | 1,899 | import hashlib
import subprocess
import traceback
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
try:
import _subprocess as sub
STARTF_USESHOWWINDOW = sub.STARTF_USESHOWWINDOW # Not work on Python 3
SW_HIDE = sub.S... | import hashlib
import subprocess
import traceback
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
try:
import _subprocess as sub
STARTF_USESHOWWINDOW = sub.STARTF_USESHOWWINDOW # Not work on Python 3
SW_HIDE = sub.S... |
502 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/browsers/ucbrowser.py | 14,15 | 9,22 | _get_database_dirs | UCBrowser | 15,22 | 15,22 | class UCBrowser(ChromiumBased):
def __init__(self):
self.database_query = 'SELECT action_url, username_value, password_value FROM wow_logins'
ModuleInfo.__init__(self, 'uc browser', 'browsers', winapi_used=True)
def _get_database_dirs(self):
FILL_FUNC_BODY | class UCBrowser(ChromiumBased):
def __init__(self):
self.database_query = 'SELECT action_url, username_value, password_value FROM wow_logins'
ModuleInfo.__init__(self, 'uc browser', 'browsers', winapi_used=True)
def _get_database_dirs(self):
FILL_FUNC_BODY | data_dir = u'{LOCALAPPDATA}\\UCBrowser'.format(**constant.profile)
try:
# UC Browser seems to have random characters appended to the User Data dir so we'll list them all
self.paths = [os.path.join(data_dir, d) for d in os.listdir(data_dir)]
except Exception:
s... | data_dir = u'{LOCALAPPDATA}\\UCBrowser'.format(**constant.profile)
try:
# UC Browser seems to have random characters appended to the User Data dir so we'll list them all
self.paths = [os.path.join(data_dir, d) for d in os.listdir(data_dir)]
except Exception:
s... | 38 | 95 | 120 | 215 | # -*- coding: utf-8 -*-
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.softwares.browsers.chromium_based import ChromiumBased
class UCBrowser(ChromiumBased):
def __init__(self):
self.database_query = 'SELECT action_url, username_value... | # -*- coding: utf-8 -*-
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.softwares.browsers.chromium_based import ChromiumBased
class UCBrowser(ChromiumBased):
def __init__(self):
self.database_query = 'SELECT action_url, username_value... |
503 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/chats/pidgin.py | 13,14 | 9,29 | run | Pidgin | 14,29 | 14,29 | class Pidgin(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'pidgin', 'chats')
def run(self):
FILL_FUNC_BODY | class Pidgin(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'pidgin', 'chats')
def run(self):
FILL_FUNC_BODY | path = os.path.join(constant.profile['APPDATA'], u'.purple', u'accounts.xml')
if os.path.exists(path):
tree = ElementTree(file=path)
root = tree.getroot()
pwd_found = []
for account in root.findall('account'):
name = account.find('name')
... | path = os.path.join(constant.profile['APPDATA'], u'.purple', u'accounts.xml')
if os.path.exists(path):
tree = ElementTree(file=path)
root = tree.getroot()
pwd_found = []
for account in root.findall('account'):
name = account.find('name')
... | 40 | 52 | 164 | 216 | # -*- coding: utf-8 -*-
import os
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class Pidgin(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'pidgin', 'chats')
def run(self):
FILL_FUNC_BODY | # -*- coding: utf-8 -*-
import os
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class Pidgin(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'pidgin', 'chats')
def run(self):
FILL_FUNC_BODY |
504 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/chats/psi.py | 18,19 | 12,65 | get_profiles_files | PSI | 19,31 | 19,31 | class PSI(ModuleInfo):
def __init__(self):
self.pwd_found = []
ModuleInfo.__init__(self, 'psi-im', 'chats')
def get_profiles_files(self):
FILL_FUNC_BODY def decode_password(self, password, jid):
result = ''
jid = cycle(jid)
for n1 in range(0, len(password), 4):
... | class PSI(ModuleInfo):
def __init__(self):
self.pwd_found = []
ModuleInfo.__init__(self, 'psi-im', 'chats')
def get_profiles_files(self):
FILL_FUNC_BODY def decode_password(self, password, jid):
result = ''
jid = cycle(jid)
for n1 in range(0, len(password), 4):
... | _dirs = (
u'psi\\profiles\\*\\accounts.xml',
u'psi+\\profiles\\*\\accounts.xml',
)
for one_dir in _dirs:
_path = os.path.join(constant.profile['APPDATA'], one_dir)
accs_files = glob(_path)
for one_file in accs_files:
yi... | _dirs = (
u'psi\\profiles\\*\\accounts.xml',
u'psi+\\profiles\\*\\accounts.xml',
)
for one_dir in _dirs:
_path = os.path.join(constant.profile['APPDATA'], one_dir)
accs_files = glob(_path)
for one_file in accs_files:
yi... | 27 | 393 | 143 | 536 | # -*- coding: utf-8 -*-
import os
from xml.etree.cElementTree import ElementTree
from glob import glob
from itertools import cycle
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import char_to_int
class PSI(ModuleInfo):
def __init_... | # -*- coding: utf-8 -*-
import os
from xml.etree.cElementTree import ElementTree
from glob import glob
from itertools import cycle
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import char_to_int
class PSI(ModuleInfo):
def __init_... |
505 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/chats/skype.py | 101,102 | 20,146 | get_info | Skype | 102,127 | 102,127 | class Skype(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'skype', 'chats', winapi_used=True)
self.pwd_found = []
def aes_encrypt(self, message, passphrase):
iv = '\x00' * 16
aes = AESModeOfOperationCBC(passphrase, iv=iv)
return aes.encrypt(message)
# ... | class Skype(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'skype', 'chats', winapi_used=True)
self.pwd_found = []
def aes_encrypt(self, message, passphrase):
iv = '\x00' * 16
aes = AESModeOfOperationCBC(passphrase, iv=iv)
return aes.encrypt(message)
# ... | if os.path.exists(os.path.join(path, u'config.xml')):
values = {}
try:
values['Login'] = username
# get encrypted hash from the config file
enc_hex = self.get_hash_credential(os.path.join(path, u'config.xml'))
if not enc_... | if os.path.exists(os.path.join(path, u'config.xml')):
values = {}
try:
values['Login'] = username
# get encrypted hash from the config file
enc_hex = self.get_hash_credential(os.path.join(path, u'config.xml'))
if not enc_... | 80 | 1,139 | 295 | 1,434 | # -*- coding: utf-8 -*-
import binascii
import hashlib
import os
import struct
from xml.etree.cElementTree import ElementTree
import lazagne.config.winstructure as win
from lazagne.config.constant import constant
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationCBC
from lazagne.config.dico import get_dic
... | # -*- coding: utf-8 -*-
import binascii
import hashlib
import os
import struct
from xml.etree.cElementTree import ElementTree
import lazagne.config.winstructure as win
from lazagne.config.constant import constant
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationCBC
from lazagne.config.dico import get_dic
... |
506 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/databases/dbvis.py | 37,38 | 15,80 | decrypt | Dbvisualizer | 38,44 | 38,44 | class Dbvisualizer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='dbvis', category='databases')
self._salt = self.get_salt()
self._passphrase = 'qinda'
self._iteration = 10
def get_salt(self):
salt_array = [-114, 18, 57, -100, 7, 114, 111, 90]
... | class Dbvisualizer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='dbvis', category='databases')
self._salt = self.get_salt()
self._passphrase = 'qinda'
self._iteration = 10
def get_salt(self):
salt_array = [-114, 18, 57, -100, 7, 114, 111, 90]
... | enc_text = base64.b64decode(msg)
(dk, iv) = self.get_derived_key(self._passphrase, self._salt, self._iteration)
crypter = des(dk, CBC, iv)
text = crypter.decrypt(enc_text)
return re.sub(r'[\x01-\x08]', '', text)
| enc_text = base64.b64decode(msg)
(dk, iv) = self.get_derived_key(self._passphrase, self._salt, self._iteration)
crypter = des(dk, CBC, iv)
text = crypter.decrypt(enc_text)
return re.sub(r'[\x01-\x08]', '', text)
| 21 | 632 | 108 | 740 | # -*- coding: utf-8 -*-
import array
import base64
import binascii
import hashlib
import os
import re
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.crypto.pyDes import des, CBC
from lazagne.config.module_info import ModuleInfo
class Dbvisualizer(Modu... | # -*- coding: utf-8 -*-
import array
import base64
import binascii
import hashlib
import os
import re
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.crypto.pyDes import des, CBC
from lazagne.config.module_info import ModuleInfo
class Dbvisualizer(Modu... |
507 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/databases/postgresql.py | 13,14 | 9,33 | run | PostgreSQL | 14,33 | 14,33 | class PostgreSQL(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='postgresql', category='databases')
def run(self):
FILL_FUNC_BODY | class PostgreSQL(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='postgresql', category='databases')
def run(self):
FILL_FUNC_BODY | path = os.path.join(constant.profile['APPDATA'], u'postgresql', u'pgpass.conf')
if os.path.exists(path):
with open(path) as f:
pwd_found = []
for line in f.readlines():
try:
items = line.strip().split(':')
... | path = os.path.join(constant.profile['APPDATA'], u'postgresql', u'pgpass.conf')
if os.path.exists(path):
with open(path) as f:
pwd_found = []
for line in f.readlines():
try:
items = line.strip().split(':')
... | 39 | 55 | 180 | 235 | # -*- coding: utf-8 -*-
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class PostgreSQL(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='postgresql', category='databases')
def run(self):
FILL_FUNC_BODY | # -*- coding: utf-8 -*-
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class PostgreSQL(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='postgresql', category='databases')
def run(self):
FILL_FUNC_BODY |
508 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/databases/robomongo.py | 40,41 | 9,102 | parse_json | Robomongo | 41,89 | 41,89 | class Robomongo(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'robomongo', 'databases')
self.paths = [
{
'directory': u'.config/robomongo',
'filename': u'robomongo.json',
},
{
'directory': u'.3T/robo-3... | class Robomongo(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'robomongo', 'databases')
self.paths = [
{
'directory': u'.config/robomongo',
'filename': u'robomongo.json',
},
{
'directory': u'.3T/robo-3... | repos_creds = []
if not os.path.exists(connection_file_path):
return repos_creds
with open(connection_file_path) as connection_file:
try:
connections_infos = json.load(connection_file)
except Exception:
return repos_creds
... | repos_creds = []
if not os.path.exists(connection_file_path):
return repos_creds
with open(connection_file_path) as connection_file:
try:
connections_infos = json.load(connection_file)
except Exception:
return repos_creds
... | 97 | 377 | 542 | 919 | # -*- coding: utf-8 -*-
import json
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class Robomongo(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'robomongo', 'databases')
self.paths = [
{
'direct... | # -*- coding: utf-8 -*-
import json
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class Robomongo(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'robomongo', 'databases')
self.paths = [
{
'direct... |
509 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/databases/sqldeveloper.py | 94,95 | 21,174 | run | SQLDeveloper | 95,174 | 95,174 | class SQLDeveloper(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'sqldeveloper', 'databases')
self._salt = self.get_salt()
self._passphrase = None
self._iteration = 42
def get_salt(self):
salt_array = [5, 19, -103, 66, -109, 114, -24, -83]
salt = ar... | class SQLDeveloper(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'sqldeveloper', 'databases')
self._salt = self.get_salt()
self._passphrase = None
self._iteration = 42
def get_salt(self):
salt_array = [5, 19, -103, 66, -109, 114, -24, -83]
salt = ar... | pwd_found = []
path = os.path.join(constant.profile['APPDATA'], u'SQL Developer')
if os.path.exists(path):
self._passphrase = self.get_passphrase(path)
if self._passphrase:
self.debug(u'Passphrase found: {passphrase}'.format(passphrase=self._passphrase))
... | pwd_found = []
path = os.path.join(constant.profile['APPDATA'], u'SQL Developer')
if os.path.exists(path):
self._passphrase = self.get_passphrase(path)
if self._passphrase:
self.debug(u'Passphrase found: {passphrase}'.format(passphrase=self._passphrase))
... | 218 | 955 | 995 | 1,950 | # -*- coding: utf-8 -*-
# Passwords decryption for new verion have been taken from:
# https://github.com/maaaaz/sqldeveloperpassworddecryptor
import array
import base64
import binascii
import hashlib
import json
import os
import re
from xml.etree.cElementTree import ElementTree
from Crypto.Cipher import AES
from la... | # -*- coding: utf-8 -*-
# Passwords decryption for new verion have been taken from:
# https://github.com/maaaaz/sqldeveloperpassworddecryptor
import array
import base64
import binascii
import hashlib
import json
import os
import re
from xml.etree.cElementTree import ElementTree
from Crypto.Cipher import AES
from la... |
510 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/databases/squirrel.py | 13,14 | 9,28 | run | Squirrel | 14,28 | 14,28 | class Squirrel(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='squirrel', category='databases')
def run(self):
FILL_FUNC_BODY | class Squirrel(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='squirrel', category='databases')
def run(self):
FILL_FUNC_BODY | path = os.path.join(constant.profile['USERPROFILE'], u'.squirrel-sql', u'SQLAliases23.xml')
if os.path.exists(path):
tree = ElementTree(file=path)
pwd_found = []
elements = {'name': 'Name', 'url': 'URL', 'userName': 'Login', 'password': 'Password'}
for ele... | path = os.path.join(constant.profile['USERPROFILE'], u'.squirrel-sql', u'SQLAliases23.xml')
if os.path.exists(path):
tree = ElementTree(file=path)
pwd_found = []
elements = {'name': 'Name', 'url': 'URL', 'userName': 'Login', 'password': 'Password'}
for ele... | 46 | 57 | 180 | 237 | # -*- coding: utf-8 -*-
import os
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class Squirrel(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='squirrel', category='databases')
def run(se... | # -*- coding: utf-8 -*-
import os
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class Squirrel(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='squirrel', category='databases')
def run(se... |
511 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/games/galconfusion.py | 19,20 | 15,56 | run | GalconFusion | 20,56 | 20,56 | class GalconFusion(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'galconfusion', 'games', registry_used=True)
def run(self):
FILL_FUNC_BODY | class GalconFusion(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'galconfusion', 'games', registry_used=True)
def run(self):
FILL_FUNC_BODY | creds = []
results = None
# Find the location of steam - to make it easier we're going to use a try block
# 'cos I'm lazy
try:
with win.OpenKey(win.HKEY_CURRENT_USER, 'Software\\Valve\\Steam') as key:
results = winreg.QueryValueEx(key, 'SteamPath')
... | creds = []
results = None
# Find the location of steam - to make it easier we're going to use a try block
# 'cos I'm lazy
try:
with win.OpenKey(win.HKEY_CURRENT_USER, 'Software\\Valve\\Steam') as key:
results = winreg.QueryValueEx(key, 'SteamPath')
... | 127 | 60 | 421 | 481 | # -*- coding: utf-8 -*-
import os
try:
import _winreg as winreg
except ImportError:
import winreg
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import string_to_unicode
class GalconFusion(ModuleInfo):
def __init__(self):
... | # -*- coding: utf-8 -*-
import os
try:
import _winreg as winreg
except ImportError:
import winreg
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import string_to_unicode
class GalconFusion(ModuleInfo):
def __init__(self):
... |
512 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/games/kalypsomedia.py | 25,26 | 15,43 | run | KalypsoMedia | 26,43 | 26,43 | class KalypsoMedia(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'kalypsomedia', 'games')
def xorstring(self, s, k):
"""
xors the two strings
"""
return b''.join(chr_or_byte(char_to_int(x) ^ char_to_int(y)) for x, y in zip(s, k))
def run(self):
FILL_FUN... | class KalypsoMedia(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'kalypsomedia', 'games')
def xorstring(self, s, k):
"""
xors the two strings
"""
return b''.join(chr_or_byte(char_to_int(x) ^ char_to_int(y)) for x, y in zip(s, k))
def run(self):
FILL_FUN... | creds = []
key = b'lwSDFSG34WE8znDSmvtwGSDF438nvtzVnt4IUv89'
inifile = os.path.join(constant.profile['APPDATA'], u'Kalypso Media\\Launcher\\launcher.ini')
# The actual user details are stored in *.userdata files
if os.path.exists(inifile):
config = ConfigParser()
... | creds = []
key = b'lwSDFSG34WE8znDSmvtwGSDF438nvtzVnt4IUv89'
inifile = os.path.join(constant.profile['APPDATA'], u'Kalypso Media\\Launcher\\launcher.ini')
# The actual user details are stored in *.userdata files
if os.path.exists(inifile):
config = ConfigParser()
... | 48 | 126 | 227 | 353 | # -*- coding: utf-8 -*-
import base64
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import char_to_int, chr_or_byte
try:
from ConfigParser import ConfigParser # Python 2.7
except ImportError:
from configparser import... | # -*- coding: utf-8 -*-
import base64
import os
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import char_to_int, chr_or_byte
try:
from ConfigParser import ConfigParser # Python 2.7
except ImportError:
from configparser import... |
513 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/games/roguestale.py | 14,15 | 10,42 | run | RoguesTale | 15,42 | 15,42 | class RoguesTale(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'roguestale', 'games')
def run(self):
FILL_FUNC_BODY | class RoguesTale(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'roguestale', 'games')
def run(self):
FILL_FUNC_BODY | creds = []
directory = constant.profile['USERPROFILE'] + u'\\Documents\\Rogue\'s Tale\\users'
# The actual user details are stored in *.userdata files
if os.path.exists(directory):
files = os.listdir(directory)
for f in files:
if re.match('.*\.us... | creds = []
directory = constant.profile['USERPROFILE'] + u'\\Documents\\Rogue\'s Tale\\users'
# The actual user details are stored in *.userdata files
if os.path.exists(directory):
files = os.listdir(directory)
for f in files:
if re.match('.*\.us... | 96 | 55 | 269 | 324 | # -*- coding: utf-8 -*-
import os
import re
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class RoguesTale(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'roguestale', 'games')
def run(self):... | # -*- coding: utf-8 -*-
import os
import re
from xml.etree.cElementTree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class RoguesTale(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'roguestale', 'games')
def run(self):... |
514 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/games/turba.py | 19,20 | 15,56 | run | Turba | 20,56 | 20,56 | class Turba(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'turba', 'games', registry_used=True)
def run(self):
FILL_FUNC_BODY | class Turba(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'turba', 'games', registry_used=True)
def run(self):
FILL_FUNC_BODY | creds = []
results = None
# Find the location of steam - to make it easier we're going to use a try block
# 'cos I'm lazy
try:
with win.OpenKey(win.HKEY_CURRENT_USER, 'Software\Valve\Steam') as key:
results = winreg.QueryValueEx(key, 'SteamPath')
... | creds = []
results = None
# Find the location of steam - to make it easier we're going to use a try block
# 'cos I'm lazy
try:
with win.OpenKey(win.HKEY_CURRENT_USER, 'Software\Valve\Steam') as key:
results = winreg.QueryValueEx(key, 'SteamPath')
... | 123 | 58 | 415 | 473 | # -*- coding: utf-8 -*-
import os
try:
import _winreg as winreg
except ImportError:
import winreg
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import string_to_unicode
class Turba(ModuleInfo):
def __init__(self):
M... | # -*- coding: utf-8 -*-
import os
try:
import _winreg as winreg
except ImportError:
import winreg
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import string_to_unicode
class Turba(ModuleInfo):
def __init__(self):
M... |
515 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/git/gitforwindows.py | 18,19 | 14,62 | extract_credentials | GitForWindows | 26,41 | 19,41 | class GitForWindows(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'gitforwindows', 'git')
def extract_credentials(self, location):
FILL_FUNC_BODY def run(self):
"""
Main function
"""
# According to the "git-credential-store" documentation:
# Buil... | class GitForWindows(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'gitforwindows', 'git')
def extract_credentials(self, location):
"""
Extract the credentials from a Git store file.
See "https://git-scm.com/docs/git-credential-store" for file format.
:param... | pwd_found = []
if os.path.isfile(location):
with open(location) as f:
# One line have the following format: https://user:pass@example.com
for cred in f:
if len(cred) > 0:
parts = urlparse(cred)
... | """
Extract the credentials from a Git store file.
See "https://git-scm.com/docs/git-credential-store" for file format.
:param location: Full path to the Git store file
:return: List of credentials founds
"""
pwd_found = []
if os.path.isfile(location):
... | 42 | 374 | 160 | 534 | # -*- coding: utf-8 -*-
import os
try:
from urlparse import urlparse, unquote
except ImportError:
from urllib.parse import urlparse, unquote
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import string_to_unicode
class GitFo... | # -*- coding: utf-8 -*-
import os
try:
from urlparse import urlparse, unquote
except ImportError:
from urllib.parse import urlparse, unquote
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import string_to_unicode
class GitFo... |
516 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/mails/outlook.py | 16,17 | 12,96 | trySingleKey | Outlook | 17,48 | 17,48 | class Outlook(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'outlook', 'mails', registry_used=True, winapi_used=True)
def trySingleKey(self, keyPath):
FILL_FUNC_BODY def retrieve_info(self, hkey, name_key):
values = {}
num = winreg.QueryInfoKey(hkey)[1]
for x in ... | class Outlook(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'outlook', 'mails', registry_used=True, winapi_used=True)
def trySingleKey(self, keyPath):
FILL_FUNC_BODY def retrieve_info(self, hkey, name_key):
values = {}
num = winreg.QueryInfoKey(hkey)[1]
for x in ... | try:
hkey = win.OpenKey(win.HKEY_CURRENT_USER, keyPath)
except Exception as e:
self.debug(e)
return
num = winreg.QueryInfoKey(hkey)[0]
pwd_found = []
for x in range(0, num):
name = winreg.EnumKey(hkey, x)
skey = win.Ope... | try:
hkey = win.OpenKey(win.HKEY_CURRENT_USER, keyPath)
except Exception as e:
self.debug(e)
return
num = winreg.QueryInfoKey(hkey)[0]
pwd_found = []
for x in range(0, num):
name = winreg.EnumKey(hkey, x)
skey = win.Ope... | 79 | 746 | 362 | 1,108 | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
class Outlook(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self,... | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
import lazagne.config.winstructure as win
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
class Outlook(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self,... |
517 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/maven/mavenrepositories.py | 81,82 | 9,132 | run | MavenRepositories | 95,132 | 82,132 | class MavenRepositories(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'mavenrepositories', 'maven')
# Interesting XML nodes in Maven repository configuration
self.nodes_to_extract = ["id", "username", "password", "privateKey", "passphrase"]
self.settings_namespace = "{h... | class MavenRepositories(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'mavenrepositories', 'maven')
# Interesting XML nodes in Maven repository configuration
self.nodes_to_extract = ["id", "username", "password", "privateKey", "passphrase"]
self.settings_namespace = "{h... |
# Extract the master password
master_password = self.extract_master_password()
# Extract all available repositories credentials
repos_creds = self.extract_repositories_credentials()
# Parse and process the list of repositories's credentials
# 3 cases are handled:
... | """
Main function:
- For encrypted password, provides the encrypted version of the password with the master password in order
to allow "LaZagne run initiator" the use the encryption parameter associated with the version of Maven because
encryption parameters can change between v... | 140 | 1,024 | 451 | 1,475 | # -*- coding: utf-8 -*-
import os
from xml.etree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class MavenRepositories(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'mavenrepositories', 'maven')
# Interesting XML no... | # -*- coding: utf-8 -*-
import os
from xml.etree import ElementTree
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
class MavenRepositories(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'mavenrepositories', 'maven')
# Interesting XML no... |
518 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/keepass.py | 19,20 | 15,32 | run | Keepass | 20,32 | 20,32 | class Keepass(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'keepass', 'memory')
def run(self):
FILL_FUNC_BODY | class Keepass(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'keepass', 'memory')
def run(self):
FILL_FUNC_BODY | # password found on the memory dump class
if constant.keepass:
res = []
for db in constant.keepass:
try:
with libkeepass.open(db.values()[0][u'Database'],
password=db.get(u"KcpPassword", {}).get(u'Passwo... | # password found on the memory dump class
if constant.keepass:
res = []
for db in constant.keepass:
try:
with libkeepass.open(db.values()[0][u'Database'],
password=db.get(u"KcpPassword", {}).get(u'Passwo... | 32 | 50 | 156 | 206 | # -*- coding: utf-8 -*-
# Thanks to the awesome work done by harmjoy
# For more information http://www.harmj0y.net/blog/redteaming/keethief-a-case-study-in-attacking-keepass-part-2/
# Thanks for the great work of libkeepass (used to decrypt keepass file)
# https://github.com/phpwutz/libkeepass
import traceback
from... | # -*- coding: utf-8 -*-
# Thanks to the awesome work done by harmjoy
# For more information http://www.harmj0y.net/blog/redteaming/keethief-a-case-study-in-attacking-keepass-part-2/
# Thanks for the great work of libkeepass (used to decrypt keepass file)
# https://github.com/phpwutz/libkeepass
import traceback
from... |
519 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/keethief.py | 20,21 | 12,41 | check_if_version_2x | KeeThief | 21,28 | 21,28 | class KeeThief():
def launch_kee_thief(self):
# Awesome work of harmjoy (thanks to him)
# From https://github.com/adaptivethreat/KeeThief/blob/master/PowerShell/KeeThief.ps1
func = 'Get-Process KeePass | Get-KeePassDatabaseKey'
return powershell_execute(SCRIPT, func)
def check_... | class KeeThief():
def launch_kee_thief(self):
# Awesome work of harmjoy (thanks to him)
# From https://github.com/adaptivethreat/KeeThief/blob/master/PowerShell/KeeThief.ps1
func = 'Get-Process KeePass | Get-KeePassDatabaseKey'
return powershell_execute(SCRIPT, func)
def check_... | dirname = os.path.dirname(full_exe_path.decode(sys.getfilesystemencoding()))
# version 1 use an ini configuration file
if os.path.exists(os.path.join(dirname, u'KeePass.config.xml')):
return True
else:
return False
| dirname = os.path.dirname(full_exe_path.decode(sys.getfilesystemencoding()))
# version 1 use an ini configuration file
if os.path.exists(os.path.join(dirname, u'KeePass.config.xml')):
return True
else:
return False
| 19 | 236 | 88 | 324 | # -*- coding: utf-8 -*-
import json
import os
import sys
from lazagne.config.constant import constant
from lazagne.config.execute_cmd import powershell_execute
from lazagne.config.write_output import print_debug
class KeeThief():
def launch_kee_thief(self):
# Awesome work of harmjoy (thanks to him)
... | # -*- coding: utf-8 -*-
import json
import os
import sys
from lazagne.config.constant import constant
from lazagne.config.execute_cmd import powershell_execute
from lazagne.config.write_output import print_debug
class KeeThief():
def launch_kee_thief(self):
# Awesome work of harmjoy (thanks to him)
... |
521 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/libkeepass/common.py | 165,166 | 131,225 | _decrypt | KDBFile | 166,172 | 166,172 | class KDBFile(object):
def __init__(self, stream=None, **credentials):
# list of hashed credentials (pre-transformation)
self.keys = []
self.add_credentials(**credentials)
# the buffer containing the decrypted/decompressed payload from a file
self.in_buffer = None
# ... | class KDBFile(object):
def __init__(self, stream=None, **credentials):
# list of hashed credentials (pre-transformation)
self.keys = []
self.add_credentials(**credentials)
# the buffer containing the decrypted/decompressed payload from a file
self.in_buffer = None
# ... | self._make_master_key()
# move read pointer beyond the file header
if self.header_length is None:
raise IOError('Header length unknown. Parse the header first!')
stream.seek(self.header_length)
| self._make_master_key()
# move read pointer beyond the file header
if self.header_length is None:
raise IOError('Header length unknown. Parse the header first!')
stream.seek(self.header_length)
| 22 | 916 | 67 | 983 | # -*- coding: utf-8 -*-
import base64
import codecs
import io
import struct
from xml.etree import ElementTree
from .crypto import sha256
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# file header
class HeaderDictionary(dict):
"""
A dictionary on steroids for comfor... | # -*- coding: utf-8 -*-
import base64
import codecs
import io
import struct
from xml.etree import ElementTree
from .crypto import sha256
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# file header
class HeaderDictionary(dict):
"""
A dictionary on steroids for comfor... |
522 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/libkeepass/crypto.py | 38,39 | 1,54 | unpad | 39,43 | 39,43 | # -*- coding: utf-8 -*-
import hashlib
import struct
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationECB, AESModeOfOperationCBC
from lazagne.config.winstructure import char_to_int
AES_BLOCK_SIZE = 16
def sha256(s):
"""Return SHA256 digest of the string `s`."""
return hashlib.sha256(s).digest()... | # -*- coding: utf-8 -*-
import hashlib
import struct
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationECB, AESModeOfOperationCBC
from lazagne.config.winstructure import char_to_int
AES_BLOCK_SIZE = 16
def sha256(s):
"""Return SHA256 digest of the string `s`."""
return hashlib.sha256(s).digest()... | extra = char_to_int(data[-1])
return data[:len(data) - extra]
| extra = char_to_int(data[-1])
return data[:len(data) - extra]
| 7 | 609 | 32 | 641 | # -*- coding: utf-8 -*-
import hashlib
import struct
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationECB, AESModeOfOperationCBC
from lazagne.config.winstructure import char_to_int
AES_BLOCK_SIZE = 16
def sha256(s):
"""Return SHA256 digest of the string `s`."""
return hashlib.sha256(s).digest()... | # -*- coding: utf-8 -*-
import hashlib
import struct
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationECB, AESModeOfOperationCBC
from lazagne.config.winstructure import char_to_int
AES_BLOCK_SIZE = 16
def sha256(s):
"""Return SHA256 digest of the string `s`."""
return hashlib.sha256(s).digest()... | |
523 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/libkeepass/hbio.py | 16,17 | 1,115 | read_int | 17,23 | 17,23 | # -*- coding: utf-8 -*-
import hashlib
import io
import struct
# default from KeePass2 source
BLOCK_LENGTH = 1024 * 1024
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# HEADER_LENGTH = 4+32+4
def read_int(stream, length):
FILL_FUNC_BODYclass HashedBlockIO(io.BytesIO):
"... | # -*- coding: utf-8 -*-
import hashlib
import io
import struct
# default from KeePass2 source
BLOCK_LENGTH = 1024 * 1024
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# HEADER_LENGTH = 4+32+4
def read_int(stream, length):
FILL_FUNC_BODYclass HashedBlockIO(io.BytesIO):
"... | try:
return struct.unpack('<I', stream.read(length))[0]
except Exception:
return None
| try:
return struct.unpack('<I', stream.read(length))[0]
except Exception:
return None
| 8 | 1,164 | 41 | 1,205 | # -*- coding: utf-8 -*-
import hashlib
import io
import struct
# default from KeePass2 source
BLOCK_LENGTH = 1024 * 1024
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# HEADER_LENGTH = 4+32+4
def read_int(stream, length):
FILL_FUNC_BODYclass HashedBlockIO(io.BytesIO):
"... | # -*- coding: utf-8 -*-
import hashlib
import io
import struct
# default from KeePass2 source
BLOCK_LENGTH = 1024 * 1024
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# HEADER_LENGTH = 4+32+4
def read_int(stream, length):
FILL_FUNC_BODYclass HashedBlockIO(io.BytesIO):
"... | |
524 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/libkeepass/hbio.py | 82,83 | 23,115 | write_block_stream | HashedBlockIO | 98,115 | 83,115 | class HashedBlockIO(io.BytesIO):
"""
The data is stored in hashed blocks. Each block consists of a block index (4
bytes), the hash (32 bytes) and the block length (4 bytes), followed by the
block data. The block index starts counting at 0. The block hash is a
SHA-256 hash of the block data. A block ... | class HashedBlockIO(io.BytesIO):
"""
The data is stored in hashed blocks. Each block consists of a block index (4
bytes), the hash (32 bytes) and the block length (4 bytes), followed by the
block data. The block index starts counting at 0. The block hash is a
SHA-256 hash of the block data. A block ... | if not (isinstance(stream, io.IOBase) or isinstance(stream, file_types)):
raise TypeError('Stream does not have the buffer interface.')
index = 0
self.seek(0)
while True:
data = self.read(block_length)
if data:
stream.write(struct.pack(... | """
Write all data in this buffer, starting at stream position 0, formatted
in hashed blocks to the given `stream`.
For example, writing data from one file into another as hashed blocks::
# create new hashed block io without input stream or data
... | 44 | 858 | 211 | 1,069 | # -*- coding: utf-8 -*-
import hashlib
import io
import struct
# default from KeePass2 source
BLOCK_LENGTH = 1024 * 1024
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# HEADER_LENGTH = 4+32+4
def read_int(stream, length):
try:
return struct.unpack('<I', stream.r... | # -*- coding: utf-8 -*-
import hashlib
import io
import struct
# default from KeePass2 source
BLOCK_LENGTH = 1024 * 1024
try:
file_types = (file, io.IOBase)
except NameError:
file_types = (io.IOBase,)
# HEADER_LENGTH = 4+32+4
def read_int(stream, length):
try:
return struct.unpack('<I', stream.r... |
525 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/memorydump.py | 72,73 | 66,118 | run | MemoryDump | 73,118 | 73,118 | class MemoryDump(ModuleInfo):
def __init__(self):
options = {'command': '-m', 'action': 'store_true', 'dest': 'memory_dump',
'help': 'retrieve browsers passwords from memory'}
ModuleInfo.__init__(self, 'memory_dump', 'memory', options)
def run(self):
FILL_FUNC_BODY | class MemoryDump(ModuleInfo):
def __init__(self):
options = {'command': '-m', 'action': 'store_true', 'dest': 'memory_dump',
'help': 'retrieve browsers passwords from memory'}
ModuleInfo.__init__(self, 'memory_dump', 'memory', options)
def run(self):
FILL_FUNC_BODY | pwd_found = []
for process in Process.list():
# if not memorpy:
# if process.get('name', '').lower() in browser_list:
# # Get only child process
# try:
# p = psutil.Process(process.get('pid'))
# ... | pwd_found = []
for process in Process.list():
# if not memorpy:
# if process.get('name', '').lower() in browser_list:
# # Get only child process
# try:
# p = psutil.Process(process.get('pid'))
# ... | 138 | 94 | 535 | 629 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Nicolas VERDIER (contact@n1nj4.eu)
"""
This script uses memorpy to dumps cleartext passwords from browser's memory
It has been tested on both windows 10 and ubuntu 16.04
The regex have been taken from the mimikittenz https://github.com/putterpanda/mimikittenz
"... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Nicolas VERDIER (contact@n1nj4.eu)
"""
This script uses memorpy to dumps cleartext passwords from browser's memory
It has been tested on both windows 10 and ubuntu 16.04
The regex have been taken from the mimikittenz https://github.com/putterpanda/mimikittenz
"... |
526 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/memory/onepassword.py | 10,11 | 5,54 | run | OnePassword | 11,54 | 11,54 | class OnePassword(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, "1Password", 'memory')
def run(self):
FILL_FUNC_BODY | class OnePassword(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, "1Password", 'memory')
def run(self):
FILL_FUNC_BODY | pwd_found = []
for process in Process.list():
if process.get('name') == '1Password.exe':
mw = MemWorker(pid=process.get('pid'))
# Search for Account Details
account_details = r'{"title":".*","url":"(.*)","ainfo":"(.*)","ps":.*,"pbe":.*,' \
... | pwd_found = []
for process in Process.list():
if process.get('name') == '1Password.exe':
mw = MemWorker(pid=process.get('pid'))
# Search for Account Details
account_details = r'{"title":".*","url":"(.*)","ainfo":"(.*)","ps":.*,"pbe":.*,' \
... | 113 | 51 | 549 | 600 | from lazagne.config.lib.memorpy import Process, MemWorker
from lazagne.config.module_info import ModuleInfo
class OnePassword(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, "1Password", 'memory')
def run(self):
FILL_FUNC_BODY | from lazagne.config.lib.memorpy import Process, MemWorker
from lazagne.config.module_info import ModuleInfo
class OnePassword(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, "1Password", 'memory')
def run(self):
FILL_FUNC_BODY |
527 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/multimedia/eyecon.py | 50,51 | 13,99 | credentials_from_registry | EyeCON | 51,93 | 51,93 | class EyeCON(ModuleInfo):
"""
eyeCON software WAll management software
infos at http://www.eyevis.de/en/products/wall-management-software.html
"""
def __init__(self):
self.hex_key = [ 35, 231, 64, 111, 100, 72, 95, 65, 68, 51, 52, 70, 67, 51, 65, 95, 54, 55, 50, 48, 95, 49, 49,
... | class EyeCON(ModuleInfo):
"""
eyeCON software WAll management software
infos at http://www.eyevis.de/en/products/wall-management-software.html
"""
def __init__(self):
self.hex_key = [ 35, 231, 64, 111, 100, 72, 95, 65, 68, 51, 52, 70, 67, 51, 65, 95, 54, 55, 50, 48, 95, 49, 49,
... | found_passwords = []
password_path = (
{
'app': 'EyeCON', 'reg_root': HKEY_LOCAL_MACHINE,
'reg_path': 'SOFTWARE\\WOW6432Node\\eyevis\\eyetool\\Default',
'user_key': 'registered', 'password_key': 'connection'
},
{
... | found_passwords = []
password_path = (
{
'app': 'EyeCON', 'reg_root': HKEY_LOCAL_MACHINE,
'reg_path': 'SOFTWARE\\WOW6432Node\\eyevis\\eyetool\\Default',
'user_key': 'registered', 'password_key': 'connection'
},
{
... | 96 | 1,000 | 530 | 1,530 | # -*- coding: utf-8 -*-
import codecs
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
class EyeCON(ModuleInfo):
"""
eyeCON software WAll management software
infos at http://www.eyevis.de/e... | # -*- coding: utf-8 -*-
import codecs
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
class EyeCON(ModuleInfo):
"""
eyeCON software WAll management software
infos at http://www.eyevis.de/e... |
528 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/php/composer.py | 15,16 | 10,62 | extract_credentials | Composer | 22,42 | 16,42 | class Composer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'composer', 'php')
def extract_credentials(self, location):
FILL_FUNC_BODY def run(self):
"""
Main function
"""
# Define the possible full path of the "auth.json" file when is defined at globa... | class Composer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'composer', 'php')
def extract_credentials(self, location):
"""
Extract the credentials from the "auth.json" file.
See "https://getcomposer.org/doc/articles/http-basic-authentication.md" for file format.
... | creds_found = []
with open(location) as f:
creds = json.load(f)
for cred_type in creds:
for domain in creds[cred_type]:
values = {
"AuthenticationType" : cred_type,
"Domain" : domain,
... | """
Extract the credentials from the "auth.json" file.
See "https://getcomposer.org/doc/articles/http-basic-authentication.md" for file format.
:param location: Full path to the "auth.json" file
:return: List of credentials founds
"""
creds_found = []
with... | 61 | 342 | 213 | 555 | # -*- coding: utf-8 -*-
import json
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class Composer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'composer', 'php')
def extract_credentials(self, location):
FILL_FUNC_BODY def ... | # -*- coding: utf-8 -*-
import json
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class Composer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'composer', 'php')
def extract_credentials(self, location):
"""
Ex... |
529 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/svn/tortoise.py | 15,16 | 11,69 | run | Tortoise | 16,69 | 16,69 | class Tortoise(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'tortoise', 'svn', winapi_used=True)
def run(self):
FILL_FUNC_BODY | class Tortoise(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'tortoise', 'svn', winapi_used=True)
def run(self):
FILL_FUNC_BODY | pwd_found = []
path = os.path.join(constant.profile["APPDATA"], u'Subversion\\auth\\svn.simple')
if os.path.exists(path):
for root, dirs, files in os.walk(path + os.sep):
for filename in files:
f = open(os.path.join(path, filename), 'r')
... | pwd_found = []
path = os.path.join(constant.profile["APPDATA"], u'Subversion\\auth\\svn.simple')
if os.path.exists(path):
for root, dirs, files in os.walk(path + os.sep):
for filename in files:
f = open(os.path.join(path, filename), 'r')
... | 138 | 62 | 484 | 546 | # -*- coding: utf-8 -*-
import base64
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
import os
class Tortoise(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'tortoise', 'svn', win... | # -*- coding: utf-8 -*-
import base64
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
import os
class Tortoise(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'tortoise', 'svn', win... |
530 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/apachedirectorystudio.py | 44,45 | 10,63 | run | ApacheDirectoryStudio | 48,63 | 45,63 | class ApacheDirectoryStudio(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'apachedirectorystudio', 'sysadmin')
# Interesting XML attributes in ADS connection configuration
self.attr_to_extract = ["host", "port", "bindPrincipal", "bindPassword", "authMethod"]
def extract_co... | class ApacheDirectoryStudio(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'apachedirectorystudio', 'sysadmin')
# Interesting XML attributes in ADS connection configuration
self.attr_to_extract = ["host", "port", "bindPrincipal", "bindPassword", "authMethod"]
def extract_co... | # Extract all available connections credentials
repos_creds = self.extract_connections_credentials()
# Parse and process the list of connections credentials
pwd_found = []
for creds in repos_creds:
pwd_found.append({
"Host" : creds["h... | """
Main function
"""
# Extract all available connections credentials
repos_creds = self.extract_connections_credentials()
# Parse and process the list of connections credentials
pwd_found = []
for creds in repos_creds:
pwd_found.append({
... | 44 | 410 | 161 | 571 | # -*- coding: utf-8 -*-
from xml.etree.ElementTree import parse
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import *
import os
class ApacheDirectoryStudio(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'apachedirectorystudio', 'sysadmin')
# Intere... | # -*- coding: utf-8 -*-
from xml.etree.ElementTree import parse
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import *
import os
class ApacheDirectoryStudio(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'apachedirectorystudio', 'sysadmin')
# Intere... |
531 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/coreftp.py | 25,26 | 13,59 | run | CoreFTP | 26,59 | 26,59 | class CoreFTP(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'coreftp', 'sysadmin')
self._secret = b"hdfzpysvpzimorhk"
def decrypt(self, hex):
encoded = binascii.unhexlify(hex)
aes = AESModeOfOperationECB(self._secret)
decrypted = aes.decrypt(encoded)
... | class CoreFTP(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'coreftp', 'sysadmin')
self._secret = b"hdfzpysvpzimorhk"
def decrypt(self, hex):
encoded = binascii.unhexlify(hex)
aes = AESModeOfOperationECB(self._secret)
decrypted = aes.decrypt(encoded)
... | key = None
pwd_found = []
try:
key = OpenKey(HKEY_CURRENT_USER, 'Software\\FTPware\\CoreFTP\\Sites')
except Exception as e:
self.debug(str(e))
if key:
num_profiles = winreg.QueryInfoKey(key)[0]
elements = ['Host', 'Port', 'User', '... | key = None
pwd_found = []
try:
key = OpenKey(HKEY_CURRENT_USER, 'Software\\FTPware\\CoreFTP\\Sites')
except Exception as e:
self.debug(str(e))
if key:
num_profiles = winreg.QueryInfoKey(key)[0]
elements = ['Host', 'Port', 'User', '... | 86 | 150 | 368 | 518 | # -*- coding: utf-8 -*-
import binascii
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationECB
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_CURRENT_USER
class CoreFTP(Module... | # -*- coding: utf-8 -*-
import binascii
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.crypto.pyaes.aes import AESModeOfOperationECB
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_CURRENT_USER
class CoreFTP(Module... |
532 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/cyberduck.py | 28,29 | 14,49 | run | Cyberduck | 29,49 | 29,49 | class Cyberduck(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'cyberduck', 'sysadmin', winapi_used=True)
# find the user.config file containing passwords
def get_application_path(self):
directory = os.path.join(constant.profile['APPDATA'], u'Cyberduck')
if os.path.exist... | class Cyberduck(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'cyberduck', 'sysadmin', winapi_used=True)
# find the user.config file containing passwords
def get_application_path(self):
directory = os.path.join(constant.profile['APPDATA'], u'Cyberduck')
if os.path.exist... | xml_file = self.get_application_path()
if xml_file and os.path.exists(xml_file):
tree = ElementTree(file=xml_file)
pwd_found = []
for elem in tree.iter():
try:
if elem.attrib['name'].startswith('ftp') or elem.attrib['name'].startsw... | xml_file = self.get_application_path()
if xml_file and os.path.exists(xml_file):
tree = ElementTree(file=xml_file)
pwd_found = []
for elem in tree.iter():
try:
if elem.attrib['name'].startswith('ftp') or elem.attrib['name'].startsw... | 51 | 220 | 301 | 521 | # -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
from lazagne.config.winstructure import string_to_unicode
import os
cl... | # -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
from lazagne.config.winstructure import string_to_unicode
import os
cl... |
534 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/filezillaserver.py | 14,15 | 10,43 | run | FilezillaServer | 15,43 | 15,43 | class FilezillaServer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'filezillaserver', 'sysadmin')
def run(self):
FILL_FUNC_BODY | class FilezillaServer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'filezillaserver', 'sysadmin')
def run(self):
FILL_FUNC_BODY | path = os.path.join(constant.profile['APPDATA'], u'FileZilla Server')
if os.path.exists(path):
pwd_found = []
file = u'FileZilla Server Interface.xml'
xml_file = os.path.join(path, file)
if os.path.exists(xml_file):
tree = ElementTree(fil... | path = os.path.join(constant.profile['APPDATA'], u'FileZilla Server')
if os.path.exists(path):
pwd_found = []
file = u'FileZilla Server Interface.xml'
xml_file = os.path.join(path, file)
if os.path.exists(xml_file):
tree = ElementTree(fil... | 100 | 55 | 305 | 360 | # -*- coding: utf-8 -*-
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class FilezillaServer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'filezillaserver', 'sysadmin')
def run(sel... | # -*- coding: utf-8 -*-
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class FilezillaServer(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'filezillaserver', 'sysadmin')
def run(sel... |
535 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/ftpnavigator.py | 20,21 | 10,45 | run | FtpNavigator | 21,45 | 21,45 | class FtpNavigator(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'ftpnavigator', 'sysadmin', system_module=True)
def decode(self, encode_password):
password = ''
for p in encode_password:
password += chr(struct.unpack('B', p)[0] ^ 0x19)
return password
... | class FtpNavigator(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'ftpnavigator', 'sysadmin', system_module=True)
def decode(self, encode_password):
password = ''
for p in encode_password:
password += chr(struct.unpack('B', p)[0] ^ 0x19)
return password
... | path = os.path.join(constant.profile['HOMEDRIVE'], u'\\FTP Navigator', u'Ftplist.txt')
elements = {'Name': 'Name', 'Server': 'Host', 'Port': 'Port', 'User': 'Login', 'Password': 'Password'}
if os.path.exists(path):
pwd_found = []
with open(path, 'r') as f:
... | path = os.path.join(constant.profile['HOMEDRIVE'], u'\\FTP Navigator', u'Ftplist.txt')
elements = {'Name': 'Name', 'Server': 'Host', 'Port': 'Port', 'User': 'Login', 'Password': 'Password'}
if os.path.exists(path):
pwd_found = []
with open(path, 'r') as f:
... | 99 | 117 | 315 | 432 | # -*- coding: utf-8 -*-
import struct
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class FtpNavigator(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'ftpnavigator', 'sysadmin', system_module=True)
def decode(self, encode_passw... | # -*- coding: utf-8 -*-
import struct
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class FtpNavigator(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'ftpnavigator', 'sysadmin', system_module=True)
def decode(self, encode_passw... |
536 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/iisapppool.py | 35,36 | 9,77 | run | IISAppPool | 36,77 | 36,77 | class IISAppPool(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='iisapppool', category='sysadmin', registry_used=True, winapi_used=True)
def find_files(self, path, file):
"""
Try to find all files with the same name
"""
founded_files = []
for dir... | class IISAppPool(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='iisapppool', category='sysadmin', registry_used=True, winapi_used=True)
def find_files(self, path, file):
"""
Try to find all files with the same name
"""
founded_files = []
for dir... | pfound = []
exe_files = self.find_files(os.environ['WINDIR'] + '\\System32\\inetsrv', 'appcmd.exe')
if len(exe_files) == 0:
self.debug(u'File not found appcmd.exe')
return
self.info(u'appcmd.exe files found: {files}'.format(files=exe_files))
output = sel... | pfound = []
exe_files = self.find_files(os.environ['WINDIR'] + '\\System32\\inetsrv', 'appcmd.exe')
if len(exe_files) == 0:
self.debug(u'File not found appcmd.exe')
return
self.info(u'appcmd.exe files found: {files}'.format(files=exe_files))
output = sel... | 105 | 285 | 465 | 750 | import fnmatch
import os
import subprocess
import re
import string
from lazagne.config.module_info import ModuleInfo
class IISAppPool(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='iisapppool', category='sysadmin', registry_used=True, winapi_used=True)
def find_files(self, path, fil... | import fnmatch
import os
import subprocess
import re
import string
from lazagne.config.module_info import ModuleInfo
class IISAppPool(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='iisapppool', category='sysadmin', registry_used=True, winapi_used=True)
def find_files(self, path, fil... |
537 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/keepassconfig.py | 15,16 | 9,117 | run | KeePassConfig | 19,117 | 16,117 | class KeePassConfig(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'keepassconfig', 'sysadmin')
self.attr_to_extract = ["Keyfile", "Database", "Type"]
def run(self):
FILL_FUNC_BODY | class KeePassConfig(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'keepassconfig', 'sysadmin')
self.attr_to_extract = ["Keyfile", "Database", "Type"]
def run(self):
"""
Main function
"""
FILL_FUNC_BODY |
pwd_found = []
#Keepass1
connection_file_directory = os.path.join(constant.profile['APPDATA'], u'KeePass')
if os.path.exists(connection_file_directory):
connection_file_location = os.path.join(connection_file_directory, u'KeePass.ini')
if os.path.isfile(connecti... | """
Main function
"""
pwd_found = []
#Keepass1
connection_file_directory = os.path.join(constant.profile['APPDATA'], u'KeePass')
if os.path.exists(connection_file_directory):
connection_file_location = os.path.join(connection_file_directory, u'KeePas... | 265 | 86 | 1,250 | 1,336 | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import *
import os
from xml.etree.ElementTree import parse
class KeePassConfig(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'keepassconfig', 'sysadmin')
self.attr_to_extract = ["... | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import *
import os
from xml.etree.ElementTree import parse
class KeePassConfig(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'keepassconfig', 'sysadmin')
self.attr_to_extract = ["... |
538 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/mRemoteNG.py | 42,43 | 28,186 | gcm_decrypt | mRemoteNG | 43,86 | 43,86 | class mRemoteNG(ModuleInfo):
"""
This class searches for and decrypts mRemoteNG passwords.
"""
def __init__(self):
self.files = self.get_configuration_files()
self.password = "mR3m"
self.success_coutner = 0
self.errors_counter = 0
ModuleInfo.__init__(self, "mRe... | class mRemoteNG(ModuleInfo):
"""
This class searches for and decrypts mRemoteNG passwords.
"""
def __init__(self):
self.files = self.get_configuration_files()
self.password = "mR3m"
self.success_coutner = 0
self.errors_counter = 0
ModuleInfo.__init__(self, "mRe... |
"""
This function decrypts GCM passwords.
"""
password_buffer = BytesIO(password)
salt = password_buffer.read(16)
nonce = password_buffer.read(16)
if not nonce:
print_debug(
"DEBUG",
"Blank password.",
)
... |
"""
This function decrypts GCM passwords.
"""
password_buffer = BytesIO(password)
salt = password_buffer.read(16)
nonce = password_buffer.read(16)
if not nonce:
print_debug(
"DEBUG",
"Blank password.",
)
... | 81 | 854 | 355 | 1,209 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module requires LaZagne: https://github.com/AlessandroZ/LaZagne/releases/
Current source: https://github.com/AlessandroZ/LaZagne
"""
__version__ = "1.0.0"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
__source__ = "https://githu... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module requires LaZagne: https://github.com/AlessandroZ/LaZagne/releases/
Current source: https://github.com/AlessandroZ/LaZagne
"""
__version__ = "1.0.0"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
__source__ = "https://githu... |
539 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/opensshforwindows.py | 42,43 | 9,91 | extract_private_keys_unprotected | OpenSSHForWindows | 48,76 | 43,76 | class OpenSSHForWindows(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'opensshforwindows', 'sysadmin')
#self.key_files_location = os.path.join(constant.profile["USERPROFILE"], u'.ssh')
# Retrieve SSH private key even if a passphrase is set (the goal is to remove crypto dependency)... | class OpenSSHForWindows(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'opensshforwindows', 'sysadmin')
#self.key_files_location = os.path.join(constant.profile["USERPROFILE"], u'.ssh')
# Retrieve SSH private key even if a passphrase is set (the goal is to remove crypto dependency)... | keys = []
if os.path.isdir(self.key_files_location):
for (dirpath, dirnames, filenames) in os.walk(self.key_files_location, followlinks=True):
for f in filenames:
key_file_path = os.path.join(dirpath, f)
if os.path.isfile(key_file_path)... | """
Extract all DSA/RSA private keys that are not protected with a passphrase.
:return: List of encoded key (key file content)
"""
keys = []
if os.path.isdir(self.key_files_location):
for (dirpath, dirnames, filenames) in os.walk(self.key_files_location, foll... | 119 | 623 | 399 | 1,022 | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
# from Crypto.PublicKey import RSA
# from Crypto.PublicKey import DSA
import os
class OpenSSHForWindows(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'opensshforwindows', 's... | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
# from Crypto.PublicKey import RSA
# from Crypto.PublicKey import DSA
import os
class OpenSSHForWindows(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'opensshforwindows', 's... |
540 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/openvpn.py | 31,32 | 12,57 | get_credentials | OpenVPN | 32,51 | 32,51 | class OpenVPN(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='openvpn', category='sysadmin', registry_used=True, winapi_used=True)
def check_openvpn_installed(self):
try:
key = OpenKey(HKEY_CURRENT_USER, 'Software\\OpenVPN-GUI\\Configs')
return key
... | class OpenVPN(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, name='openvpn', category='sysadmin', registry_used=True, winapi_used=True)
def check_openvpn_installed(self):
try:
key = OpenKey(HKEY_CURRENT_USER, 'Software\\OpenVPN-GUI\\Configs')
return key
... | pwd_found = []
num_profiles = winreg.QueryInfoKey(key)[0]
for n in range(num_profiles):
name_skey = winreg.EnumKey(key, n)
skey = OpenKey(key, name_skey)
values = {'Profile': name_skey}
try:
encrypted_password = winreg.QueryValueEx(... | pwd_found = []
num_profiles = winreg.QueryInfoKey(key)[0]
for n in range(num_profiles):
name_skey = winreg.EnumKey(key, n)
skey = OpenKey(key, name_skey)
values = {'Profile': name_skey}
try:
encrypted_password = winreg.QueryValueEx(... | 48 | 297 | 244 | 541 | try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.winstructure import *
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
class OpenVPN(ModuleInfo):
def __init__(... | try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.winstructure import *
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
class OpenVPN(ModuleInfo):
def __init__(... |
541 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/puttycm.py | 33,34 | 15,52 | parse_xml | Puttycm | 34,52 | 34,52 | class Puttycm(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'puttycm', 'sysadmin', registry_used=True)
def run(self):
database_path = self.get_default_database()
if database_path and os.path.exists(database_path):
return self.parse_xml(database_path)
def ge... | class Puttycm(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'puttycm', 'sysadmin', registry_used=True)
def run(self):
database_path = self.get_default_database()
if database_path and os.path.exists(database_path):
return self.parse_xml(database_path)
def ge... | xml_file = os.path.expanduser(database_path)
tree = ElementTree(file=xml_file)
root = tree.getroot()
pwd_found = []
elements = ['name', 'protocol', 'host', 'port', 'description', 'login', 'password']
for connection in root.iter('connection'):
children = conne... | xml_file = os.path.expanduser(database_path)
tree = ElementTree(file=xml_file)
root = tree.getroot()
pwd_found = []
elements = ['name', 'protocol', 'host', 'port', 'description', 'login', 'password']
for connection in root.iter('connection'):
children = conne... | 51 | 212 | 190 | 402 | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_CURRENT_USER, string_to_unicode
import os
class Puttycm(ModuleInfo... | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_CURRENT_USER, string_to_unicode
import os
class Puttycm(ModuleInfo... |
542 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/rclone.py | 52,53 | 21,72 | run | Rclone | 53,72 | 53,72 | class Rclone(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'rclone', 'sysadmin')
# -- https://github.com/rclone/rclone/blob/master/fs/config/obscure/obscure.go
self.secret_key = b"\x9c\x93\x5b\x48\x73\x0a\x55\x4d\x6b\xfd\x7c\x63\xc8\x86\xa9\x2b\xd3\x90\x19\x8e\xb8\x12\x8a\xfb\xf... | class Rclone(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'rclone', 'sysadmin')
# -- https://github.com/rclone/rclone/blob/master/fs/config/obscure/obscure.go
self.secret_key = b"\x9c\x93\x5b\x48\x73\x0a\x55\x4d\x6b\xfd\x7c\x63\xc8\x86\xa9\x2b\xd3\x90\x19\x8e\xb8\x12\x8a\xfb\xf... | pwd_found = []
path = os.path.join(constant.profile['APPDATA'], u'rclone', u'rclone.conf')
if os.path.exists(path):
cp = RawConfigParser()
cp.read(path)
for section in cp.sections():
values = {
"Name": section
... | pwd_found = []
path = os.path.join(constant.profile['APPDATA'], u'rclone', u'rclone.conf')
if os.path.exists(path):
cp = RawConfigParser()
cp.read(path)
for section in cp.sections():
values = {
"Name": section
... | 48 | 571 | 212 | 783 | # -*- coding: utf-8 -*-
# This code has been taken from https://github.com/maaaaz/rclonedeobscure
# All credits to maaaaz
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import base64
import json
import os
try:
from ConfigParser import RawConfigParser # Python 2.7... | # -*- coding: utf-8 -*-
# This code has been taken from https://github.com/maaaaz/rclonedeobscure
# All credits to maaaaz
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import base64
import json
import os
try:
from ConfigParser import RawConfigParser # Python 2.7... |
543 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/rdpmanager.py | 65,66 | 13,128 | run | RDPManager | 66,100 | 66,100 | class RDPManager(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'rdpmanager', 'sysadmin', winapi_used=True)
def decrypt_password(self, encrypted_password):
try:
decoded = base64.b64decode(encrypted_password)
password_decrypted_bytes = Win32CryptUnprotectData(... | class RDPManager(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'rdpmanager', 'sysadmin', winapi_used=True)
def decrypt_password(self, encrypted_password):
try:
decoded = base64.b64decode(encrypted_password)
password_decrypted_bytes = Win32CryptUnprotectData(... | settings = [
os.path.join(constant.profile['LOCALAPPDATA'],
u'Microsoft Corporation\\Remote Desktop Connection Manager\\RDCMan.settings'),
os.path.join(constant.profile['LOCALAPPDATA'],
u'Microsoft\\Remote Desktop Connection Manager\\RDCM... | settings = [
os.path.join(constant.profile['LOCALAPPDATA'],
u'Microsoft Corporation\\Remote Desktop Connection Manager\\RDCMan.settings'),
os.path.join(constant.profile['LOCALAPPDATA'],
u'Microsoft\\Remote Desktop Connection Manager\\RDCM... | 71 | 818 | 341 | 1,159 | # -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
import os
class RDPManager(ModuleInfo):
def __init__(self):
... | # -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import Win32CryptUnprotectData
from lazagne.config.constant import constant
import os
class RDPManager(ModuleInfo):
def __init__(self):
... |
544 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/unattended.py | 25,26 | 14,76 | run | Unattended | 26,76 | 26,76 | class Unattended(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'unattended', 'sysadmin', system_module=True)
# Password should be encoded in b64
def try_b64_decode(self, message):
try:
return base64.b64decode(message)
except Exception:
return mes... | class Unattended(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'unattended', 'sysadmin', system_module=True)
# Password should be encoded in b64
def try_b64_decode(self, message):
try:
return base64.b64decode(message)
except Exception:
return mes... |
windir = os.path.join(constant.profile['HOMEDRIVE'], string_to_unicode(os.sep), u'Windows')
files = [
'Panther\\Unattend.xml',
'Panther\\Unattended.xml',
'Panther\\Unattend\\Unattended.xml',
'Panther\\Unattend\\Unattend.xml',
'System32\\Syspre... |
windir = os.path.join(constant.profile['HOMEDRIVE'], string_to_unicode(os.sep), u'Windows')
files = [
'Panther\\Unattend.xml',
'Panther\\Unattended.xml',
'Panther\\Unattend\\Unattended.xml',
'Panther\\Unattend\\Unattend.xml',
'System32\\Syspre... | 142 | 114 | 686 | 800 | # -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
from lazagne.config.winstructure import string_to_unicode
import os
class Unattended(ModuleInfo):
def __init__(self):
Mod... | # -*- coding: utf-8 -*-
import base64
from xml.etree.cElementTree import ElementTree
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
from lazagne.config.winstructure import string_to_unicode
import os
class Unattended(ModuleInfo):
def __init__(self):
Mod... |
545 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/winscp.py | 121,122 | 11,130 | run | WinSCP | 122,130 | 122,130 | class WinSCP(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'winscp', 'sysadmin', registry_used=True)
self.hash = ''
# ------------------------------ Getters and Setters ------------------------------
def decrypt_char(self):
hex_flag = 0xA3
charset = '0123456789A... | class WinSCP(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'winscp', 'sysadmin', registry_used=True)
self.hash = ''
# ------------------------------ Getters and Setters ------------------------------
def decrypt_char(self):
hex_flag = 0xA3
charset = '0123456789A... | winscp_key = self.check_winscp_installed()
if winscp_key:
if not self.check_masterPassword(winscp_key):
results = self.get_credentials()
if results:
return results
else:
self.warning(u'A master password is used. ... | winscp_key = self.check_winscp_installed()
if winscp_key:
if not self.check_masterPassword(winscp_key):
results = self.get_credentials()
if results:
return results
else:
self.warning(u'A master password is used. ... | 25 | 1,006 | 97 | 1,103 | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_CURRENT_USER
class WinSCP(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'winscp', 'sysadmi... | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_CURRENT_USER
class WinSCP(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'winscp', 'sysadmi... |
546 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/sysadmin/wsl.py | 13,14 | 9,45 | run | Wsl | 14,45 | 14,45 | class Wsl(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'wsl', 'sysadmin')
def run(self):
FILL_FUNC_BODY | class Wsl(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'wsl', 'sysadmin')
def run(self):
FILL_FUNC_BODY | pwd_found = []
shadow_files_list = []
# Old WSL PATH
old_path = os.path.join(constant.profile['LOCALAPPDATA'], u'lxss\\rootfs\\etc\\shadow')
if os.path.exists(old_path):
shadow_files_list.append(old_path)
# New WSL PATH need to look into Package folder
... | pwd_found = []
shadow_files_list = []
# Old WSL PATH
old_path = os.path.join(constant.profile['LOCALAPPDATA'], u'lxss\\rootfs\\etc\\shadow')
if os.path.exists(old_path):
shadow_files_list.append(old_path)
# New WSL PATH need to look into Package folder
... | 96 | 51 | 391 | 442 | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class Wsl(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'wsl', 'sysadmin')
def run(self):
FILL_FUNC_BODY | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class Wsl(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'wsl', 'sysadmin')
def run(self):
FILL_FUNC_BODY |
547 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/wifi/wifi.py | 54,55 | 14,108 | run | Wifi | 55,108 | 55,108 | class Wifi(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'wifi', 'wifi')
def decrypt_using_lsa_secret(self, key):
"""
Needs admin priv but will work with all systems
"""
if constant.system_dpapi and constant.system_dpapi.unlocked:
decrypted_blob ... | class Wifi(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'wifi', 'wifi')
def decrypt_using_lsa_secret(self, key):
"""
Needs admin priv but will work with all systems
"""
if constant.system_dpapi and constant.system_dpapi.unlocked:
decrypted_blob ... | # Run the module only once
if not constant.wifi_password:
interfaces_dir = os.path.join(constant.profile['ALLUSERSPROFILE'],
u'Microsoft\\Wlansvc\\Profiles\\Interfaces')
# for windows Vista or higher
if os.path.exists(interfa... | # Run the module only once
if not constant.wifi_password:
interfaces_dir = os.path.join(constant.profile['ALLUSERSPROFILE'],
u'Microsoft\\Wlansvc\\Profiles\\Interfaces')
# for windows Vista or higher
if os.path.exists(interfa... | 137 | 441 | 590 | 1,031 | # -*- coding: utf-8 -*-
import os
import sys
import traceback
from xml.etree.cElementTree import ElementTree
from subprocess import Popen, PIPE
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import python_version
class Wifi(ModuleInfo)... | # -*- coding: utf-8 -*-
import os
import sys
import traceback
from xml.etree.cElementTree import ElementTree
from subprocess import Popen, PIPE
from lazagne.config.constant import constant
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import python_version
class Wifi(ModuleInfo)... |
548 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/autologon.py | 18,19 | 14,51 | run | Autologon | 19,51 | 19,51 | class Autologon(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'autologon', 'windows', registry_used=True, system_module=True)
def run(self):
FILL_FUNC_BODY | class Autologon(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'autologon', 'windows', registry_used=True, system_module=True)
def run(self):
FILL_FUNC_BODY | pwd_found = []
try:
hkey = OpenKey(HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon')
if int(winreg.QueryValueEx(hkey, 'AutoAdminLogon')[0]) == 1:
self.debug(u'Autologin enabled')
keys = {
'Default... | pwd_found = []
try:
hkey = OpenKey(HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon')
if int(winreg.QueryValueEx(hkey, 'AutoAdminLogon')[0]) == 1:
self.debug(u'Autologin enabled')
keys = {
'Default... | 62 | 64 | 296 | 360 | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
# Password are stored in cleartext on old system (< 2008 R2 and < Win7)
# If enabled on recent system, the password should be vi... | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
# Password are stored in cleartext on old system (< 2008 R2 and < Win7)
# If enabled on recent system, the password should be vi... |
549 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/cachedump.py | 12,13 | 8,20 | run | Cachedump | 13,20 | 13,20 | class Cachedump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'mscache', 'windows', system_module=True)
def run(self):
FILL_FUNC_BODY | class Cachedump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'mscache', 'windows', system_module=True)
def run(self):
FILL_FUNC_BODY | is_vista_or_higher = False
if float(get_os_version()) >= 6.0:
is_vista_or_higher = True
mscache = dump_file_hashes(constant.hives['system'], constant.hives['security'], is_vista_or_higher)
if mscache:
return ['__MSCache__', mscache]
| is_vista_or_higher = False
if float(get_os_version()) >= 6.0:
is_vista_or_higher = True
mscache = dump_file_hashes(constant.hives['system'], constant.hives['security'], is_vista_or_higher)
if mscache:
return ['__MSCache__', mscache]
| 20 | 58 | 107 | 165 | # -*- coding: utf-8 -*-
from .creddump7.win32.domcachedump import dump_file_hashes
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
class Cachedump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(sel... | # -*- coding: utf-8 -*-
from .creddump7.win32.domcachedump import dump_file_hashes
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
class Cachedump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(sel... |
550 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/addrspace.py | 58,59 | 36,73 | get_address_range | FileAddressSpace | 59,61 | 59,61 | class FileAddressSpace:
def __init__(self, fname, mode='rb', fast=False):
self.fname = fname
self.name = fname
self.fhandle = open(fname, mode)
self.fsize = os.path.getsize(fname)
if fast:
self.fast_fhandle = open(fname, mode)
def fread(self, len):
r... | class FileAddressSpace:
def __init__(self, fname, mode='rb', fast=False):
self.fname = fname
self.name = fname
self.fhandle = open(fname, mode)
self.fsize = os.path.getsize(fname)
if fast:
self.fast_fhandle = open(fname, mode)
def fread(self, len):
r... | return [0, self.fsize - 1]
| return [0, self.fsize - 1]
| 5 | 310 | 17 | 327 | # Volatility
# Copyright (C) 2007 Volatile Systems
#
# Original Source:
# Copyright (C) 2004,2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | # Volatility
# Copyright (C) 2007 Volatile Systems
#
# Original Source:
# Copyright (C) 2004,2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... |
551 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/addrspace.py | 84,85 | 76,145 | read | HiveFileAddressSpace | 85,136 | 85,136 | class HiveFileAddressSpace:
def __init__(self, fname):
self.fname = fname
self.base = FileAddressSpace(fname)
def vtop(self, vaddr):
return vaddr + BLOCK_SIZE + 4
def read(self, vaddr, length, zero=False):
FILL_FUNC_BODY def read_long_phys(self, addr):
string = self.base... | class HiveFileAddressSpace:
def __init__(self, fname):
self.fname = fname
self.base = FileAddressSpace(fname)
def vtop(self, vaddr):
return vaddr + BLOCK_SIZE + 4
def read(self, vaddr, length, zero=False):
FILL_FUNC_BODY def read_long_phys(self, addr):
string = self.base... | first_block = BLOCK_SIZE - vaddr % BLOCK_SIZE
full_blocks = int((length + (vaddr % BLOCK_SIZE)) / BLOCK_SIZE) - 1
left_over = (length + vaddr) % BLOCK_SIZE
paddr = self.vtop(vaddr)
if not paddr and zero:
if length < first_block:
return "\0" * length
... | first_block = BLOCK_SIZE - vaddr % BLOCK_SIZE
full_blocks = int((length + (vaddr % BLOCK_SIZE)) / BLOCK_SIZE) - 1
left_over = (length + vaddr) % BLOCK_SIZE
paddr = self.vtop(vaddr)
if not paddr and zero:
if length < first_block:
return "\0" * length
... | 181 | 194 | 557 | 751 | # Volatility
# Copyright (C) 2007 Volatile Systems
#
# Original Source:
# Copyright (C) 2004,2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | # Volatility
# Copyright (C) 2007 Volatile Systems
#
# Original Source:
# Copyright (C) 2004,2005,2006 4tphi Research
# Author: {npetroni,awalters}@4tphi.net (Nick Petroni and AAron Walters)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... |
553 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 125,126 | 48,182 | members | Obj | 127,133 | 126,133 | class Obj(object):
"""Base class for all objects.
May return a subclass for certain data types to allow
for special handling.
"""
def __new__(typ, name, address, space):
if name in globals():
# This is a bit of "magic"
# Could be replaced with a dict ma... | class Obj(object):
"""Base class for all objects.
May return a subclass for certain data types to allow
for special handling.
"""
def __new__(typ, name, address, space):
if name in globals():
# This is a bit of "magic"
# Could be replaced with a dict ma... |
# Could also just return the list
membs = [(k, v[0]) for k,v in types[self.name][1].items()]
membs.sort(key=itemgetter(1))
return list(map(itemgetter(0),membs)) + self.extra_members
| """Return a list of this object's members, sorted by offset."""
# Could also just return the list
membs = [(k, v[0]) for k,v in types[self.name][1].items()]
membs.sort(key=itemgetter(1))
return list(map(itemgetter(0),membs)) + self.extra_members
| 20 | 1,251 | 83 | 1,334 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
554 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 243,244 | 209,247 | members | Pointer | 244,247 | 244,247 | class Pointer(Obj):
"""Class to represent pointers.
value : the object pointed to
If an attribute is not found in this instance,
the attribute will be looked up in the referenced
object."""
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj... | class Pointer(Obj):
"""Class to represent pointers.
value : the object pointed to
If an attribute is not found in this instance,
the attribute will be looked up in the referenced
object."""
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj... | return self.value.members()
| return self.value.members()
| 2 | 388 | 14 | 402 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
555 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 205,206 | 182,209 | members | Primitive | 206,209 | 206,209 | class Primitive(Obj):
"""Class to represent a primitive data type.
Attributes:
value : the python primitive value of this type
"""
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def __init__(self, name, address, space):
super(Pri... | class Primitive(Obj):
"""Class to represent a primitive data type.
Attributes:
value : the python primitive value of this type
"""
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def __init__(self, name, address, space):
super(Pri... | return []
| return []
| 2 | 197 | 9 | 206 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
556 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 294,295 | 289,303 | getList | _CHILD_LIST | 295,300 | 295,300 | class _CHILD_LIST(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getList(self):
FILL_FUNC_BODY List = property(fget=getList)
| class _CHILD_LIST(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getList(self):
FILL_FUNC_BODY List = property(fget=getList)
| lst = []
list_address = read_obj(self.space, types, ['_CHILD_LIST', 'List'], self.address)
for i in range(self.Count.value):
lst.append(Pointer("pointer", list_address+(i*4), self.space, ["_CM_KEY_VALUE"]))
return lst
| lst = []
list_address = read_obj(self.space, types, ['_CHILD_LIST', 'List'], self.address)
for i in range(self.Count.value):
lst.append(Pointer("pointer", list_address+(i*4), self.space, ["_CM_KEY_VALUE"]))
return lst
| 20 | 71 | 92 | 163 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
557 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 308,309 | 303,316 | getList | _CM_KEY_INDEX | 309,315 | 309,315 | class _CM_KEY_INDEX(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getList(self):
FILL_FUNC_BODY List = property(fget=getList)
| class _CM_KEY_INDEX(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getList(self):
FILL_FUNC_BODY List = property(fget=getList)
| lst = []
for i in range(self.Count.value):
# we are ignoring the hash value here
off, tp = get_obj_offset(types, ['_CM_KEY_INDEX', 'List', i*2])
lst.append(Pointer("pointer", self.address+off, self.space, ["_CM_KEY_NODE"]))
return lst
| lst = []
for i in range(self.Count.value):
# we are ignoring the hash value here
off, tp = get_obj_offset(types, ['_CM_KEY_INDEX', 'List', i*2])
lst.append(Pointer("pointer", self.address+off, self.space, ["_CM_KEY_NODE"]))
return lst
| 28 | 70 | 101 | 171 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
558 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 274,275 | 269,279 | getName | _CM_KEY_NODE | 275,276 | 275,276 | class _CM_KEY_NODE(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getName(self):
FILL_FUNC_BODY Name = property(fget=getName)
| class _CM_KEY_NODE(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getName(self):
FILL_FUNC_BODY Name = property(fget=getName)
| return read_string(self.space, types, ['_CM_KEY_NODE', 'Name'], self.address, self.NameLength.value)
| return read_string(self.space, types, ['_CM_KEY_NODE', 'Name'], self.address, self.NameLength.value)
| 7 | 71 | 36 | 107 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
559 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 284,285 | 279,289 | getName | _CM_KEY_VALUE | 285,286 | 285,286 | class _CM_KEY_VALUE(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getName(self):
FILL_FUNC_BODY Name = property(fget=getName)
| class _CM_KEY_VALUE(Obj):
def __new__(typ, *args, **kwargs):
obj = object.__new__(typ)
return obj
def getName(self):
FILL_FUNC_BODY Name = property(fget=getName)
| return read_string(self.space, types, ['_CM_KEY_VALUE', 'Name'], self.address, self.NameLength.value)
| return read_string(self.space, types, ['_CM_KEY_VALUE', 'Name'], self.address, self.NameLength.value)
| 7 | 71 | 36 | 107 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
560 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/newobj.py | 264,265 | 247,269 | getBuffer | _UNICODE_STRING | 265,266 | 265,266 | class _UNICODE_STRING(Obj):
"""Class representing a _UNICODE_STRING
Adds the following behavior:
* The Buffer attribute is presented as a Python string rather
than a pointer to an unsigned short.
* The __str__ method returns the value of the Buffer.
"""
def __new__(typ, *args, **kw... | class _UNICODE_STRING(Obj):
"""Class representing a _UNICODE_STRING
Adds the following behavior:
* The Buffer attribute is presented as a Python string rather
than a pointer to an unsigned short.
* The __str__ method returns the value of the Buffer.
"""
def __new__(typ, *args, **kw... | return read_unicode_string(self.space, types, [], self.address)
| return read_unicode_string(self.space, types, [], self.address)
| 5 | 161 | 22 | 183 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... |
561 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/win32/domcachedump.py | 73,74 | 1,147 | parse_decrypted_cache | 74,94 | 74,94 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | uname_off = 72
pad = 2 * ((uname_len // 2) % 2)
domain_off = uname_off + uname_len + pad
pad = 2 * ((domain_len // 2) % 2)
domain_name_off = domain_off + domain_len + pad
data_hash = dec_data[:0x10]
username = dec_data[uname_off:uname_off+uname_len]
username = username.decode('utf-16-l... | uname_off = 72
pad = 2 * ((uname_len // 2) % 2)
domain_off = uname_off + uname_len + pad
pad = 2 * ((domain_len // 2) % 2)
domain_name_off = domain_off + domain_len + pad
data_hash = dec_data[:0x10]
username = dec_data[uname_off:uname_off+uname_len]
username = username.decode('utf-16-l... | 64 | 1,369 | 271 | 1,640 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | |
562 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/win32/lsasecrets.py | 33,34 | 1,187 | get_lsa_key | 34,70 | 34,70 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | root = get_root(secaddr)
if not root:
return None
if vista:
enc_reg_key = open_key(root, [b"Policy", b"PolEKList"])
else:
enc_reg_key = open_key(root, [b"Policy", b"PolSecretEncryptionKey"])
if not enc_reg_key:
return None
enc_reg_value = enc_reg_key.ValueList.... | root = get_root(secaddr)
if not root:
return None
if vista:
enc_reg_key = open_key(root, [b"Policy", b"PolEKList"])
else:
enc_reg_key = open_key(root, [b"Policy", b"PolSecretEncryptionKey"])
if not enc_reg_key:
return None
enc_reg_value = enc_reg_key.ValueList.... | 77 | 1,466 | 420 | 1,886 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | |
563 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/creddump7/win32/rawreg.py | 50,51 | 1,85 | subkeys | 51,75 | 51,75 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | if stable:
k = 0
else:
k = 1
sk = (key.SubKeyLists[k]/["pointer", ["_CM_KEY_INDEX"]]).value
sub_list = []
if (sk.Signature.value == LH_SIG or
sk.Signature.value == LF_SIG):
sub_list = sk.List
elif sk.Signature.value == RI_SIG:
lfs = []
for i i... | if stable:
k = 0
else:
k = 1
sk = (key.SubKeyLists[k]/["pointer", ["_CM_KEY_INDEX"]]).value
sub_list = []
if (sk.Signature.value == LH_SIG or
sk.Signature.value == LF_SIG):
sub_list = sk.List
elif sk.Signature.value == RI_SIG:
lfs = []
for i i... | 66 | 563 | 261 | 824 | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | # This file is part of creddump.
#
# creddump is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# creddump is distributed in the hope t... | |
564 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/credfiles.py | 11,12 | 7,23 | run | CredFiles | 12,23 | 12,23 | class CredFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY | class CredFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY | pwd_found = []
if constant.user_dpapi and constant.user_dpapi.unlocked:
creds_directory = os.path.join(constant.profile['APPDATA'], u'Microsoft', u'Credentials')
if os.path.exists(creds_directory):
for cred_file in os.listdir(creds_directory):
... | pwd_found = []
if constant.user_dpapi and constant.user_dpapi.unlocked:
creds_directory = os.path.join(constant.profile['APPDATA'], u'Microsoft', u'Credentials')
if os.path.exists(creds_directory):
for cred_file in os.listdir(creds_directory):
... | 39 | 59 | 174 | 233 | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class CredFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class CredFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY |
565 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/credman.py | 10,11 | 6,35 | run | Credman | 11,35 | 11,35 | class Credman(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credman', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY | class Credman(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credman', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY | pwd_found = []
# FOR XP
# - password are encrypted with specific salt depending on its Type
# entropy = 'abe2869f-9b47-4cd9-a358-c22904dba7f7\\0' # FOR CRED_TYPE_GENERIC
# entropy = '82BD0E67-9FEA-4748-8672-D5EFE5B779B0\\0' # FOR CRED_TYPE_DOMAIN_VISIBLE_PASSWORD
# CryptU... | pwd_found = []
# FOR XP
# - password are encrypted with specific salt depending on its Type
# entropy = 'abe2869f-9b47-4cd9-a358-c22904dba7f7\\0' # FOR CRED_TYPE_GENERIC
# entropy = '82BD0E67-9FEA-4748-8672-D5EFE5B779B0\\0' # FOR CRED_TYPE_DOMAIN_VISIBLE_PASSWORD
# CryptU... | 83 | 61 | 427 | 488 | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
class Credman(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credman', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
class Credman(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'credman', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY |
566 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/hashdump.py | 11,12 | 7,16 | run | Hashdump | 12,16 | 12,16 | class Hashdump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'hashdump', 'windows', system_module=True)
def run(self):
FILL_FUNC_BODY | class Hashdump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'hashdump', 'windows', system_module=True)
def run(self):
FILL_FUNC_BODY | hashdump = dump_file_hashes(constant.hives['system'], constant.hives['sam'])
if hashdump:
pwd_found = ['__Hashdump__', hashdump]
return pwd_found
| hashdump = dump_file_hashes(constant.hives['system'], constant.hives['sam'])
if hashdump:
pwd_found = ['__Hashdump__', hashdump]
return pwd_found
| 12 | 56 | 59 | 115 | # -*- coding: utf-8 -*-
from .creddump7.win32.hashdump import dump_file_hashes
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
class Hashdump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'hashdump', 'windows', system_module=True)
def run(s... | # -*- coding: utf-8 -*-
from .creddump7.win32.hashdump import dump_file_hashes
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
class Hashdump(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'hashdump', 'windows', system_module=True)
def run(s... |
567 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/lsa_secrets.py | 14,15 | 10,35 | run | LSASecrets | 15,35 | 15,35 | class LSASecrets(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'lsa_secrets', 'windows', system_module=True)
def run(self):
FILL_FUNC_BODY | class LSASecrets(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'lsa_secrets', 'windows', system_module=True)
def run(self):
FILL_FUNC_BODY |
# DPAPI structure could compute lsa secrets as well, so do not do it again
if constant.lsa_secrets:
return ['__LSASecrets__', constant.lsa_secrets]
is_vista_or_higher = False
if float(get_os_version()) >= 6.0:
is_vista_or_higher = True
# Get LSA Secrets... |
# DPAPI structure could compute lsa secrets as well, so do not do it again
if constant.lsa_secrets:
return ['__LSASecrets__', constant.lsa_secrets]
is_vista_or_higher = False
if float(get_os_version()) >= 6.0:
is_vista_or_higher = True
# Get LSA Secrets... | 75 | 63 | 277 | 340 | # -*- coding: utf-8 -*-
import struct
from .creddump7.win32.lsasecrets import get_file_secrets
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
class LSASecrets(ModuleInfo):
def __init__(self):
ModuleInf... | # -*- coding: utf-8 -*-
import struct
from .creddump7.win32.lsasecrets import get_file_secrets
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import get_os_version
from lazagne.config.constant import constant
class LSASecrets(ModuleInfo):
def __init__(self):
ModuleInf... |
568 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/vault.py | 11,12 | 7,71 | run | Vault | 12,71 | 12,71 | class Vault(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vault', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY | class Vault(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vault', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY |
# retrieve passwords (IE, etc.) using the Windows Vault API
if float(get_os_version()) < 6.1:
self.info(u'Vault not supported for this OS')
return
cbVaults = DWORD()
vaults = LPGUID()
hVault = HANDLE(INVALID_HANDLE_VALUE)
cbItems = DWORD()
... |
# retrieve passwords (IE, etc.) using the Windows Vault API
if float(get_os_version()) < 6.1:
self.info(u'Vault not supported for this OS')
return
cbVaults = DWORD()
vaults = LPGUID()
hVault = HANDLE(INVALID_HANDLE_VALUE)
cbItems = DWORD()
... | 142 | 61 | 676 | 737 | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
from ctypes.wintypes import *
class Vault(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vault', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import *
from ctypes.wintypes import *
class Vault(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vault', 'windows', only_from_current_user=True)
def run(self):
FILL_FUNC_BODY |
569 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/vaultfiles.py | 11,12 | 7,24 | run | VaultFiles | 12,24 | 12,24 | class VaultFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vaultfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY | class VaultFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vaultfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY |
pwd_found = []
if constant.user_dpapi and constant.user_dpapi.unlocked:
main_vault_directory = os.path.join(constant.profile['APPDATA'], u'..', u'Local', u'Microsoft', u'Vault')
main_vault_directory = os.path.abspath(main_vault_directory)
if os.path.exists(main_vaul... |
pwd_found = []
if constant.user_dpapi and constant.user_dpapi.unlocked:
main_vault_directory = os.path.join(constant.profile['APPDATA'], u'..', u'Local', u'Microsoft', u'Vault')
main_vault_directory = os.path.abspath(main_vault_directory)
if os.path.exists(main_vaul... | 32 | 60 | 197 | 257 | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class VaultFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vaultfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY | # -*- coding: utf-8 -*-
from lazagne.config.module_info import ModuleInfo
from lazagne.config.constant import constant
import os
class VaultFiles(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'vaultfiles', 'windows', dpapi_used=True)
def run(self):
FILL_FUNC_BODY |
570 | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne | /home/hieuvd/dung_repo/raw/stars_01/AlessandroZ_LaZagne/LaZagne/Windows/lazagne/softwares/windows/windows.py | 31,32 | 13,78 | run | WindowsPassword | 37,78 | 32,78 | class WindowsPassword(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'windows', 'windows')
self.current_user = get_username_winapi()
def is_in_domain(self):
"""
Return the context of the host
If a domain controller is set we are in an active directory.
... | class WindowsPassword(ModuleInfo):
def __init__(self):
ModuleInfo.__init__(self, 'windows', 'windows')
self.current_user = get_username_winapi()
def is_in_domain(self):
"""
Return the context of the host
If a domain controller is set we are in an active directory.
... | # Check if password has already been found
if constant.pypykatz_result.get(self.current_user, None):
if 'Password' in constant.pypykatz_result[self.current_user]:
# Password already printed on the Pypykatz module - do not print it again
self.info('User has alr... | """
- Check if the user password has already be found using Pypykatz
- If not, check if a password stored in another application is also used as windows password
- Windows password not found, return the DPAPI hash (not admin priv needed) to bruteforce using John or Hashcat
"""
... | 135 | 262 | 510 | 772 | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_LOCAL_MACHINE
from lazagne.config.constant import constant
from lazagne.config.users import get_username_winapi
clas... | # -*- coding: utf-8 -*-
try:
import _winreg as winreg
except ImportError:
import winreg
from lazagne.config.module_info import ModuleInfo
from lazagne.config.winstructure import OpenKey, HKEY_LOCAL_MACHINE
from lazagne.config.constant import constant
from lazagne.config.users import get_username_winapi
clas... |
575 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/cli/tests.py | 162,163 | 146,182 | test_add_arg_file | TestAdd | 163,174 | 163,174 | class TestAdd(unittest.TestCase):
def setUp(self):
os.makedirs(OUTPUT_DIR, exist_ok=True)
with output_hidden():
init()
def tearDown(self):
shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
def test_add_arg_url(self):
with output_hidden():
archivebox_add.... | class TestAdd(unittest.TestCase):
def setUp(self):
os.makedirs(OUTPUT_DIR, exist_ok=True)
with output_hidden():
init()
def tearDown(self):
shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
def test_add_arg_url(self):
with output_hidden():
archivebox_add.... | test_file = Path(OUTPUT_DIR) / 'test.txt'
with open(test_file, 'w+', encoding='utf') as f:
f.write(test_urls)
with output_hidden():
archivebox_add.main([test_file])
all_links = load_main_index(out_dir=OUTPUT_DIR)
assert len(all_links) == 12
os.re... | test_file = Path(OUTPUT_DIR) / 'test.txt'
with open(test_file, 'w+', encoding='utf') as f:
f.write(test_urls)
with output_hidden():
archivebox_add.main([test_file])
all_links = load_main_index(out_dir=OUTPUT_DIR)
assert len(all_links) == 12
os.re... | 23 | 259 | 128 | 387 | #!/usr/bin/env python3
__package__ = 'archivebox.cli'
import os
import sys
import shutil
import unittest
from pathlib import Path
from contextlib import contextmanager
TEST_CONFIG = {
'USE_COLOR': 'False',
'SHOW_PROGRESS': 'False',
'OUTPUT_DIR': 'data.tests',
'SAVE_ARCHIVE_DOT_ORG': 'False',
... | #!/usr/bin/env python3
__package__ = 'archivebox.cli'
import os
import sys
import shutil
import unittest
from pathlib import Path
from contextlib import contextmanager
TEST_CONFIG = {
'USE_COLOR': 'False',
'SHOW_PROGRESS': 'False',
'OUTPUT_DIR': 'data.tests',
'SAVE_ARCHIVE_DOT_ORG': 'False',
... |
576 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/cli/tests.py | 118,119 | 102,146 | test_conflicting_init | TestInit | 119,138 | 119,138 | class TestInit(unittest.TestCase):
def setUp(self):
os.makedirs(OUTPUT_DIR, exist_ok=True)
def tearDown(self):
shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
def test_basic_init(self):
with output_hidden():
archivebox_init.main([])
assert (Path(OUTPUT_DIR) / SQL... | class TestInit(unittest.TestCase):
def setUp(self):
os.makedirs(OUTPUT_DIR, exist_ok=True)
def tearDown(self):
shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
def test_basic_init(self):
with output_hidden():
archivebox_init.main([])
assert (Path(OUTPUT_DIR) / SQL... | with open(Path(OUTPUT_DIR) / 'test_conflict.txt', 'w+', encoding='utf-8') as f:
f.write('test')
try:
with output_hidden(show_failing=False):
archivebox_init.main([])
assert False, 'Init should have exited with an exception'
except SystemExit:
... | with open(Path(OUTPUT_DIR) / 'test_conflict.txt', 'w+', encoding='utf-8') as f:
f.write('test')
try:
with output_hidden(show_failing=False):
archivebox_init.main([])
assert False, 'Init should have exited with an exception'
except SystemExit:
... | 57 | 263 | 234 | 497 | #!/usr/bin/env python3
__package__ = 'archivebox.cli'
import os
import sys
import shutil
import unittest
from pathlib import Path
from contextlib import contextmanager
TEST_CONFIG = {
'USE_COLOR': 'False',
'SHOW_PROGRESS': 'False',
'OUTPUT_DIR': 'data.tests',
'SAVE_ARCHIVE_DOT_ORG': 'False',
... | #!/usr/bin/env python3
__package__ = 'archivebox.cli'
import os
import sys
import shutil
import unittest
from pathlib import Path
from contextlib import contextmanager
TEST_CONFIG = {
'USE_COLOR': 'False',
'SHOW_PROGRESS': 'False',
'OUTPUT_DIR': 'data.tests',
'SAVE_ARCHIVE_DOT_ORG': 'False',
... |
577 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/cli/tests.py | 207,208 | 182,223 | test_remove_domain | TestRemove | 208,214 | 208,214 | class TestRemove(unittest.TestCase):
def setUp(self):
os.makedirs(OUTPUT_DIR, exist_ok=True)
with output_hidden():
init()
archivebox_add.main([], stdin=test_urls)
# def tearDown(self):
# shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
def test_remove_exact(se... | class TestRemove(unittest.TestCase):
def setUp(self):
os.makedirs(OUTPUT_DIR, exist_ok=True)
with output_hidden():
init()
archivebox_add.main([], stdin=test_urls)
# def tearDown(self):
# shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
def test_remove_exact(se... | with output_hidden():
archivebox_remove.main(['--yes', '--delete', '--filter-type=domain', 'example5.com', 'example6.com'])
all_links = load_main_index(out_dir=OUTPUT_DIR)
assert len(all_links) == 10
| with output_hidden():
archivebox_remove.main(['--yes', '--delete', '--filter-type=domain', 'example5.com', 'example6.com'])
all_links = load_main_index(out_dir=OUTPUT_DIR)
assert len(all_links) == 10
| 14 | 375 | 84 | 459 | #!/usr/bin/env python3
__package__ = 'archivebox.cli'
import os
import sys
import shutil
import unittest
from pathlib import Path
from contextlib import contextmanager
TEST_CONFIG = {
'USE_COLOR': 'False',
'SHOW_PROGRESS': 'False',
'OUTPUT_DIR': 'data.tests',
'SAVE_ARCHIVE_DOT_ORG': 'False',
... | #!/usr/bin/env python3
__package__ = 'archivebox.cli'
import os
import sys
import shutil
import unittest
from pathlib import Path
from contextlib import contextmanager
TEST_CONFIG = {
'USE_COLOR': 'False',
'SHOW_PROGRESS': 'False',
'OUTPUT_DIR': 'data.tests',
'SAVE_ARCHIVE_DOT_ORG': 'False',
... |
578 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/core/migrations/0006_auto_20201012_1520.py | 6,7 | 1,71 | forwards_func | 7,24 | 7,24 | # Generated by Django 3.0.8 on 2020-10-12 15:20
from django.db import migrations, models
from django.utils.text import slugify
def forwards_func(apps, schema_editor):
FILL_FUNC_BODYdef reverse_func(apps, schema_editor):
SnapshotModel = apps.get_model("core", "Snapshot")
TagModel = apps.get_model("core", "Tag"... | # Generated by Django 3.0.8 on 2020-10-12 15:20
from django.db import migrations, models
from django.utils.text import slugify
def forwards_func(apps, schema_editor):
FILL_FUNC_BODYdef reverse_func(apps, schema_editor):
SnapshotModel = apps.get_model("core", "Snapshot")
TagModel = apps.get_model("core", "Tag"... | SnapshotModel = apps.get_model("core", "Snapshot")
TagModel = apps.get_model("core", "Tag")
db_alias = schema_editor.connection.alias
snapshots = SnapshotModel.objects.all()
for snapshot in snapshots:
tags = snapshot.tags
tag_set = (
set(tag.strip() for tag in (snapshot.... | SnapshotModel = apps.get_model("core", "Snapshot")
TagModel = apps.get_model("core", "Tag")
db_alias = schema_editor.connection.alias
snapshots = SnapshotModel.objects.all()
for snapshot in snapshots:
tags = snapshot.tags
tag_set = (
set(tag.strip() for tag in (snapshot.... | 44 | 556 | 196 | 752 | # Generated by Django 3.0.8 on 2020-10-12 15:20
from django.db import migrations, models
from django.utils.text import slugify
def forwards_func(apps, schema_editor):
FILL_FUNC_BODYdef reverse_func(apps, schema_editor):
SnapshotModel = apps.get_model("core", "Snapshot")
TagModel = apps.get_model("core", "Tag"... | # Generated by Django 3.0.8 on 2020-10-12 15:20
from django.db import migrations, models
from django.utils.text import slugify
def forwards_func(apps, schema_editor):
FILL_FUNC_BODYdef reverse_func(apps, schema_editor):
SnapshotModel = apps.get_model("core", "Snapshot")
TagModel = apps.get_model("core", "Tag"... | |
579 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/core/mixins.py | 6,7 | 5,22 | get_search_results | SearchResultsAdminMixin | 8,22 | 7,22 | class SearchResultsAdminMixin:
def get_search_results(self, request, queryset, search_term: str):
FILL_FUNC_BODY | class SearchResultsAdminMixin:
def get_search_results(self, request, queryset, search_term: str):
"""Enhances the search queryset with results from the search backend"""
FILL_FUNC_BODY |
qs, use_distinct = super().get_search_results(request, queryset, search_term)
search_term = search_term.strip()
if not search_term:
return qs.distinct(), use_distinct
try:
qsearch = query_search_index(search_term)
qs = qs | qsearch
ex... | """Enhances the search queryset with results from the search backend"""
qs, use_distinct = super().get_search_results(request, queryset, search_term)
search_term = search_term.strip()
if not search_term:
return qs.distinct(), use_distinct
try:
qs... | 57 | 59 | 193 | 252 | from django.contrib import messages
from archivebox.search import query_search_index
class SearchResultsAdminMixin:
def get_search_results(self, request, queryset, search_term: str):
FILL_FUNC_BODY | from django.contrib import messages
from archivebox.search import query_search_index
class SearchResultsAdminMixin:
def get_search_results(self, request, queryset, search_term: str):
"""Enhances the search queryset with results from the search backend"""
FILL_FUNC_BODY |
580 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/core/templatetags/core_tags.py | 14,16 | 1,41 | file_size | 16,22 | 16,22 | from django import template
from django.contrib.admin.templatetags.base import InclusionAdminNode
from typing import Union
register = template.Library()
@register.filter(name='split')
def split(value, separator: str=','):
return (value or '').split(separator)
@register.filter
def file_size(num_bytes: Union[in... | from django import template
from django.contrib.admin.templatetags.base import InclusionAdminNode
from typing import Union
register = template.Library()
@register.filter(name='split')
def split(value, separator: str=','):
return (value or '').split(separator)
@register.filter
def file_size(num_bytes: Union[in... | for count in ['Bytes','KB','MB','GB']:
if num_bytes > -1024.0 and num_bytes < 1024.0:
return '%3.1f %s' % (num_bytes, count)
num_bytes /= 1024.0
return '%3.1f %s' % (num_bytes, 'TB')
| for count in ['Bytes','KB','MB','GB']:
if num_bytes > -1024.0 and num_bytes < 1024.0:
return '%3.1f %s' % (num_bytes, count)
num_bytes /= 1024.0
return '%3.1f %s' % (num_bytes, 'TB')
| 27 | 264 | 100 | 364 | from django import template
from django.contrib.admin.templatetags.base import InclusionAdminNode
from typing import Union
register = template.Library()
@register.filter(name='split')
def split(value, separator: str=','):
return (value or '').split(separator)
@register.filter
def file_size(num_bytes: Union[in... | from django import template
from django.contrib.admin.templatetags.base import InclusionAdminNode
from typing import Union
register = template.Library()
@register.filter(name='split')
def split(value, separator: str=','):
return (value or '').split(separator)
@register.filter
def file_size(num_bytes: Union[in... | |
581 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/generic_html.py | 75,76 | 1,142 | did_urljoin_misbehave | 87,105 | 76,105 | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable, Optional
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
from html.parser import HTMLParser
from urllib.parse import urljoin
class Href... | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable, Optional
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
from html.parser import HTMLParser
from urllib.parse import urljoin
class Href... |
# if relative path is actually an absolute url, cut off its own scheme so we check the path component only
relative_path = relative_path.lower()
if relative_path.startswith('http://') or relative_path.startswith('https://'):
relative_path = relative_path.split('://', 1)[-1]
# TODO: properly fi... | """
Handle urljoin edge case bug where multiple slashes get turned into a single slash:
- https://github.com/python/cpython/issues/96015
- https://github.com/ArchiveBox/ArchiveBox/issues/1411
This workaround only fixes the most common case of a sub-URL inside an outer URL, e.g.:
https://web.... | 95 | 1,617 | 280 | 1,897 | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable, Optional
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
from html.parser import HTMLParser
from urllib.parse import urljoin
class Href... | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable, Optional
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
from html.parser import HTMLParser
from urllib.parse import urljoin
class Href... | |
582 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/generic_html.py | 24,25 | 19,31 | handle_starttag | HrefParser | 25,31 | 25,31 | class HrefParser(HTMLParser):
def __init__(self):
super().__init__()
self.urls = []
def handle_starttag(self, tag, attrs):
FILL_FUNC_BODY | class HrefParser(HTMLParser):
def __init__(self):
super().__init__()
self.urls = []
def handle_starttag(self, tag, attrs):
FILL_FUNC_BODY | if tag == "a":
for attr, value in attrs:
if attr == "href":
self.urls.append(value)
| if tag == "a":
for attr, value in attrs:
if attr == "href":
self.urls.append(value)
| 14 | 59 | 45 | 104 | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable, Optional
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
from html.parser import HTMLParser
from urllib.parse import urljoin
class Href... | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable, Optional
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
from html.parser import HTMLParser
from urllib.parse import urljoin
class Href... |
583 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/generic_json.py | 15,16 | 1,86 | jsonObjectToLink | 16,69 | 16,69 | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
# This gets used by generic_jsonl, too
def jsonObjectToLink(link: str, source: str):
FILL_FUNC_BODY@enforce... | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
# This gets used by generic_jsonl, too
def jsonObjectToLink(link: str, source: str):
FILL_FUNC_BODY@enforce... | json_date = lambda s: datetime.strptime(s, '%Y-%m-%dT%H:%M:%S%z')
# example line
# {"href":"http:\/\/www.reddit.com\/r\/example","description":"title here","extended":"","meta":"18a973f09c9cc0608c116967b64e0419","hash":"910293f019c2f4bb1a749fb937ba58e3","time":"2014-06-14T15:51:42Z","shared":"no","toread":... | json_date = lambda s: datetime.strptime(s, '%Y-%m-%dT%H:%M:%S%z')
# example line
# {"href":"http:\/\/www.reddit.com\/r\/example","description":"title here","extended":"","meta":"18a973f09c9cc0608c116967b64e0419","hash":"910293f019c2f4bb1a749fb937ba58e3","time":"2014-06-14T15:51:42Z","shared":"no","toread":... | 169 | 275 | 803 | 1,078 | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
# This gets used by generic_jsonl, too
def jsonObjectToLink(link: str, source: str):
FILL_FUNC_BODY@enforce... | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
# This gets used by generic_jsonl, too
def jsonObjectToLink(link: str, source: str):
FILL_FUNC_BODY@enforce... | |
584 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/generic_jsonl.py | 18,20 | 1,33 | parse_generic_jsonl_export | 21,30 | 20,30 | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from ..index.schema import Link
from ..util import (
enforce_types,
)
from .generic_json import jsonObjectToLink
def parse_line(line: str):
if line.strip() != "":
return json.loads(line)
@enforce_types
def parse_generic... | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from ..index.schema import Link
from ..util import (
enforce_types,
)
from .generic_json import jsonObjectToLink
def parse_line(line: str):
if line.strip() != "":
return json.loads(line)
@enforce_types
def parse_generic... |
json_file.seek(0)
links = [ parse_line(line) for line in json_file ]
for link in links:
if link:
yield jsonObjectToLink(link,json_file.name)
| """Parse JSONL format bookmarks export files"""
json_file.seek(0)
links = [ parse_line(line) for line in json_file ]
for link in links:
if link:
yield jsonObjectToLink(link,json_file.name)
| 18 | 179 | 69 | 248 | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from ..index.schema import Link
from ..util import (
enforce_types,
)
from .generic_json import jsonObjectToLink
def parse_line(line: str):
if line.strip() != "":
return json.loads(line)
@enforce_types
def parse_generic... | __package__ = 'archivebox.parsers'
import json
from typing import IO, Iterable
from ..index.schema import Link
from ..util import (
enforce_types,
)
from .generic_json import jsonObjectToLink
def parse_line(line: str):
if line.strip() != "":
return json.loads(line)
@enforce_types
def parse_generic... | |
585 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/generic_rss.py | 14,16 | 1,47 | parse_generic_rss_export | 17,44 | 16,44 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_generic_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_generic_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
... |
rss_file.seek(0)
feed = feedparser(rss_file.read())
for item in feed.entries:
url = item.link
title = item.title
time = mktime(item.updated_parsed)
try:
tags = ','.join(map(lambda tag: tag.term, item.tags))
except AttributeError:
tags = ''
... | """Parse RSS XML-format files into links"""
rss_file.seek(0)
feed = feedparser(rss_file.read())
for item in feed.entries:
url = item.link
title = item.title
time = mktime(item.updated_parsed)
try:
tags = ','.join(map(lambda tag: tag.term, item.tags))
... | 59 | 156 | 226 | 382 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_generic_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_generic_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
... | |
586 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/generic_txt.py | 16,18 | 1,53 | parse_generic_txt_export | 19,50 | 18,50 | __package__ = 'archivebox.parsers'
__description__ = 'Plain Text'
from typing import IO, Iterable
from datetime import datetime, timezone
from pathlib import Path
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
@enforce_types
def parse_generic_txt_export(... | __package__ = 'archivebox.parsers'
__description__ = 'Plain Text'
from typing import IO, Iterable
from datetime import datetime, timezone
from pathlib import Path
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
@enforce_types
def parse_generic_txt_export(... |
text_file.seek(0)
for line in text_file.readlines():
if not line.strip():
continue
# if the line is a local file path that resolves, then we can archive it
try:
if Path(line).exists():
yield Link(
url=line,
... | """Parse links from a text file, ignoring other text"""
text_file.seek(0)
for line in text_file.readlines():
if not line.strip():
continue
# if the line is a local file path that resolves, then we can archive it
try:
if Path(line).exists():
y... | 71 | 173 | 273 | 446 | __package__ = 'archivebox.parsers'
__description__ = 'Plain Text'
from typing import IO, Iterable
from datetime import datetime, timezone
from pathlib import Path
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
@enforce_types
def parse_generic_txt_export(... | __package__ = 'archivebox.parsers'
__description__ = 'Plain Text'
from typing import IO, Iterable
from datetime import datetime, timezone
from pathlib import Path
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
find_all_urls,
)
@enforce_types
def parse_generic_txt_export(... | |
587 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/medium_rss.py | 16,18 | 1,41 | parse_medium_rss_export | 19,38 | 18,38 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from xml.etree import ElementTree
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_medium_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
F... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from xml.etree import ElementTree
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_medium_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
... |
rss_file.seek(0)
root = ElementTree.parse(rss_file).getroot()
items = root.find("channel").findall("item") # type: ignore
for item in items:
url = item.find("link").text # type: ignore
title = item.find("title").text.strip() ... | """Parse Medium RSS feed files into links"""
rss_file.seek(0)
root = ElementTree.parse(rss_file).getroot()
items = root.find("channel").findall("item") # type: ignore
for item in items:
url = item.find("link").text # type: ignore
... | 54 | 161 | 235 | 396 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from xml.etree import ElementTree
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_medium_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
F... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from xml.etree import ElementTree
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_medium_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
... | |
588 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/netscape_html.py | 16,18 | 1,44 | parse_netscape_html_export | 19,41 | 18,41 | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_netscape_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKEY = '... | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_netscape_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse netscape... |
html_file.seek(0)
pattern = re.compile("<a href=\"(.+?)\" add_date=\"(\\d+)\"[^>]*>(.+)</a>", re.UNICODE | re.IGNORECASE)
for line in html_file:
# example line
# <DT><A HREF="https://example.com/?q=1+2" ADD_DATE="1497562974" LAST_MODIFIED="1497562974" ICON_URI="https://example.com/favicon.i... | """Parse netscape-format bookmarks export files (produced by all browsers)"""
html_file.seek(0)
pattern = re.compile("<a href=\"(.+?)\" add_date=\"(\\d+)\"[^>]*>(.+)</a>", re.UNICODE | re.IGNORECASE)
for line in html_file:
# example line
# <DT><A HREF="https://example.com/?q=1+2" ADD_DA... | 49 | 160 | 326 | 486 | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_netscape_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKEY = '... | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_netscape_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse netscape... | |
589 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/pinboard_rss.py | 14,16 | 1,49 | parse_pinboard_rss_export | 17,46 | 16,46 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_pinboard_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_pinboard_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:... |
rss_file.seek(0)
feed = feedparser(rss_file.read())
for item in feed.entries:
url = item.link
# title will start with "[priv] " if pin was marked private. useful?
title = item.title
time = mktime(item.updated_parsed)
# all tags are in one entry.tags with spaces in i... | """Parse Pinboard RSS feed files into links"""
rss_file.seek(0)
feed = feedparser(rss_file.read())
for item in feed.entries:
url = item.link
# title will start with "[priv] " if pin was marked private. useful?
title = item.title
time = mktime(item.updated_parsed)
... | 85 | 162 | 270 | 432 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_pinboard_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from time import mktime
from feedparser import parse as feedparser
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types
)
@enforce_types
def parse_pinboard_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:... | |
590 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/pocket_html.py | 16,18 | 1,44 | parse_pocket_html_export | 19,41 | 18,41 | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_pocket_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKEY = 'po... | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_pocket_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse Pocket-for... |
html_file.seek(0)
pattern = re.compile("^\\s*<li><a href=\"(.+)\" time_added=\"(\\d+)\" tags=\"(.*)\">(.+)</a></li>", re.UNICODE)
for line in html_file:
# example line
# <li><a href="http://example.com/ time_added="1478739709" tags="tag1,tag2">example title</a></li>
match = pattern.... | """Parse Pocket-format bookmarks export files (produced by getpocket.com/export/)"""
html_file.seek(0)
pattern = re.compile("^\\s*<li><a href=\"(.+)\" time_added=\"(\\d+)\" tags=\"(.*)\">(.+)</a></li>", re.UNICODE)
for line in html_file:
# example line
# <li><a href="http://example.com/... | 64 | 165 | 344 | 509 | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_pocket_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKEY = 'po... | __package__ = 'archivebox.parsers'
import re
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
)
@enforce_types
def parse_pocket_html_export(html_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse Pocket-for... | |
591 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/shaarli_rss.py | 15,17 | 1,56 | parse_shaarli_rss_export | 18,53 | 17,53 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_shaarli_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKEY ... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_shaarli_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse Shaar... |
rss_file.seek(0)
entries = rss_file.read().split('<entry>')[1:]
for entry in entries:
# example entry:
# <entry>
# <title>Aktuelle Trojaner-Welle: Emotet lauert in gefälschten Rechnungsmails | heise online</title>
# <link href="https://www.heise.de/security/meldung/Aktu... | """Parse Shaarli-specific RSS XML-format files into links"""
rss_file.seek(0)
entries = rss_file.read().split('<entry>')[1:]
for entry in entries:
# example entry:
# <entry>
# <title>Aktuelle Trojaner-Welle: Emotet lauert in gefälschten Rechnungsmails | heise online</title>
... | 94 | 171 | 662 | 833 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_shaarli_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKEY ... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_shaarli_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse Shaar... | |
592 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/url_list.py | 16,18 | 1,38 | parse_url_list | 19,35 | 18,35 | __package__ = 'archivebox.parsers'
__description__ = 'URL list'
import re
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
enforce_types,
URL_REGEX,
)
@enforce_types
def parse_url_list(text_file: IO[str], **_kwargs) -> Iterable[Lin... | __package__ = 'archivebox.parsers'
__description__ = 'URL list'
import re
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
enforce_types,
URL_REGEX,
)
@enforce_types
def parse_url_list(text_file: IO[str], **_kwargs) -> Iterable[Lin... |
text_file.seek(0)
for line in text_file.readlines():
url = line.strip()
if (not url) or not re.findall(URL_REGEX, url):
continue
yield Link(
url=url,
timestamp=str(datetime.now(timezone.utc).timestamp()),
title=None,
tags=None... | """Parse raw URLs from each line in a text file"""
text_file.seek(0)
for line in text_file.readlines():
url = line.strip()
if (not url) or not re.findall(URL_REGEX, url):
continue
yield Link(
url=url,
timestamp=str(datetime.now(timezone.utc).time... | 24 | 157 | 129 | 286 | __package__ = 'archivebox.parsers'
__description__ = 'URL list'
import re
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
enforce_types,
URL_REGEX,
)
@enforce_types
def parse_url_list(text_file: IO[str], **_kwargs) -> Iterable[Lin... | __package__ = 'archivebox.parsers'
__description__ = 'URL list'
import re
from typing import IO, Iterable
from datetime import datetime, timezone
from ..index.schema import Link
from ..util import (
enforce_types,
URL_REGEX,
)
@enforce_types
def parse_url_list(text_file: IO[str], **_kwargs) -> Iterable[Lin... | |
593 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/parsers/wallabag_atom.py | 15,17 | 1,69 | parse_wallabag_atom_export | 18,66 | 17,66 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_wallabag_atom_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKE... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_wallabag_atom_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse Wal... |
rss_file.seek(0)
entries = rss_file.read().split('<entry>')[1:]
for entry in entries:
# example entry:
# <entry>
# <title><![CDATA[Orient Ray vs Mako: Is There Much Difference? - iknowwatches.com]]></title>
# <link rel="alternate" type="text/html"
# ... | """Parse Wallabag Atom files into links"""
rss_file.seek(0)
entries = rss_file.read().split('<entry>')[1:]
for entry in entries:
# example entry:
# <entry>
# <title><![CDATA[Orient Ray vs Mako: Is There Much Difference? - iknowwatches.com]]></title>
# <link r... | 131 | 162 | 775 | 937 | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_wallabag_atom_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
FILL_FUNC_BODYKE... | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_wallabag_atom_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse Wal... | |
594 | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox | /home/hieuvd/dung_repo/raw/stars_01/ArchiveBox_ArchiveBox/ArchiveBox/archivebox/search/utils.py | 27,29 | 1,46 | get_indexable_content | 29,46 | 29,46 | from django.db.models import QuerySet
from archivebox.util import enforce_types
from archivebox.config import ANSI
def log_index_started(url):
print('{green}[*] Indexing url: {} in the search index {reset}'.format(url, **ANSI))
print( )
def get_file_result_content(res, extra_path, use_pwd=False):
if use_... | from django.db.models import QuerySet
from archivebox.util import enforce_types
from archivebox.config import ANSI
def log_index_started(url):
print('{green}[*] Indexing url: {} in the search index {reset}'.format(url, **ANSI))
print( )
def get_file_result_content(res, extra_path, use_pwd=False):
if use_... | if not results:
return []
# Only use the first method available
res, method = results.first(), results.first().extractor
if method not in ('readability', 'singlefile', 'dom', 'wget'):
return []
# This should come from a plugin interface
# TODO: banish this duplication and get th... | if not results:
return []
# Only use the first method available
res, method = results.first(), results.first().extractor
if method not in ('readability', 'singlefile', 'dom', 'wget'):
return []
# This should come from a plugin interface
# TODO: banish this duplication and get th... | 79 | 262 | 230 | 492 | from django.db.models import QuerySet
from archivebox.util import enforce_types
from archivebox.config import ANSI
def log_index_started(url):
print('{green}[*] Indexing url: {} in the search index {reset}'.format(url, **ANSI))
print( )
def get_file_result_content(res, extra_path, use_pwd=False):
if use_... | from django.db.models import QuerySet
from archivebox.util import enforce_types
from archivebox.config import ANSI
def log_index_started(url):
print('{green}[*] Indexing url: {} in the search index {reset}'.format(url, **ANSI))
print( )
def get_file_result_content(res, extra_path, use_pwd=False):
if use_... | |
814 | /home/hieuvd/dung_repo/raw/stars_01/EpistasisLab_tpot/tpot | /home/hieuvd/dung_repo/raw/stars_01/EpistasisLab_tpot/tpot/setup.py | 6,7 | 1,67 | calculate_version | 7,12 | 7,12 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
def calculate_version():
FILL_FUNC_BODYpackage_version = calculate_version()
setup(
name='TPOT',
version=package_version,
author='Randal S. Olson',
author_email='rso@randalolson.com',
packages=find_packages(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
def calculate_version():
FILL_FUNC_BODYpackage_version = calculate_version()
setup(
name='TPOT',
version=package_version,
author='Randal S. Olson',
author_email='rso@randalolson.com',
packages=find_packages(... | initpy = open('tpot/_version.py').read().split('\n')
version = list(filter(lambda x: '__version__' in x, initpy))[0].split('\'')[1]
return version
| initpy = open('tpot/_version.py').read().split('\n')
version = list(filter(lambda x: '__version__' in x, initpy))[0].split('\'')[1]
return version
| 13 | 742 | 64 | 806 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
def calculate_version():
FILL_FUNC_BODYpackage_version = calculate_version()
setup(
name='TPOT',
version=package_version,
author='Randal S. Olson',
author_email='rso@randalolson.com',
packages=find_packages(... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
def calculate_version():
FILL_FUNC_BODYpackage_version = calculate_version()
setup(
name='TPOT',
version=package_version,
author='Randal S. Olson',
author_email='rso@randalolson.com',
packages=find_packages(... | |
815 | /home/hieuvd/dung_repo/raw/stars_01/EpistasisLab_tpot/tpot | /home/hieuvd/dung_repo/raw/stars_01/EpistasisLab_tpot/tpot/tpot/builtins/feature_transformers.py | 63,64 | 30,86 | transform | CategoricalSelector | 75,86 | 64,86 | class CategoricalSelector(BaseEstimator, TransformerMixin):
"""Meta-transformer for selecting categorical features and transform them using OneHotEncoder.
Parameters
----------
threshold : int, default=10
Maximum number of unique values per feature to consider the feature
to be categor... | class CategoricalSelector(BaseEstimator, TransformerMixin):
"""Meta-transformer for selecting categorical features and transform them using OneHotEncoder.
Parameters
----------
threshold : int, default=10
Maximum number of unique values per feature to consider the feature
to be categor... | selected = auto_select_categorical_features(X, threshold=self.threshold)
X_sel, _, n_selected, _ = _X_selected(X, selected)
if n_selected == 0:
# No features selected.
raise ValueError('No categorical feature was found!')
else:
ohe = OneHotEncoder(cat... | """Select categorical features and transform them using OneHotEncoder.
Parameters
----------
X: numpy ndarray, {n_samples, n_components}
New data, where n_samples is the number of samples and n_components is the number of components.
Returns
-------
... | 33 | 375 | 142 | 517 | # -*- coding: utf-8 -*-
"""Copyright 2015-Present Randal S. Olson.
This file is part of the TPOT library.
TPOT is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your... | # -*- coding: utf-8 -*-
"""Copyright 2015-Present Randal S. Olson.
This file is part of the TPOT library.
TPOT is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.