Fixed code duplication in T1105 sending and typo in report header

This commit is contained in:
VakarisZ 2019-08-01 14:52:27 +03:00
parent eb574c8fff
commit f01febfb5d
3 changed files with 21 additions and 15 deletions

View File

@ -164,19 +164,20 @@ class SSHExploiter(HostExploiter):
ftp.putfo(file_obj, self._config.dropper_target_path_linux, file_size=monkeyfs.getsize(src_path), ftp.putfo(file_obj, self._config.dropper_target_path_linux, file_size=monkeyfs.getsize(src_path),
callback=self.log_transfer) callback=self.log_transfer)
ftp.chmod(self._config.dropper_target_path_linux, 0o777) ftp.chmod(self._config.dropper_target_path_linux, 0o777)
T1105Telem(ScanStatus.USED, status = ScanStatus.USED
get_interface_to_target(self.host.ip_addr[0]),
self.host.ip_addr[0],
src_path).send()
ftp.close() ftp.close()
except Exception as exc: except Exception as exc:
LOG.debug("Error uploading file into victim %r: (%s)", self.host, exc) LOG.debug("Error uploading file into victim %r: (%s)", self.host, exc)
T1105Telem(ScanStatus.SCANNED, status = ScanStatus.SCANNED
get_interface_to_target(self.host.ip_addr[0]),
self.host.ip_addr[0], T1105Telem(status,
src_path).send() get_interface_to_target(self.host.ip_addr[0]),
self.host.ip_addr[0],
src_path).send()
if status == ScanStatus.SCANNED:
return False return False
try: try:
cmdline = "%s %s" % (self._config.dropper_target_path_linux, MONKEY_ARG) cmdline = "%s %s" % (self._config.dropper_target_path_linux, MONKEY_ARG)
cmdline += build_monkey_commandline(self.host, get_monkey_depth() - 1) cmdline += build_monkey_commandline(self.host, get_monkey_depth() - 1)

View File

@ -82,17 +82,22 @@ class UsersPBA(PBA):
pba_file_contents = ControlClient.get_pba_file(filename) pba_file_contents = ControlClient.get_pba_file(filename)
status = None
if not pba_file_contents or not pba_file_contents.content: if not pba_file_contents or not pba_file_contents.content:
LOG.error("Island didn't respond with post breach file.") LOG.error("Island didn't respond with post breach file.")
T1105Telem(ScanStatus.SCANNED, status = ScanStatus.SCANNED
WormConfiguration.current_server.split(':')[0],
get_interface_to_target(WormConfiguration.current_server.split(':')[0]), if not status:
filename).send() status = ScanStatus.USED
return False
T1105Telem(ScanStatus.USED, T1105Telem(status,
WormConfiguration.current_server.split(':')[0], WormConfiguration.current_server.split(':')[0],
get_interface_to_target(WormConfiguration.current_server.split(':')[0]), get_interface_to_target(WormConfiguration.current_server.split(':')[0]),
filename).send() filename).send()
if status == ScanStatus.SCANNED:
return False
try: try:
with open(os.path.join(dst_dir, filename), 'wb') as written_PBA_file: with open(os.path.join(dst_dir, filename), 'wb') as written_PBA_file:
written_PBA_file.write(pba_file_contents.content) written_PBA_file.write(pba_file_contents.content)

View File

@ -12,7 +12,7 @@ class T1105 extends React.Component {
static getFilesColumns() { static getFilesColumns() {
return ([{ return ([{
Header: 'Files copied.', Header: 'Files copied',
columns: [ columns: [
{Header: 'Src. Machine', id: 'srcMachine', accessor: x => x.src, style: { 'whiteSpace': 'unset'}, width: 170 }, {Header: 'Src. Machine', id: 'srcMachine', accessor: x => x.src, style: { 'whiteSpace': 'unset'}, width: 170 },
{Header: 'Dst. Machine', id: 'dstMachine', accessor: x => x.dst, style: { 'whiteSpace': 'unset'}, width: 170}, {Header: 'Dst. Machine', id: 'dstMachine', accessor: x => x.dst, style: { 'whiteSpace': 'unset'}, width: 170},