示例#1
0
def ExitProgram():
    print("");
    optionExit = input("Are you sure you want to exit? (y/n): ");
    if (optionExit == "y") or (optionExit == "Y"):
        sys.exit();
    elif (optionExit == "n") or (optionExit == "N"):
        time.sleep(2)
        bfunc.PressKey();();
    else:
        print("");
        print(" Use a right option (y/n)")
        ExitProgram();
示例#2
0
def ConfigureDNS():
    print();
    print("  [*] Wait while it checks Active Directory  ",end="");
    bfunc.LoadAnimation();();
    print();
    p = subprocess.Popen(["powershell.exe", ".\\scripts\\cup\\adcheck.ps1"],stdout=sys.stdout); # se ponen dos barras para que no de problemas de codec
    p.communicate();

    lines = len(open('.\\scripts\\cup\\temp\\adcheck.txt').readlines());

    p = subprocess.Popen(["powershell.exe", "del .\\scripts\\cup\\temp\\adcheck.txt"],stdout=sys.stdout);
    #print(lines);

    if (lines == 0):
        print();
        print(" The Active Directory service is NOT installed");
        bfunc.PressKey();();
    else:
        print();
        print("  [*] Checking if your system is a Domain Controller  ",end="");
        bfunc.LoadAnimation();();
        print();

        p = subprocess.Popen(["powershell.exe", ".\\scripts\\cup\\dccheck.ps1"],stdout=sys.stdout); # se ponen dos barras para que no de problemas de codec
        p.communicate();

        lines2 = len(open('.\\scripts\\cup\\temp\\checkdcdiag.txt').readlines());

        p1 = subprocess.Popen(["powershell.exe", "del .\\scripts\\cup\\temp\\checkdcdiag.txt"],stdout=sys.stdout);
        p2 = subprocess.Popen(["powershell.exe", "del .\\scripts\\cup\\temp\\dcdiag.txt"],stdout=sys.stdout);

        #print (lines2);

        if (lines2 != 0):
            print();
            print(" Your system MUST be Domain Controller to configure DNS");
            bfunc.PressKey();();
        else:
            os.system(f'type nul > menus\\security.txt')
            os.system('menus\\dnsconfig.exe')
示例#3
0
def CheckAD3():
    print();
    print("  [*] Wait while it checks Active Directory  ",end="");
    bfunc.LoadAnimation();
    print();
    p = subprocess.Popen(["powershell.exe", ".\\scripts\\cup\\adcheck.ps1"],stdout=sys.stdout); # se ponen dos barras para que no de problemas de codec
    p.communicate();

    lines = len(open('.\\scripts\\cup\\temp\\adcheck.txt').readlines());

    p1 = subprocess.Popen(["powershell.exe", "del .\\scripts\\comp\\temp\\adcheck.txt"],stdout=sys.stdout);

    #print(lines);


    if (lines != 0):
        print();
        print(" The Active Directory service is ALREADY installed");
        bfunc.PressKey();();
    else:
        print();
        print(" The Active Directory service is NOT installed");
        bfunc.PressKey();();