#!/usr/bin/env python3 # Copyright (c) 2013-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import biplist from ds_store import DSStore from mac_alias import Alias import sys output_file = sys.argv[1] package_name_ns = sys.argv[2] ds = DSStore.open(output_file, 'w+') ds['.']['bwsp'] = { 'ShowStatusBar': False, 'WindowBounds': b'{{300, 280}, {500, 343}}', 'ContainerShowSidebar': False, 'SidebarWidth': 0, 'ShowTabView': False, 'PreviewPaneVisibility': False, 'ShowToolbar': False, 'ShowSidebar': False, 'ShowPathbar': True } icvp = { 'gridOffsetX': 0.0, 'textSize': 12.0, 'viewOptionsVersion': 1, 'backgroundImageAlias': b'\x00\x00\x00\x00\x02\x1e\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x94\\\xb0H+\x00\x05\x00\x00\x00\x98\x0fbackground.tiff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\xd19\xb0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\r\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b.background\x00\x00\x10\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x11\x00\x08\x00\x00\xd19\xb0\xf8\x00\x00\x00\x01\x00\x04\x00\x00\x00\x98\x00\x0e\x00 \x00\x0f\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\x00.\x00t\x00i\x00f\x00f\x00\x0f\x00\x02\x00\x00\x00\x12\x00\x1c/.background/background.tiff\x00\x14\x01\x06\x00\x00\x00\x00\x01\x06\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x97\xab\xc3H+\x00\x00\x01\x88[\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02u\xab\x8d\xd1\x94\\\xb0devrddsk\xff\xff\xff\xff\x00\x00\t \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07syscoin\x00\x00\x10\x00\x08\x00\x00\xce\x97\xab\xc3\x00\x00\x00\x11\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x01\x00\x14\x01\x88[\x88\x00\x16\xa9\t\x00\x08\xfaR\x00\x08\xfaQ\x00\x02d\x8e\x00\x0e\x00\x02\x00\x00\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x14\xff\xff\x00\x00\xff\xff\x00\x00', 'backgroundColorBlue': 1.0,
#!/usr/bin/env python # coding=utf8 # author=evi1m0@201503 # poc: http://www.beebeeto.com/pdb/poc-2015-0052/ # install: https://pypi.python.org/pypi/ds_store import sys from ds_store import DSStore if len(sys.argv) < 2: print '[*] Usage: %s path/.DS_Store' % sys.argv[0] sys.exit() filelist = [] filename = sys.argv[1] try: with DSStore.open(filename, 'r+') as obj: for i in obj: filelist.append(i.filename) except Exception, e: print '[-] Error: %s' % str(e) for name in set(list(filelist)): print '[*] ' + name
from ds_store import DSStore from tqdm import tqdm import argparse parser = argparse.ArgumentParser() parser.add_argument("-p", "--path", help="Path to the DS_Store file", required=True) parser.add_argument("-t", "--type", help="Type : Iloc, bwsp, lsvp, lsvP, icvp", default='Iloc') args = parser.parse_args() dsstore = DSStore.open(args.path, 'r+') for data in tqdm(dsstore): data = str(data) entry = data.translate(None, "<>") entry = entry.split(' ') if(entry[1] == args.type): print(entry[0])
def init(self, data): """ Open a .DS_Store file """ _input = StringIO(data) self._store = DSStore.open(_input)
#!/usr/bin/env python # Copyright (c) 2013-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from __future__ import division, print_function, unicode_literals import biplist from ds_store import DSStore from mac_alias import Alias import sys output_file = sys.argv[1] package_name_ns = sys.argv[2] ds = DSStore.open(output_file, 'w+') ds['.']['bwsp'] = { 'ShowStatusBar': False, 'WindowBounds': b'{{300, 280}, {500, 343}}', 'ContainerShowSidebar': False, 'SidebarWidth': 0, 'ShowTabView': False, 'PreviewPaneVisibility': False, 'ShowToolbar': False, 'ShowSidebar': False, 'ShowPathbar': True } icvp = { 'gridOffsetX': 0.0, 'textSize': 12.0, 'viewOptionsVersion': 1, 'backgroundImageAlias':
def get_dirs(): dirs = [] with DSStore.open("DS_Store", "r+") as d: for i in d: dirs.append(str(i)[1]) return sorted(list(set(dirs)))
def process(self): while True: try: url = self.queue.get(timeout=2.0) self.lock.acquire() self.working_thread += 1 self.lock.release() except Exception as e: if self.working_thread == 0: break else: continue try: if url in self.processed_url: continue else: self.processed_url.add(url) base_url = url.rstrip('.DS_Store') if not url.lower().startswith('http'): url = f'http://{url}' schema, netloc, path, _, _, _ = urlparse(url, 'http') response = requests.get(url, headers=headers, verify=False) if response.status_code not in [200, 404]: self.lock.acquire() print(f"[{response.status_code}] {url}") self.lock.release() data = response.content if response.status_code == 200: folder_name = netloc.replace(':', '_') + '/'.join(path.split('/')[:-1]) if not os.path.exists(folder_name): os.makedirs(folder_name) self.lock.acquire() print(f'[{response.status_code}] {url}') self.lock.release() try: with open(netloc.replace(':', '_') + path, 'wb') as outFile: outFile.write(data) except IsADirectoryError: pass if url.endswith('.DS_Store'): ds_store_file = BytesIO() ds_store_file.write(data) d = DSStore.open(ds_store_file) dirs_files = set() for x in d._traverse(None): dirs_files.add(x.filename) for name in dirs_files: if name != '.': self.queue.put(base_url + name) self.queue.put(base_url + name + '/.DS_Store') d.close() except Exception as e: self.lock.acquire() print(f'[!] {str(e)}') self.lock.release() finally: self.working_thread -= 1