Esempio n. 1
0
def drawBand(plotlistOrbital):
    DOS.makeDOSdata(plotlistOrbital)
    strageData(plotlistOrbital)
    os.system("mkdir %s_%s/"%(plotlistOrbital[0],plotlistOrbital[1]))
    plotNames = {"dual_plot":"00_dual","up_plot":"01_up","down_plot":"02_down"}
    for key in plotNames:
        changeGPloader(DOS.maximum, "%s_%s/%s.eps"%(plotlistOrbital[0],plotlistOrbital[1],plotNames[key]), key)
        os.system("gnuplot %s"%(key))
    for key in plotNames:
        epsTopdf("%s_%s/%s"%(plotlistOrbital[0],plotlistOrbital[1],plotNames[key]))
def merge_files():

    path = argv[2]
    fmt = argv[3]
    wins = [int(argv[4]), int(argv[5])]
    lipids = int(argv[6])
    num_resamples = int(argv[7])

    hs_files = []
    for i in range(0, wins[0]):
        hs_files.append([])
        for j in range(0, wins[1]):
            filename = fmt % ((i + j * wins[0]), lipids)
            filename = os.path.join(path, filename)
            if os.path.exists(filename):
                hs_files[i].append(filename)

    result = None
    for r in range(0, num_resamples):
        h = HistogramND(2)
        fs = resample(hs_files)
        h.read(fs[0])
        for i in range(1, len(fs)):
            th = HistogramND(2)
            th.read(fs[i])
            h.merge(th)
        h = h.norm_dos()
        if result == None:
            result = np.copy(
                np.append(np.reshape(h[:, 0], (h.shape[0], 1)), np.reshape(h[:, 2], (h.shape[0], 1)), axis=1)
            )
        else:
            result = np.append(result, np.reshape(h[:, 2], (result.shape[0], 1)), axis=1)

    opath = "."
    final = np.reshape(result[:, 0], (result.shape[0], 1))
    final = np.append(final, np.reshape(np.mean(result[:, 1:], axis=1), (result.shape[0], 1)), axis=1)
    final = np.append(final, np.reshape(np.std(result[:, 1:], axis=1), (result.shape[0], 1)), axis=1)
    np.savetxt(os.path.join(opath, "Lipid%d.dos_deriv.dat" % lipids), MyMath.derivatives(final[:, 0:2]))

    array_lipid = np.ones((final.shape[0], 1)) * lipids
    final = np.append(final, np.reshape(array_lipid, ((final.shape[0], 1))), axis=1)
    np.savetxt(os.path.join(opath, "Lipid%d.ave_dos.dat" % lipids), final, fmt="%.2f   %.2f   %.2f  %d")

    dT = 0.01
    kb = 1
    num_files = 1
    num_points = 1000
    num_atoms = 1000

    result = result[67:,]

    thermo_result = DOS.thermo(result, dT, num_points, 1000)

    np.savetxt(os.path.join(opath, "Lipid%d.thermo_dos.dat" % lipids), thermo_result)
Esempio n. 3
0
def main():
    #JUST TO MAKE SHURE YOU ARE ROOT
    generics.RunAsRoot()

    showMenu = True

    while (showMenu):
        shellCols = colors.ShellColors
        #Main Menu
        generics.clearScreen()
        print shellCols.UNDERLINE + shellCols.ALTERNAHEADER + "WLAN-Netzwerk Tutorials" + shellCols.ENDC + '\n'
        print(
            'Dieses Tutorial bietet dem Benutzer die Möglichkeit, durch ein interaktives Skript, WLAN Passwörter für WEP und WPA/WPA2 zu knacken.'
            +
            ' Ebenso können einige DoS-Attacken gegen WLAN-Netze interaktiv erlebt werden. Selbstverständlich dient dieses Tutorial nur einem '
            +
            'demonstrativen Zweck und es sollten nur WLAN-Netzwerke attackiert werden, die sich in einem isolierten Testumfeld befinden und der Nutzer '
            +
            'auch auf legalen Weg Zugriff hat. Im Tutorial selbst finden sich nur kurze Erklärungen zum Angriffverlauf. Für eine ausführliche '
            +
            'Erklärung wird zusammen mit diesem Tutorial eine Anleitung/Erklärung in .pdf-Form mitgeliefert.\n'
        )
        print shellCols.UNDERLINE + shellCols.ALTERNAHEADER + "Main Menu" + shellCols.ENDC
        print shellCols.WARNING + "1.\tWEP-Key knacken" + shellCols.ENDC
        print shellCols.WARNING + "2.\tWPA/WPA2-PSK knacken" + shellCols.ENDC
        print shellCols.WARNING + "3.\tWLAN DoS-Attacken" + shellCols.ENDC
        print shellCols.WARNING + "4.\tWPS-PIN knacken" + shellCols.ENDC
        print shellCols.WARNING + "5.\tWPA/WPA2-Enterprise Passwort knacken" + shellCols.ENDC
        print shellCols.WARNING + "6.\tFake-AP erstellen" + shellCols.ENDC
        print shellCols.WARNING + "0.\tZurück zum Hauptmenü der Security-Workbench" + shellCols.ENDC
        try:
            mainSelection = input(
                shellCols.BLUE +
                "\nDie Auswahl bitte hier eingeben und mit Enter bestätigen: "
                + shellCols.ENDC)
        except SyntaxError:
            mainSelection = 0
        if (mainSelection == 1):
            showMenu = WEP.WEP_Open()
        elif (mainSelection == 2):
            showMenu = WPA.WPA_Menu()
        elif (mainSelection == 3):
            showMenu = DOS.DOS_Menu()
        elif (mainSelection == 4):
            showMenu = WPS.WPS_Menu()
        elif (mainSelection == 5):
            showMenu = Enterprise.Enterprise_Menu()
        elif (mainSelection == 6):
            showMenu = Fake.Fake_Menu()
        elif (mainSelection == 0):
            showMenu = False

        if (showMenu == False):
            print "\nSkript wird beendet.\n"
def merge_files():

    path = argv[2]
    fmt = argv[3]
    wins = [int(argv[4]), int(argv[5])]
    lipids = int(argv[6])
    num_resamples = int(argv[7])

    hs_files = []
    for i in range(0, wins[0]):
        hs_files.append([])
        for j in range(0, wins[1]):
            filename = fmt % ((i + j * wins[0]), lipids)
            filename = os.path.join(path, filename)
            if os.path.exists(filename):
                hs_files[i].append(filename)

    result = None
    for r in range(0, num_resamples):
        h = HistogramND(2)
        fs = resample(hs_files)
        h.read(fs[0])
        for i in range(1, len(fs)):
            th = HistogramND(2)
            th.read(fs[i])
            h.merge(th)
        h = h.norm_dos()
        if result == None:
            result = np.copy(
                np.append(np.reshape(h[:, 0], (h.shape[0], 1)),
                          np.reshape(h[:, 2], (h.shape[0], 1)),
                          axis=1))
        else:
            result = np.append(result,
                               np.reshape(h[:, 2], (result.shape[0], 1)),
                               axis=1)

    opath = "."
    final = np.reshape(result[:, 0], (result.shape[0], 1))
    final = np.append(final,
                      np.reshape(np.mean(result[:, 1:], axis=1),
                                 (result.shape[0], 1)),
                      axis=1)
    final = np.append(final,
                      np.reshape(np.std(result[:, 1:], axis=1),
                                 (result.shape[0], 1)),
                      axis=1)
    np.savetxt(os.path.join(opath, "Lipid%d.dos_deriv.dat" % lipids),
               MyMath.derivatives(final[:, 0:2]))

    array_lipid = np.ones((final.shape[0], 1)) * lipids
    final = np.append(final,
                      np.reshape(array_lipid, ((final.shape[0], 1))),
                      axis=1)
    np.savetxt(os.path.join(opath, "Lipid%d.ave_dos.dat" % lipids),
               final,
               fmt="%.2f   %.2f   %.2f  %d")

    dT = 0.01
    kb = 1
    num_files = 1
    num_points = 1000
    num_atoms = 1000

    thermo_result = DOS.thermo(result, dT, num_points, 1000)

    np.savetxt(os.path.join(opath, "Lipid%d.thermo_dos.dat" % lipids),
               thermo_result)