예제 #1
0
    def nmapScanTarget(entry):
        target = entry.get()
        scanResult = nmap.getOpenPorts(target)
        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()

        ipHost = scanResult.keys()

        nmapPortFrame = Frame(root, bg="#1f2223", pady=55, padx=150)
        Label(nmapPortFrame,
              text="Nmap scan report for " + scanResult[target]["name"] +
              " (" + target + ")",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=25),
              pady=30).pack(side=TOP)

        for port, description in scanResult[target]["tcp"].items():
            Label(nmapPortFrame,
                  bg="#1f2223",
                  fg="#42b97d",
                  font=font.Font(size=10),
                  pady=10,
                  text=str(port) + "/tcp => Service: " +
                  description["service"] + " => Version: " +
                  description["version"] + ", extra infos:" +
                  description["extrainfo"]).pack(side=TOP)

        nmapPortFrame.pack(side=TOP, expand=True, fill="both")
예제 #2
0
    def launchNessusBasicScan(listEntry):

        login = listEntry[0].get()
        password = listEntry[1].get()
        target = listEntry[2].get()

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        try:
            nessusPy.doScanByNessus(login, password, target, "basic")
            mainFrame = Frame(root, bg="green")
            Label(mainFrame,
                  text='Nessus scan launched',
                  font=font.Font(weight="bold", size=25),
                  bg="#1f2223",
                  fg="#27beec",
                  height=5).pack(side=TOP)
            mainFrame.pack(side=TOP, fill="both", expand=True)
        except:
            t = sys.exc_info()
            mainFrame = Frame(root, bg="green")
            Label(mainFrame,
                  text=sys.exc_info()[1],
                  font=font.Font(weight="bold", size=25),
                  bg="#1f2223",
                  fg="#27beec",
                  height=5,
                  padx=40).pack(side=TOP, expand=True, fill="both")
            mainFrame.pack(side=TOP, fill="both", expand=True)

            print("Unexpected error:", sys.exc_info()[1])
예제 #3
0
    def welcome_setup(self, master=None):

        # set up background image
        self.canvas = Canvas(self, width=760, height=443)
        self.canvas.pack()
        self.canvas.create_image(0, 0, image=self.bg, anchor='nw')

        # Import welcome text file with setup text
        with open("text_setup.txt") as f:
            lines = f.read()
        f.close()

        self.myFont_heading = font.Font(family='Helvetica', size=20)
        self.canvas.create_text(380, 75, text=lines, font=self.myFont_heading)

        # Write image citation
        self.myFont_citation = font.Font(family='Helvetica', size=7)
        self.canvas.create_text(650,
                                420,
                                text="Image from img.theweek.in",
                                font=self.myFont_citation)

        # Write username and password entry
        self.myFont = font.Font(family='Helvetica', size=15)
        self.canvas.create_text(380, 140, text="Username", font=self.myFont)
        self.username = StringVar()
        self.username_entry = Entry(self, textvariable=self.username, width=30)
        username_entry = self.canvas.create_window(290,
                                                   170,
                                                   anchor='nw',
                                                   window=self.username_entry)

        self.canvas.create_text(380, 210, text="Password", font=self.myFont)
        self.password = StringVar()
        self.password_entry = Entry(self,
                                    textvariable=self.password,
                                    show="*",
                                    width=30)
        password_entry = self.canvas.create_window(290,
                                                   240,
                                                   anchor='nw',
                                                   window=self.password_entry)

        # create buttons for log in and create account
        self.enter_button = Button(self,
                                   text="Log in",
                                   command=self.login_check)
        self.enter_button_canvas = self.canvas.create_window(
            410, 280, anchor="nw", window=self.enter_button)

        self.account_button = Button(self,
                                     text="Create account",
                                     command=self.create_account)
        self.account_button_canvas = self.canvas.create_window(
            310, 280, anchor="nw", window=self.account_button)
def display():
    # window title
    window.title("Translator")
    # resizing: width x height + x_offset + y_offset:
    window.geometry("900x620+30+30")
    # window.wm_iconbitmap("phone.ico")
    window.configure(background="#fefefe")
    # custom fonts
    instructionsFont = font.Font(family='Times', size=8)
    inputFont = font.Font(family='Helvetica', size=11)
    btnFont = font.Font(family='Courier', size=10, weight='bold')
    outputFont = font.Font(family='Helvetica', size=11, weight='bold')
예제 #5
0
 def _build_tree(self):
     for col in car_header:
         self.tree.heading(col,
                           text=col.title(),
                           command=lambda c=col: sortby(self.tree, c, 0))
         # adjust the column's width to the header string
         self.tree.column(col, width=tkFont.Font().measure(col.title()))
     for item in car_list:
         self.tree.insert('', 'end', values=item)
         # adjust column's width if necessary to fit each value
         for ix, val in enumerate(item):
             col_w = tkFont.Font().measure(val)
             if self.tree.column(car_header[ix], width=None) < col_w:
                 self.tree.column(car_header[ix], width=col_w)
예제 #6
0
    def afficheInfo():

        top = tk.Toplevel()
        top.grab_set()
        top.focus()

        global var_langue

        police_top = font.Font(
            top, size=15, weight='bold', family='Courier'
        )  # Définition du style de police de la fenêtre de première utilisation.

        top.overrideredirect(1)
        top.geometry("400x355")
        top.config(bg="#C8F2FA")

        centrefenetre(top)
        champ_label = tk.Label(
            top,
            text=
            "Merci d'utiliser notre logiciel\nL2K1 basé sur <Python> soumis à\nla licence LGPL3.\n\n\n\nVous pouvez nous soutenir en\nfaisant un don.",
            bg="#C8F2FA",
            font=police_top)
        champ_label.pack()
        champ_label.place(relx=.50, rely=.47, anchor="center")
        if var_langue == "anglais":
            champ_label[
                "text"] = "Thank you for using our software\nL2K1 based on <Python> subject to\nthe LGPL3 license.\n\n\n\nYou can support us\nby doing a donation"

        btn = tk.Button(top, text="   OK    ", command=lambda: top.destroy())
        btn.place(relx=0.78, rely=0.84, anchor="center")
        btn.config(highlightbackground="#C8F2FA")
        top.wm_attributes('-alpha', 0.98)
 def welcome_setup(self, master = None):
     
     #set up background image
     self.canvas = Canvas(self, width=760, height = 443)
     self.canvas.pack()
     self.bg= PhotoImage(file="bg_img.png")
     self.canvas.create_image(0, 0, image=self.bg, anchor='nw')
     
     # Import welcome text file with setup text
     with open("text_setup.txt") as f:
         lines = f.read()
     f.close()
     
     myFont = font.Font(family='Helvetica', size=20)
     self.canvas.create_text(380, 75, text=lines, font=myFont)
     
     #Write username and password entry
     self.canvas.create_text(380, 200, text="Username", font=myFont)
     self.username_entry = Entry(self, width=30)
     username_entry = self.canvas.create_window(290, 230,
                                                anchor='nw',
                                                window = self.username_entry)
     
     self.canvas.create_text(380, 290, text="Password", font=myFont)
     self.password_entry = Entry(self, width=30)
     password_entry = self.canvas.create_window(290, 320,
                                                 anchor='nw',
                                                 window = self.password_entry)
 def topbar(self,color):
     self.color=color
     self.self=tk.Button(self.place,bg="#333333", text=self.text, foreground="#d1d1d1"
             ,height=1,width=5,relief="flat",activebackground=self.color,
             bd=0,activeforeground="#fff")
     self.self['font']=font.Font(family="Consolas",size=15)
     self.self.grid(row=self.row,column=self.column,columnspan=self.columnspan,sticky=self.sticky,padx=self.padx)
예제 #9
0
    def launchWhoIs(domain):
        domainName = domain.get()
        domainDict = WhoIs.new_whois(domainName)

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrameMails = Frame(root, bg="#1f2223", pady=25, padx=200)

        Label(mainFrameMails,
              text="Result for " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=30).pack(side=TOP)

        listFrame = ScrollableFrame(mainFrameMails)

        for field, valu in domainDict.items():
            Label(listFrame.scrollable_frame,
                  text=str(field) + ": " + str(valu),
                  bg="#1f2223",
                  anchor="w",
                  fg="#27beec").pack(side=TOP, expand=True, fill='x')

        listFrame.pack(side=TOP, expand=True, fill="both")

        mainFrameMails.pack(side=TOP, expand=True, fill="both")
예제 #10
0
    def extractMails(domain):
        domainName = domain.get()
        e = MailsExtract.Extractor(domainName)
        listMails = e.crawl()

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrameMails = Frame(root, bg="#1f2223", pady=60, padx=200)

        Label(mainFrameMails,
              text="Found " + str(len(listMails)) + " mails in " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)

        listFrame = ScrollableFrame(mainFrameMails)

        for mails in listMails:
            Label(listFrame.scrollable_frame, text=mails, bg="#1f2223", anchor="w", fg="#27beec") \
                .pack(side=TOP, expand=True, fill='x')

        listFrame.pack(side=TOP, expand=True, fill="both")

        mainFrameMails.pack(side=TOP, expand=True, fill='both')

        return
예제 #11
0
    def displayNessusInterface():

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=55, padx=200)
        Label(mainFrame,
              text="Nessus API",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)

        fieldWidth = 15
        entryTab = []
        fieldNames = ["login", "password", "target"]

        for i in range(3):
            containerFrame = Frame(mainFrame, bg="#1f2223", pady=10)
            Label(containerFrame,
                  text=fieldNames[i] + ": ",
                  bg="#1f2223",
                  fg="#27beec",
                  font=font.Font(size=11, weight="bold"),
                  pady=8,
                  width=fieldWidth,
                  justify=LEFT).pack(side=LEFT)
            entryTab.append(Entry(containerFrame))
            entryTab[i].pack(side=LEFT)
            containerFrame.pack(side=TOP)
        Label(mainFrame,
              text=" ",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=6).pack(side=TOP)
        Button(mainFrame,
               bg="#29353a",
               fg="#27beec",
               activebackground="#384d54",
               activeforeground="#27beec",
               bd=0,
               text="Launch basic nessus scan",
               command=functools.partial(launchNessusBasicScan, entryTab),
               highlightthickness=0).pack(side=TOP)
        mainFrame.pack(side=TOP, expand=True, fill='both')
예제 #12
0
    def launchShodan(domain):
        domainName = domain.get()
        domainDict = SHodan.SHodan(domainName)

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=25, padx=200)

        Label(mainFrame,
              text="Result for " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=30).pack(side=TOP)

        listFrame = ScrollableFrame(mainFrame)

        for field, valu in domainDict.items():
            if not field == "information" and not valu is None and len(
                    valu) > 0:
                Label(listFrame.scrollable_frame,
                      text=str(field) + ": " + str(valu),
                      bg="#1f2223",
                      anchor="w",
                      fg="#27beec").pack(side=TOP, expand=True, fill='x')

        if "information" in domainDict:
            maxLen = 11
            for banner in domainDict["information"]:
                containerF = Frame(listFrame.scrollable_frame)
                Label(containerF, text="port: " + str(banner["port"]), bg="#1f2223", anchor="w", fg="#27beec")\
                    .pack(side=LEFT, expand=True, fill='x')
                containerF.pack(side=TOP, expand=True, fill='x')

                for field, valu in banner.items():
                    if not field == "port":
                        containerOtherInfos = Frame(listFrame.scrollable_frame)
                        Label(containerOtherInfos,
                              text="",
                              width=maxLen,
                              bg="#1f2223").pack(side=LEFT)
                        Label(containerOtherInfos,
                              text=field + ": " + str(valu),
                              bg="#1f2223",
                              anchor="w",
                              fg="#27beec").pack(side=LEFT,
                                                 expand=True,
                                                 fill='x')
                        containerOtherInfos.pack(side=TOP,
                                                 expand=True,
                                                 fill='x')

        listFrame.pack(side=TOP, expand=True, fill="both")
        mainFrame.pack(side=TOP, expand=True, fill="both")
        return
예제 #13
0
 def displayWelcomeInterface():
     mainFrame = Frame(root, bg="green")
     Label(mainFrame,
           text='Please choose a tool',
           font=font.Font(weight="bold", size=25),
           bg="#1f2223",
           fg="#27beec",
           height=5,
           width=30).grid()
     mainFrame.pack(side=TOP, fill="both", expand=True)
예제 #14
0
    def displayNmapInterface():

        nmapFrame = Frame(root, bg="#1f2223", pady=55, padx=210)

        Button(nmapFrame, bg="#29353a", bd=0, fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
               text="Launch nmap host discovery", command=nmapHostDiscovery,
               font=font.Font(size=10), highlightthickness=0)\
            .pack(side=TOP)

        Label(nmapFrame,
              bg="#1f2223",
              fg="#27beec",
              text="OR",
              pady=25,
              font=font.Font(size=15)).pack(side=TOP)

        #targetScanFrame = Frame(nmapFrame, bg="#1f2223").pack(side=TOP)

        targetScanFrame = Frame(nmapFrame, bg="#1f2223")

        targetEntry = Entry(targetScanFrame)

        Button(targetScanFrame, bg="#29353a", bd=0, fg="#27beec",  activebackground="#384d54", highlightthickness=0,
               activeforeground="#27beec", text="Scan target:", command=functools.partial(nmapScanTarget, targetEntry))\
            .pack(side=LEFT)

        Label(targetScanFrame, bg="#1f2223", fg="#27beec",
              text="  ").pack(side=LEFT)

        targetEntry.pack(side=LEFT)

        targetScanFrame.pack(side=TOP)

        for widget in root.winfo_children():
            if not widget.winfo_name(
            ) == topFrameName and not widget.winfo_name(
            ) == nmapFrame.winfo_name():
                widget.destroy()

        nmapFrame.pack(side=TOP, expand=True, fill='both')
 def __init__(self,place,size,row,column,columnspan,sticky="n",padx=0):
     self.place=place
     self.size=size
     self.row=row
     self.column=column
     self.columnspan=columnspan
     self.sticky=sticky
     self.padx=padx
     self.self=scrolledtext.ScrolledText(self.place,height=20,width=80,bg="#121212",
                         relief="flat",foreground="#d1d1d1")
     self.self['font']=font.Font(family="Consolas",size=self.size)
     self.self.grid(row=self.row,column=self.column,columnspan=self.columnspan,sticky=self.sticky,padx=self.padx)
     self.self.config(state="disabled")
 def __init__(self,place,bg,width,size,row,column,columnspan,sticky="n",padx=0):
     self.place=place
     self.bg=bg
     self.width=width
     self.size=size
     self.row=row
     self.column=column
     self.columnspan=columnspan
     self.sticky=sticky
     self.padx=padx
     self.self=tk.Entry(self.place,bg=self.bg, relief="flat",
                       insertbackground="#fff",selectbackground="#0764d4"
                       ,width=self.width,foreground="#d1d1d1")
     self.self['font']=font.Font(family="Consolas",size=self.size)
     self.self.grid(row=self.row,column=self.column,columnspan=self.columnspan,sticky=self.sticky,padx=self.padx)
예제 #17
0
    def nmapHostDiscovery():
        listTarget = nmap.getOpenPorts("192.168.0.0/24", arguments="-sn")
        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()

        nmapListFrame = Frame(root, bg="#1f2223", pady=55, padx=250)

        Label(nmapListFrame,
              text="Found " + str(len(listTarget)) + " hosts",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=25),
              pady=30).pack(side=TOP)

        for hostIP, hostName in listTarget.items():
            Label(nmapListFrame,
                  text=hostName["name"] + " with ip: " + hostIP,
                  bg="#1f2223",
                  fg="#27beec",
                  font=font.Font(size=15),
                  pady=10).pack(side=TOP)

        nmapListFrame.pack(side=TOP, expand=True, fill="both")
 def __init__(self,place,height,width,bg,size,row,column,columnspan,sticky="n",padx=0):
     self.place=place
     self.bg=bg
     self.width=width
     self.height=height
     self.size=size
     self.row=row
     self.column=column
     self.columnspan=columnspan
     self.sticky=sticky
     self.padx=padx
     self.self=tk.Text(self.place,height=self.height,width=self.width,bg=self.bg,
                         relief="flat",foreground="#d1d1d1")
     self.self['font']=font.Font(family="Consolas",size=self.size)
     self.self.grid(row=self.row,column=self.column,columnspan=self.columnspan,sticky=self.sticky,padx=self.padx)
     self.self.config(state="disabled")
 def __init__(self,place,text,bg,foreground,height,size,row,column,columnspan,sticky="n",padx=0,pady=0):
     self.place=place
     self.text=text
     self.bg=bg
     self.foreground=foreground
     self.height=height
     self.size=size
     self.row=row
     self.column=column
     self.columnspan=columnspan
     self.sticky=sticky
     self.padx=padx
     self.pady=pady
     self.self=tk.Label(self.place,bg=self.bg,foreground=self.foreground,
                      text=self.text,height=self.height)
     self.self['font']=font.Font(family="Consolas",size=self.size)
     self.self.grid(row=self.row,column=self.column,columnspan=self.columnspan,sticky=self.sticky,padx=self.padx,pady=self.pady)
예제 #20
0
    def displayWhoIsInterface():

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=55, padx=200)
        Label(mainFrame,
              text="WhoIs",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)
        targetFrame = Frame(mainFrame, bg="#1f2223", pady=30)
        domainEntry = Entry(targetFrame)
        Button(targetFrame, bg="#29353a", fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
               bd=0, text="Scan domain:", command=functools.partial(launchWhoIs, domainEntry), highlightthickness=0) \
            .pack(side=LEFT)
        Label(targetFrame, bg="#1f2223", fg="#27beec",
              text="  ").pack(side=LEFT)
        domainEntry.pack(side=LEFT)
        targetFrame.pack(side=TOP)
        mainFrame.pack(side=TOP, expand=True, fill='both')
예제 #21
0
    def dnsEnumTarget(domain):
        domainName = domain.get()
        dnsEnumResult = dnsenum.dnsenum(domainName)

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()

        dnsEnumFrame = Frame(root, bg="#1f2223", pady=60, padx=200)

        Label(dnsEnumFrame,
              text="Fierce scan report for " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)
        Label(dnsEnumFrame, text="DNS server: " + dnsEnumResult["serveur DNS"],
              bg="#1f2223", fg="#27beec", font=font.Font(size=15), pady=5, justify="left")\
            .pack(side=TOP, expand=True, fill='x')
        Label(dnsEnumFrame, text="Master server: " + dnsEnumResult["serveur maitre"],
              bg="#1f2223", fg="#27beec", font=font.Font(size=15), pady=5, anchor="w")\
            .pack(side=TOP, expand=True, fill='x')

        if dnsEnumResult["Zone"]:
            maxLen = 0
            for dnsName in dnsEnumResult["ZoneInfos"].keys():
                if len(dnsName) > maxLen:
                    maxLen = len(dnsName)

            listDNSinfos = ScrollableFrame(dnsEnumFrame)

            for dnsName, infos in dnsEnumResult["ZoneInfos"].items():

                containerF = Frame(listDNSinfos.scrollable_frame)
                Label(containerF,
                      text=dnsName,
                      bg="#1f2223",
                      anchor="w",
                      fg="#27beec",
                      width=maxLen).pack(side=LEFT)
                Label(containerF, text=": " + infos[0], bg="#1f2223", anchor="w", fg="#27beec")\
                    .pack(side=LEFT, expand=True, fill='x')
                containerF.pack(side=TOP, expand=True, fill='x')

                for i in range(1, len(infos)):
                    containerOtherInfos = Frame(listDNSinfos.scrollable_frame)
                    Label(containerOtherInfos,
                          text="",
                          width=maxLen,
                          bg="#1f2223").pack(side=LEFT)
                    Label(containerOtherInfos, text=": " + infos[i], bg="#1f2223", anchor="w", fg="#27beec")\
                        .pack(side=LEFT, expand=True, fill='x')
                    containerOtherInfos.pack(side=TOP, expand=True, fill='x')

            listDNSinfos.pack(side=TOP, expand=True, fill="both")
        else:
            Label(dnsEnumFrame,
                  text="Zone transfert failure",
                  bg="#1f2223",
                  fg="red",
                  font=font.Font(size=25),
                  pady=30).pack(side=TOP)

        dnsEnumFrame.pack(side=TOP, expand=True, fill='both')
        return
예제 #22
0
def goApropos():

    fenApropos = tk.Toplevel()
    fenApropos.geometry("380x500")
    fenApropos.config(bg="#ECECEC")

    with open('Ressources/data/langue', 'rb') as langue:
        langue_depickler = pickle.Unpickler(langue)
        var_langue = langue_depickler.load()

    if var_langue == "francais":
        fenApropos.title("A propos de L2K1")
    else:
        fenApropos.title("About L2K1")

    fenApropos.resizable(
        width=False,
        height=False)  # Redimensionnement de la fenêtre immobilisée.

    imlogo = tk.PhotoImage(file="Ressources/image/logo/logo.gif")
    labLo = tk.Label(
        fenApropos, image=imlogo,
        bg="#ececec")  # Mise en place du label pour le logo du logiciel.

    f1 = tk.Frame(fenApropos, width=800,
                  height=50)  # Définition de l'espace d'affichage N°1.
    f1.config(bg="#ececec")

    t1 = tk.Text(
        f1, wrap=tk.NONE
    )  # Définition du texte d'affichage lié à la barre de défilement vertical.
    t1.config(width=40, height=9)
    t1.focus_force()

    #
    # Insertion du texte d'information N°1.
    #

    if var_langue == "francais":
        t1.insert(
            '1.0',
            "\nLe logiciel L2K1 ne communique aucune\ninformation de son environnement\nou de l'utilisation faite par\nl’utilisateur sans son consentement.\n\nSelon la licence LGPL3, le code source\nde l’application n'est pas publié.\n\nL2K1 ne modifie aucune des bibliothèques\n« Framework » fournies.\n\nEn utilisant notre logiciel\nvous acceptez par la présente de\ndédouaner de toutes responsabilités\nle(s) développeur(s) du logiciel.\n\nAucune information personnelle,\nconnexion Internet n'est nécessaire\npour utiliser le logiciel, néanmoins\ncertaines fonctionnalités peuvent\nnécessiter une connexion Internet\npour fonctionner. \n\t\t\t     <L2K1>\n"
        )
    else:
        t1.insert(
            '1.0',
            "\nThe L2K1 software does not provide any\ninformation about the environment or\nabout the utilization made by the user\nwithout his agreement.\n\nAccording to the LGPL3 license, the\nsoftware's source code won't be\npublished.\n\nL2K1 does not alter any of the provided\n« Framework » libraries.\n\nBy using our software, you accept to\nclear the software developer(s) from\nany responsabilities.\n\nNo personal information, or Internet\nconnection is required to use our\nsoftware, still some functions may need\nan Internet connection to work. \n\t\t\t        <L2K1>\n"
        )

    t1.config(highlightbackground="#ececec", state='disabled')

    f2 = tk.Frame(fenApropos, width=800,
                  height=50)  # Définition de l'espace d'affichage N°2.
    f2.config(bg="#ececec")

    t2 = tk.Text(
        f2, wrap=tk.NONE
    )  # Définition du texte d'affichage lié à la barre de défilement vertical.
    t2.config(width=40, height=9)

    #
    # Insertion du texte d'information N°2.
    #

    if var_langue == "francais":
        t2.insert(
            '1.0',
            "\n\t\t<Auteurs>\n\n\tAlexandre Heintzmann\n\tBenjamin Cohen\n\tHelmy El Rais\n\tRaphael Depain\n\tThomas Zhou\n\n\n    Merci d'utiliser notre logiciel\n    L2K1 basé sur <Python> soumis à\n    la licence LGPL3.\n\n    Nous tenons à remercier Madame\n    Danping Wang en qualité\n    d'encadrante pour son implication\n    dans le projet L2K1.\n\n    Vous pouvez nous soutenir en\n    faisant un don.\n\n    Traduit par Alexandre Heintzmann.\n\n"
        )
    else:
        t2.insert(
            '1.0',
            "\n\t\t<Authors>\n\n\tAlexandre Heintzmann\n\tBenjamin Cohen\n\tHelmy El Rais\n\tRaphael Depain\n\tThomas Zhou\n\n    Thank you for using our software\n    L2K1 based on <Python> subject\n    to the LGPL3 license.\n\n    We would like to thank miss\n    Danping Wang as supervisor, for\n    her involvment in the L2K1\n    project.\n\n    You can support us by giving a\n    donation.\n\n    Translated by Alexandre Heintzmann.\n\n"
        )

    t2.config(highlightbackground="#ececec", state='disabled')

    def AMTextAuteur(
        event=None,
        nsa=[True]
    ):  # Fonction permettant d'afficher et de masquer la zone de texte d'information N°1.

        #
        # Vérification et actions en fonction de l'état de la variable nsa[0]
        #

        if nsa[0]:

            labLo.place_forget()  # Masquer le logo
            f1.pack_forget()  # Affichage de la zone d'information N°1.

            t2.grid(column=0, row=0, padx=0, pady=232)
            t2.focus_set()

            f2.pack()
            nsa[0] = False

        else:
            f2.pack_forget()  # Masquer la zone d'information N°2.
            f1.pack_forget()  # Masquer la zone d'information N°1.
            labLo.place(relx=.5, rely=.61,
                        anchor="center")  # Affichage de la zone d'information.
            nsa[0] = True

    def AMTextInformation(
        event=None,
        nsa=[True]
    ):  # Fonction permettant d'afficher et de masquer la zone du texte d'information N°2.

        #
        # Vérification et actions en fonction de l'état de la variable nsa[0]
        #

        if nsa[0]:

            labLo.place_forget()  # Masquer le logo.
            f2.pack_forget()  # Affichage de la zone d'information N°2.

            t1.grid(column=0, row=0, padx=0, pady=232)
            t1.focus_set()

            f1.pack()
            nsa[0] = False

        else:
            f1.pack_forget()  # Masquer la zone d'information N°1.
            f2.pack_forget()  # Masquer la zone d'information N°2.
            labLo.place(relx=.5, rely=.61, anchor="center")
            nsa[0] = True

    police_apropos_titre = font.Font(
        fenApropos, size=18, weight='bold',
        family='Helvectica')  # Définition de la police d'affichage du titre.
    police_apropos_txt = font.Font(
        fenApropos, size=12,
        family='Helvectica')  # Définition de la police affichage du texte.

    #
    # Définition de différentes zones (Label) de texte d'affichage.
    #

    champ_label_titre = tk.Label(fenApropos,
                                 text="L2K1",
                                 bg="#ECECEC",
                                 font=police_apropos_titre)
    champ_label_titre.place(relx=.5, rely=.1, anchor="center")

    champ_label_version = tk.Label(fenApropos,
                                   text="Version 0.96",
                                   bg="#ECECEC",
                                   font=police_apropos_txt)
    champ_label_version.place(relx=.5, rely=.20, anchor="center")

    champ_label_langue = tk.Label(
        fenApropos,
        text="Langues disponibles : Français (FR) - Anglais (EN)",
        bg="#ECECEC",
        font=police_apropos_txt)
    champ_label_langue.place(relx=.5, rely=.25, anchor="center")

    champ_label_icon = tk.Label(
        fenApropos,
        text="Icon : (Licence) Gratuit pour un usage commercial.",
        bg="#ECECEC",
        font=police_apropos_txt)
    champ_label_icon.place(relx=.5, rely=.30, anchor="center")

    champ_label_base1 = tk.Label(fenApropos,
                                 text="Basé sur <Python>\n ",
                                 bg="#ECECEC",
                                 font=police_apropos_txt)
    champ_label_base1.place(relx=.5, rely=.40, anchor="center")

    champ_label_base2 = tk.Label(fenApropos,
                                 text="L2K1 © 2016-2017 Tous droits reservés.",
                                 bg="#ECECEC",
                                 font=police_apropos_txt)
    champ_label_base2.place(relx=.5, rely=.93, anchor="center")

    champ_label_licence1 = tk.Label(fenApropos,
                                    text="Soumis à une licence LGPL3",
                                    bg="#ECECEC",
                                    font=police_apropos_txt)
    champ_label_licence1.place(relx=.5, rely=.42, anchor="center")
    champ_label_licence1.bind("<Enter>",
                              lien_text(champ_label_licence1, event=None))
    champ_label_licence1.bind(
        "<Button-1>", goLicenceWeb
    )  # Déclenchement de la fonction goLicenceWeb lors du clic de l'utilisateur.

    champ_label_Auteur = tk.Label(fenApropos,
                                  text="Infos",
                                  bg="#ECECEC",
                                  font=police_apropos_txt)
    champ_label_Auteur.place(relx=.2, rely=.81, anchor="center")
    champ_label_Auteur.bind("<Enter>", lien_text(champ_label_Auteur,
                                                 event=None))
    champ_label_Auteur.bind(
        "<Button-1>", AMTextInformation
    )  # Déclenchement de la fonction AMTextInformation lors du clic de l'utilisateur.

    champ_label_licence2 = tk.Label(fenApropos,
                                    text="Licence",
                                    bg="#ECECEC",
                                    font=police_apropos_txt)
    champ_label_licence2.place(relx=.5, rely=.81, anchor="center")
    champ_label_licence2.bind("<Enter>",
                              lien_text(champ_label_licence2, event=None))
    champ_label_licence2.bind(
        "<Button-1>", goLicencePdf
    )  # Déclenchement de la fonction goLicencePdf lors du clic de l'utilisateur.

    champ_label_credit = tk.Label(fenApropos,
                                  text="Crédit",
                                  bg="#ECECEC",
                                  font=police_apropos_txt)
    champ_label_credit.place(relx=.8, rely=.81, anchor="center")
    champ_label_credit.bind("<Enter>", lien_text(champ_label_credit,
                                                 event=None))
    champ_label_credit.bind(
        "<Button-1>", AMTextAuteur
    )  # Déclenchement de la fonction AMTextAuteur lors du clic de l'utilisateur.

    if var_langue == "anglais":

        champ_label_langue[
            "text"] = "Available languages : French (FR) - English (EN)"
        champ_label_icon[
            "text"] = "Icon : (License) Free for any commercial use."
        champ_label_base1["text"] = "Based on <Python>\n "
        champ_label_base2["text"] = "L2K1 © 2016-2017 All rights reserved."
        champ_label_licence1["text"] = "Subject to the LGP3 license."
        champ_label_Auteur["text"] = "Information"
        champ_label_licence2["text"] = "License"
        champ_label_credit["text"] = "Credits"
    #
    # Création de l'animation de la barre de progression
    #

    pb = tk.ttk.Progressbar(fenApropos,
                            orient="horizontal",
                            length=100,
                            mode='determinate')
    pb.place(relx=0.5, rely=0.61, anchor="center")
    pb["value"] = 0
    pb["maximum"] = 100

    for i in range(100):  # Boucle de progression de la barre de chargement.
        pb["value"] += 1
        pb.update()
        sleep(0.01)
    pb.destroy()  # Destruction de la barre de chargement.

    labLo.place(relx=.5, rely=.61, anchor="center")
    fenApropos.wm_attributes(
        '-alpha', 0.96)  # Définition du style de transparence de la fenêtre.

    fenApropos.mainloop()
예제 #23
0
    def suppDo(secs):
        def labelDec():

            global secTmp, aff
            secTmp -= 1

            if var_langue == "francais":

                aff.set(
                    "Bonjour, vous allez être redirigé vers le mail du support dans : "
                    + str(secTmp) + " sec(s)"
                )  # Mise à jour de l'affichage textuel en fonction du temps restant.

            else:
                aff.set(
                    "You will be redirected to the support's mail in : " +
                    str(secTmp) + " sec(s)"
                )  # Mise à jour de l'affichage textuel en fonction du temps restant.

            #
            # Mise à jour de l'affichage d'animation en fonction du temps restant.
            #

            if secTmp == 4:
                sleep(1)
                tmp_image_cofX = image_cof1.subsample(2, 2)
                label2.config(image=tmp_image_cofX)

            elif secTmp == 3:
                sleep(1)
                tmp_image_cofX = image_cof2.subsample(2, 2)
                label2.config(image=tmp_image_cofX)

            elif secTmp == 2:
                sleep(1)
                tmp_image_cofX = image_cof3.subsample(2, 2)
                label2.config(image=tmp_image_cofX)

            elif (secTmp == 1 or secTmp == 0):
                sleep(1)
                tmp_image_cofX = image_cof4.subsample(2, 2)
                label2.config(image=tmp_image_cofX)

            label1.update_idletasks()  # Actualisation du label.

            if not secTmp:  # Déclenchement de l'action une fois le temps écoulé.

                if (os.sys.platform == 'win32'):
                    os.system("start mailto:[email protected]")
                if (os.sys.platform == 'darwin'):
                    os.system("open mailto:[email protected]")
                fenSupport.destroy()

        global secTmp

        # Définition et affichage du label.

        police_Support = font.Font(fenSupport, size=14, weight='bold')

        if var_langue == "francais":

            aff.set(
                "Bonjour, vous allez être redirigé vers le mail du support dans : 5 sec(s)"
            )
        else:

            aff.set(
                "You will be redirected to the support's mail in : 5 sec(s)")

        label1 = tk.Label(fenSupport,
                          textvariable=aff,
                          bg="#C0C0C0",
                          font=police_Support)
        label1.place(relx=.57, rely=.47, anchor="center")

        secTmp = secs
        for i in range(1, secs + 1):
            fenSupport.after(i * 1000,
                             labelDec)  # rappel de la fonction labelDec.
예제 #24
0
def interface():

    root = Tk()
    root.title("Information gathering")
    root['bg'] = 'black'

    def displayWelcomeInterface():
        mainFrame = Frame(root, bg="green")
        Label(mainFrame,
              text='Please choose a tool',
              font=font.Font(weight="bold", size=25),
              bg="#1f2223",
              fg="#27beec",
              height=5,
              width=30).grid()
        mainFrame.pack(side=TOP, fill="both", expand=True)

    def displayNmapInterface():

        nmapFrame = Frame(root, bg="#1f2223", pady=55, padx=210)

        Button(nmapFrame, bg="#29353a", bd=0, fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
               text="Launch nmap host discovery", command=nmapHostDiscovery,
               font=font.Font(size=10), highlightthickness=0)\
            .pack(side=TOP)

        Label(nmapFrame,
              bg="#1f2223",
              fg="#27beec",
              text="OR",
              pady=25,
              font=font.Font(size=15)).pack(side=TOP)

        #targetScanFrame = Frame(nmapFrame, bg="#1f2223").pack(side=TOP)

        targetScanFrame = Frame(nmapFrame, bg="#1f2223")

        targetEntry = Entry(targetScanFrame)

        Button(targetScanFrame, bg="#29353a", bd=0, fg="#27beec",  activebackground="#384d54", highlightthickness=0,
               activeforeground="#27beec", text="Scan target:", command=functools.partial(nmapScanTarget, targetEntry))\
            .pack(side=LEFT)

        Label(targetScanFrame, bg="#1f2223", fg="#27beec",
              text="  ").pack(side=LEFT)

        targetEntry.pack(side=LEFT)

        targetScanFrame.pack(side=TOP)

        for widget in root.winfo_children():
            if not widget.winfo_name(
            ) == topFrameName and not widget.winfo_name(
            ) == nmapFrame.winfo_name():
                widget.destroy()

        nmapFrame.pack(side=TOP, expand=True, fill='both')

    def nmapHostDiscovery():
        listTarget = nmap.getOpenPorts("192.168.0.0/24", arguments="-sn")
        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()

        nmapListFrame = Frame(root, bg="#1f2223", pady=55, padx=250)

        Label(nmapListFrame,
              text="Found " + str(len(listTarget)) + " hosts",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=25),
              pady=30).pack(side=TOP)

        for hostIP, hostName in listTarget.items():
            Label(nmapListFrame,
                  text=hostName["name"] + " with ip: " + hostIP,
                  bg="#1f2223",
                  fg="#27beec",
                  font=font.Font(size=15),
                  pady=10).pack(side=TOP)

        nmapListFrame.pack(side=TOP, expand=True, fill="both")

    def nmapScanTarget(entry):
        target = entry.get()
        scanResult = nmap.getOpenPorts(target)
        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()

        ipHost = scanResult.keys()

        nmapPortFrame = Frame(root, bg="#1f2223", pady=55, padx=150)
        Label(nmapPortFrame,
              text="Nmap scan report for " + scanResult[target]["name"] +
              " (" + target + ")",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=25),
              pady=30).pack(side=TOP)

        for port, description in scanResult[target]["tcp"].items():
            Label(nmapPortFrame,
                  bg="#1f2223",
                  fg="#42b97d",
                  font=font.Font(size=10),
                  pady=10,
                  text=str(port) + "/tcp => Service: " +
                  description["service"] + " => Version: " +
                  description["version"] + ", extra infos:" +
                  description["extrainfo"]).pack(side=TOP)

        nmapPortFrame.pack(side=TOP, expand=True, fill="both")

    def displayDnsEnumInterface():

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=55, padx=200)
        Label(mainFrame,
              text="Dns Enum",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)
        targetFrame = Frame(mainFrame, bg="#1f2223", pady=30)
        domainEntry = Entry(targetFrame)
        Button(targetFrame, bg="#29353a", fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
               bd=0, text="Scan domain:", command=functools.partial(dnsEnumTarget, domainEntry), highlightthickness=0) \
            .pack(side=LEFT)
        Label(targetFrame, bg="#1f2223", fg="#27beec",
              text="  ").pack(side=LEFT)
        domainEntry.pack(side=LEFT)
        targetFrame.pack(side=TOP)
        mainFrame.pack(side=TOP, expand=True, fill='both')

    def dnsEnumTarget(domain):
        domainName = domain.get()
        dnsEnumResult = dnsenum.dnsenum(domainName)

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()

        dnsEnumFrame = Frame(root, bg="#1f2223", pady=60, padx=200)

        Label(dnsEnumFrame,
              text="Fierce scan report for " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)
        Label(dnsEnumFrame, text="DNS server: " + dnsEnumResult["serveur DNS"],
              bg="#1f2223", fg="#27beec", font=font.Font(size=15), pady=5, justify="left")\
            .pack(side=TOP, expand=True, fill='x')
        Label(dnsEnumFrame, text="Master server: " + dnsEnumResult["serveur maitre"],
              bg="#1f2223", fg="#27beec", font=font.Font(size=15), pady=5, anchor="w")\
            .pack(side=TOP, expand=True, fill='x')

        if dnsEnumResult["Zone"]:
            maxLen = 0
            for dnsName in dnsEnumResult["ZoneInfos"].keys():
                if len(dnsName) > maxLen:
                    maxLen = len(dnsName)

            listDNSinfos = ScrollableFrame(dnsEnumFrame)

            for dnsName, infos in dnsEnumResult["ZoneInfos"].items():

                containerF = Frame(listDNSinfos.scrollable_frame)
                Label(containerF,
                      text=dnsName,
                      bg="#1f2223",
                      anchor="w",
                      fg="#27beec",
                      width=maxLen).pack(side=LEFT)
                Label(containerF, text=": " + infos[0], bg="#1f2223", anchor="w", fg="#27beec")\
                    .pack(side=LEFT, expand=True, fill='x')
                containerF.pack(side=TOP, expand=True, fill='x')

                for i in range(1, len(infos)):
                    containerOtherInfos = Frame(listDNSinfos.scrollable_frame)
                    Label(containerOtherInfos,
                          text="",
                          width=maxLen,
                          bg="#1f2223").pack(side=LEFT)
                    Label(containerOtherInfos, text=": " + infos[i], bg="#1f2223", anchor="w", fg="#27beec")\
                        .pack(side=LEFT, expand=True, fill='x')
                    containerOtherInfos.pack(side=TOP, expand=True, fill='x')

            listDNSinfos.pack(side=TOP, expand=True, fill="both")
        else:
            Label(dnsEnumFrame,
                  text="Zone transfert failure",
                  bg="#1f2223",
                  fg="red",
                  font=font.Font(size=25),
                  pady=30).pack(side=TOP)

        dnsEnumFrame.pack(side=TOP, expand=True, fill='both')
        return

    def displayMailExtractorInterface():

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=55, padx=200)
        Label(mainFrame,
              text="Mail-extractor",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)
        targetFrame = Frame(mainFrame, bg="#1f2223", pady=30)
        domainEntry = Entry(targetFrame)
        Button(targetFrame, bg="#29353a", fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
               bd=0, text="Scan domain:", command=functools.partial(extractMails, domainEntry), highlightthickness=0) \
            .pack(side=LEFT)
        Label(targetFrame, bg="#1f2223", fg="#27beec",
              text="  ").pack(side=LEFT)
        domainEntry.pack(side=LEFT)
        targetFrame.pack(side=TOP)
        mainFrame.pack(side=TOP, expand=True, fill='both')

    def extractMails(domain):
        domainName = domain.get()
        e = MailsExtract.Extractor(domainName)
        listMails = e.crawl()

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrameMails = Frame(root, bg="#1f2223", pady=60, padx=200)

        Label(mainFrameMails,
              text="Found " + str(len(listMails)) + " mails in " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)

        listFrame = ScrollableFrame(mainFrameMails)

        for mails in listMails:
            Label(listFrame.scrollable_frame, text=mails, bg="#1f2223", anchor="w", fg="#27beec") \
                .pack(side=TOP, expand=True, fill='x')

        listFrame.pack(side=TOP, expand=True, fill="both")

        mainFrameMails.pack(side=TOP, expand=True, fill='both')

        return

    def displayWhoIsInterface():

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=55, padx=200)
        Label(mainFrame,
              text="WhoIs",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)
        targetFrame = Frame(mainFrame, bg="#1f2223", pady=30)
        domainEntry = Entry(targetFrame)
        Button(targetFrame, bg="#29353a", fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
               bd=0, text="Scan domain:", command=functools.partial(launchWhoIs, domainEntry), highlightthickness=0) \
            .pack(side=LEFT)
        Label(targetFrame, bg="#1f2223", fg="#27beec",
              text="  ").pack(side=LEFT)
        domainEntry.pack(side=LEFT)
        targetFrame.pack(side=TOP)
        mainFrame.pack(side=TOP, expand=True, fill='both')

    def launchWhoIs(domain):
        domainName = domain.get()
        domainDict = WhoIs.new_whois(domainName)

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrameMails = Frame(root, bg="#1f2223", pady=25, padx=200)

        Label(mainFrameMails,
              text="Result for " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=30).pack(side=TOP)

        listFrame = ScrollableFrame(mainFrameMails)

        for field, valu in domainDict.items():
            Label(listFrame.scrollable_frame,
                  text=str(field) + ": " + str(valu),
                  bg="#1f2223",
                  anchor="w",
                  fg="#27beec").pack(side=TOP, expand=True, fill='x')

        listFrame.pack(side=TOP, expand=True, fill="both")

        mainFrameMails.pack(side=TOP, expand=True, fill="both")

    def displayShodanInterface():

        mainFrame = Frame(root, bg="#1f2223", pady=55, padx=200)
        Label(mainFrame,
              text="Shodan",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)
        targetFrame = Frame(mainFrame, bg="#1f2223", pady=30)
        domainEntry = Entry(targetFrame)
        Button(targetFrame, bg="#29353a", fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
               bd=0, text="Scan domain:", command=functools.partial(launchShodan, domainEntry), highlightthickness=0) \
            .pack(side=LEFT)
        Label(targetFrame, bg="#1f2223", fg="#27beec",
              text="  ").pack(side=LEFT)
        domainEntry.pack(side=LEFT)
        targetFrame.pack(side=TOP)
        for widget in root.winfo_children():
            if not widget.winfo_name(
            ) == topFrameName and not mainFrame.winfo_name(
            ) == widget.winfo_name():
                widget.destroy()
        mainFrame.pack(side=TOP, expand=True, fill='both')

    def launchShodan(domain):
        domainName = domain.get()
        domainDict = SHodan.SHodan(domainName)

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=25, padx=200)

        Label(mainFrame,
              text="Result for " + domainName,
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=30).pack(side=TOP)

        listFrame = ScrollableFrame(mainFrame)

        for field, valu in domainDict.items():
            if not field == "information" and not valu is None and len(
                    valu) > 0:
                Label(listFrame.scrollable_frame,
                      text=str(field) + ": " + str(valu),
                      bg="#1f2223",
                      anchor="w",
                      fg="#27beec").pack(side=TOP, expand=True, fill='x')

        if "information" in domainDict:
            maxLen = 11
            for banner in domainDict["information"]:
                containerF = Frame(listFrame.scrollable_frame)
                Label(containerF, text="port: " + str(banner["port"]), bg="#1f2223", anchor="w", fg="#27beec")\
                    .pack(side=LEFT, expand=True, fill='x')
                containerF.pack(side=TOP, expand=True, fill='x')

                for field, valu in banner.items():
                    if not field == "port":
                        containerOtherInfos = Frame(listFrame.scrollable_frame)
                        Label(containerOtherInfos,
                              text="",
                              width=maxLen,
                              bg="#1f2223").pack(side=LEFT)
                        Label(containerOtherInfos,
                              text=field + ": " + str(valu),
                              bg="#1f2223",
                              anchor="w",
                              fg="#27beec").pack(side=LEFT,
                                                 expand=True,
                                                 fill='x')
                        containerOtherInfos.pack(side=TOP,
                                                 expand=True,
                                                 fill='x')

        listFrame.pack(side=TOP, expand=True, fill="both")
        mainFrame.pack(side=TOP, expand=True, fill="both")
        return

    def displayNessusInterface():

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        mainFrame = Frame(root, bg="#1f2223", pady=55, padx=200)
        Label(mainFrame,
              text="Nessus API",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=10).pack(side=TOP)

        fieldWidth = 15
        entryTab = []
        fieldNames = ["login", "password", "target"]

        for i in range(3):
            containerFrame = Frame(mainFrame, bg="#1f2223", pady=10)
            Label(containerFrame,
                  text=fieldNames[i] + ": ",
                  bg="#1f2223",
                  fg="#27beec",
                  font=font.Font(size=11, weight="bold"),
                  pady=8,
                  width=fieldWidth,
                  justify=LEFT).pack(side=LEFT)
            entryTab.append(Entry(containerFrame))
            entryTab[i].pack(side=LEFT)
            containerFrame.pack(side=TOP)
        Label(mainFrame,
              text=" ",
              bg="#1f2223",
              fg="#27beec",
              font=font.Font(size=15, weight="bold"),
              pady=6).pack(side=TOP)
        Button(mainFrame,
               bg="#29353a",
               fg="#27beec",
               activebackground="#384d54",
               activeforeground="#27beec",
               bd=0,
               text="Launch basic nessus scan",
               command=functools.partial(launchNessusBasicScan, entryTab),
               highlightthickness=0).pack(side=TOP)
        mainFrame.pack(side=TOP, expand=True, fill='both')

    def launchNessusBasicScan(listEntry):

        login = listEntry[0].get()
        password = listEntry[1].get()
        target = listEntry[2].get()

        for widget in root.winfo_children():
            if not widget.winfo_name() == topFrameName:
                widget.destroy()
        try:
            nessusPy.doScanByNessus(login, password, target, "basic")
            mainFrame = Frame(root, bg="green")
            Label(mainFrame,
                  text='Nessus scan launched',
                  font=font.Font(weight="bold", size=25),
                  bg="#1f2223",
                  fg="#27beec",
                  height=5).pack(side=TOP)
            mainFrame.pack(side=TOP, fill="both", expand=True)
        except:
            t = sys.exc_info()
            mainFrame = Frame(root, bg="green")
            Label(mainFrame,
                  text=sys.exc_info()[1],
                  font=font.Font(weight="bold", size=25),
                  bg="#1f2223",
                  fg="#27beec",
                  height=5,
                  padx=40).pack(side=TOP, expand=True, fill="both")
            mainFrame.pack(side=TOP, fill="both", expand=True)

            print("Unexpected error:", sys.exc_info()[1])

    topFrame = Frame(root,
                     relief='flat',
                     bg="red",
                     cursor="crosshair",
                     name="topFrame")
    buttonFont = font.Font(weight="bold", size=10)

    Button(topFrame,
           bg="#1f2223",
           bd=0,
           fg="#27beec",
           text="WhoIs",
           command=displayWhoIsInterface,
           activebackground="#384d54",
           activeforeground="#27beec",
           font=buttonFont,
           highlightthickness=0).pack(side=LEFT, expand=True, fill="x")
    Button(topFrame, bg="#1f2223", bd=0, fg="#27beec", activebackground="#384d54", activeforeground="#27beec",
           font=buttonFont, highlightthickness=0, text="Shodan", command=displayShodanInterface, ) \
        .pack(side=LEFT, expand=True, fill="x")
    Button(topFrame,
           bg="#1f2223", bd=0, fg="#27beec", text="Mails Extract", command=displayMailExtractorInterface,
           activebackground="#384d54", activeforeground="#27beec", font=buttonFont, highlightthickness=0)\
        .pack(side=LEFT, expand=True, fill="x")
    Button(topFrame,
           bg="#1f2223", bd=0, fg="#27beec", text="Dns Enum", command=displayDnsEnumInterface,
           activebackground="#384d54", activeforeground="#27beec", font=buttonFont, highlightthickness=0)\
        .pack(side=LEFT, expand=True, fill="x")
    Button(topFrame,
           bg="#1f2223", bd=0, fg="#27beec", text="Nmap", command=displayNmapInterface, activebackground="#384d54",
           activeforeground="#27beec", font=buttonFont, highlightthickness=0)\
        .pack(side=LEFT, expand=True, fill="x")
    Button(topFrame,
           bg="#1f2223", bd=0, fg="#27beec", text="Nessus", command=displayNessusInterface,
           activebackground="#384d54", activeforeground="#27beec", font=buttonFont, highlightthickness=0)\
        .pack(side=LEFT, expand=True, fill="x")
    topFrame.pack(side=TOP, padx=0, pady=0, fill="x")

    topFrameName = topFrame.winfo_name()

    displayWelcomeInterface()

    root.mainloop()
예제 #25
0
def goAuteur():

    with open('Ressources/data/langue', 'rb') as langue:
        langue_depickler = pickle.Unpickler(langue)
        var_langue = langue_depickler.load()

    fenAuteur = tk.Toplevel()
    fenAuteur.geometry("560x760")
    fenAuteur.config(bg="#CECECE")
    fenAuteur.title("Auteur")
    centrefenetre(fenAuteur)

    fenAuteur.resizable(
        width=False,
        height=False)  #  Redimensionnement de la fenêtre immobilisée.

    police_auteur = font.Font(
        fenAuteur, size=12, weight='bold', family='Helvectica'
    )  # Mise en place du style police correspondant aux auteurs.
    police_url = font.Font(
        fenAuteur, size=11, weight='bold', family='Helvectica'
    )  # Mise en place du style police correspondant auxs mail des auteurs.

    #
    # Affichage correspondant à l'auteur <Alexandre Heintzmann>.
    #

    champ_label_auteur1 = tk.Label(
        fenAuteur,
        text=
        "<Alexandre Heintzmann>\n\n Etudiant à l'université Paris Descartes\n UFR : Mathématiques - Informatique\n",
        bg="#CECECE",
        font=police_auteur)
    champ_label_auteur1.place(relx=0.5, rely=0.10, anchor="center")

    champ_label_mail_auteur1 = tk.Label(
        fenAuteur,
        text="Mail de contact : [email protected]",
        bg="#CECECE",
        font=police_url)
    champ_label_mail_auteur1.place(relx=0.5, rely=0.16, anchor="center")

    champ_label_mail_auteur1.bind(
        "<Enter>", lien_text(champ_label_mail_auteur1, event=None)
    )  # Définition d'action d'ouverture en fonction de l'utilisateur.
    champ_label_mail_auteur1.bind("<Button-1>", goMailDev1)

    bouton_auteur1 = tk.Button(fenAuteur,
                               text="Visitez le site Web",
                               bg="#ECECEC",
                               command=lambda: goSiteDev1())
    bouton_auteur1.place(relx=.7, rely=.20, anchor="center")
    bouton_auteur1.config(highlightbackground="#CECECE")

    #
    # Affichage correspondant à l'auteur <Benjamin Cohen>.
    #

    champ_label_auteur2 = tk.Label(
        fenAuteur,
        text=
        "<Benjamin Cohen>\n\n Etudiant à l'université Paris Descartes\n UFR : Mathématiques - Informatique\n",
        bg="#CECECE",
        font=police_auteur)
    champ_label_auteur2.place(relx=0.5, rely=0.29, anchor="center")

    champ_label_mail_auteur2 = tk.Label(
        fenAuteur,
        text="Mail de contact : [email protected]",
        bg="#CECECE",
        font=police_url)
    champ_label_mail_auteur2.place(relx=0.5, rely=0.34, anchor="center")

    champ_label_mail_auteur2.bind(
        "<Enter>", lien_text(champ_label_mail_auteur2, event=None)
    )  # Définition d'action d'ouverture en fonction de l'utilisateur.
    champ_label_mail_auteur2.bind("<Button-1>", goMailDev2)

    bouton_auteur2 = tk.Button(fenAuteur,
                               text="Visitez le site Web",
                               bg="#ECECEC",
                               command=lambda: goSiteDev2())
    bouton_auteur2.place(relx=.7, rely=.38, anchor="center")
    bouton_auteur2.config(highlightbackground="#CECECE")

    #
    # Affichage correspondant à l'auteur <Helmy El Rais>.
    #

    champ_label_auteur3 = tk.Label(
        fenAuteur,
        text=
        "<Helmy El Rais>\n\n Etudiant à l'université Paris Descartes\n UFR : Mathématiques - Informatique\n",
        bg="#CECECE",
        font=police_auteur)
    champ_label_auteur3.place(relx=0.5, rely=0.47, anchor="center")

    champ_label_mail_auteur3 = tk.Label(
        fenAuteur,
        text="Mail de contact : [email protected]",
        bg="#CECECE",
        font=police_url)
    champ_label_mail_auteur3.place(relx=0.5, rely=0.52, anchor="center")

    champ_label_mail_auteur3.bind(
        "<Enter>", lien_text(champ_label_mail_auteur3, event=None)
    )  # Définition d'action d'ouverture en fonction de l'utilisateur.
    champ_label_mail_auteur3.bind("<Button-1>", goMailDev3)

    bouton_auteur3 = tk.Button(fenAuteur,
                               text="Visitez le site Web",
                               bg="#ECECEC",
                               command=lambda: goSiteDev3())
    bouton_auteur3.place(relx=.7, rely=.56, anchor="center")
    bouton_auteur3.config(highlightbackground="#CECECE")

    #
    # Affichage correspondant à l'auteur <Raphael Depain>.
    #

    champ_label_auteur4 = tk.Label(
        fenAuteur,
        text=
        "<Raphael Depain>\n\n Etudiant à l'université Paris Descartes\n UFR : Mathématiques - Informatique\n",
        bg="#CECECE",
        font=police_auteur)
    champ_label_auteur4.place(relx=0.5, rely=0.65, anchor="center")

    champ_label_mail_auteur4 = tk.Label(
        fenAuteur,
        text="Mail de contact : [email protected]",
        bg="#CECECE",
        font=police_url)
    champ_label_mail_auteur4.place(relx=0.5, rely=0.72, anchor="center")

    champ_label_mail_auteur4.bind(
        "<Enter>", lien_text(champ_label_mail_auteur4, event=None)
    )  # Définition d'action d'ouverture en fonction de l'utilisateur.
    champ_label_mail_auteur4.bind("<Button-1>", goMailDev4)

    bouton_auteur4 = tk.Button(fenAuteur,
                               text="Visitez le site Web",
                               bg="#ECECEC",
                               command=lambda: goSiteDev4())
    bouton_auteur4.place(relx=.7, rely=.76, anchor="center")
    bouton_auteur4.config(highlightbackground="#CECECE")

    #
    # Affichage correspondant à l'auteur <Thomas Zhou>.
    #

    champ_label_auteur5 = tk.Label(
        fenAuteur,
        text=
        "<Thomas Zhou>\n\n Etudiant à l'université Paris Descartes\n UFR : Mathématiques - Informatique\n",
        bg="#CECECE",
        font=police_auteur)
    champ_label_auteur5.place(relx=0.5, rely=0.85, anchor="center")

    champ_label_mail_auteur5 = tk.Label(
        fenAuteur,
        text="Mail de contact : [email protected]",
        bg="#CECECE",
        font=police_url)
    champ_label_mail_auteur5.place(relx=0.5, rely=0.92, anchor="center")

    champ_label_mail_auteur5.bind(
        "<Enter>", lien_text(champ_label_mail_auteur5, event=None)
    )  # Définition d'action d'ouverture en fonction de l'utilisateur.
    champ_label_mail_auteur5.bind("<Button-1>", goMailDev5)

    bouton_auteur5 = tk.Button(fenAuteur,
                               text="Visitez le site Web",
                               bg="#ECECEC",
                               command=lambda: goSiteDev5())
    bouton_auteur5.place(relx=.7, rely=.96, anchor="center")
    bouton_auteur5.config(highlightbackground="#CECECE")

    if var_langue == "anglais":
        champ_label_auteur1[
            "text"] = "<Alexandre Heintzmann>\n\n Student at Paris Descartes University\n UFR : Mathematics - Computer Science\n"
        champ_label_mail_auteur1[
            "text"] = "Email : [email protected]"
        bouton_auteur1["text"] = "Website"

        champ_label_auteur2[
            "text"] = "<Benjamin Cohen>\n\n Student at Paris Descartes University\n UFR : Mathematics - Computer Science\n"
        champ_label_mail_auteur2[
            "text"] = "Email : [email protected]"
        bouton_auteur2["text"] = "Website"

        champ_label_auteur3[
            "text"] = "<Helmy El Rais>\n\n Student at Paris Descartes University\n UFR : Mathematics - Computer Science\n"
        champ_label_mail_auteur3[
            "text"] = "Email : [email protected]"
        bouton_auteur3["text"] = "Website"

        champ_label_auteur4[
            "text"] = "<Raphael Depain>\n\n Student at Paris Descartes University\n UFR : Mathematics - Computer Science\n"
        champ_label_mail_auteur4[
            "text"] = "Email : [email protected]"
        bouton_auteur4["text"] = "Website"

        champ_label_auteur5[
            "text"] = "<Thomas Zhou>\n\n Student at Paris Descartes University\n UFR : Mathematics - Computer Science\n"
        champ_label_mail_auteur5[
            "text"] = "Email : [email protected]"
        bouton_auteur5["text"] = "Website"

    fenAuteur.wm_attributes(
        '-alpha', 0.96)  # Définition du style de transparence de la fenêtre.

    fenAuteur.mainloop()
예제 #26
0
def padding(box, h, f):  #height, font size
    p = Label(box, text='', height=h)
    p['font'] = font.Font(size=f)
    p.pack()
예제 #27
0
    def draw_game_info_grid(self):
        '''
        Draw control and inform part of game to right side of the window.
        '''
        self.info = Canvas(self.root,
                           height=self.h - self.gridh,
                           width=self.w - self.gridw)
        self.info.pack(side="left")

        label_stones = Label(self.info,
                             text="Current stones:",
                             font=("Helvetica", 10))
        label_stones.grid(row=1, column=0)
        label_max_time = Label(self.info,
                               text="Max time:",
                               font=("Helvetica", 10))
        label_max_time.grid(row=2, column=0)

        label_scale = Label(self.info,
                            text='Game speed [ms]:',
                            font=("Helvetica", 10),
                            foreground='black')
        label_scale.grid(row=5, column=0)

        helv36 = font.Font(family="helvetica", size=16, weight='bold')
        self.scale_var = IntVar()
        scale = Scale(self.info,
                      variable=self.scale_var,
                      command=self.sleep_time_change_handler,
                      from_=0,
                      to=1000,
                      resolution=10,
                      width="15",
                      orient=HORIZONTAL,
                      length="225")
        scale.set(200)
        scale.grid(row=5, column=1, columnspan=3)

        self.button = Button(self.info,
                             text="Play",
                             width="20",
                             height="2",
                             command=self.play_button_click_handler)
        self.button['font'] = helv36
        self.button.grid(row=6, column=0, columnspan=4)

        # labels for num stones, max time of move, etc
        self.label_player_stones = [-1, -1]
        self.label_player_max_time = [-1, -1]
        self.labels_inform = [-1, -1]
        self.labels_player_name = [-1, -1]
        self.option_menus = [-1, -1]
        self.option_menus_vars = [-1, -1]

        for i in range(2):
            self.label_player_stones[i] = Label(self.info,
                                                text='2',
                                                font=("Helvetica", 10),
                                                foreground=self.colors[i])
            self.label_player_stones[i].grid(row=1,
                                             column=2 * (i + 1) - 1,
                                             columnspan=2)

            self.label_player_max_time[i] = Label(self.info,
                                                  text="%.2f [ms]" % 0.0,
                                                  font=("Helvetica", 10),
                                                  foreground=self.colors[i])
            self.label_player_max_time[i].grid(row=2,
                                               column=2 * (i + 1) - 1,
                                               columnspan=2)

            self.labels_inform[i] = Label(self.info,
                                          text='',
                                          font=("Helvetica", 10),
                                          foreground='black')
            self.labels_inform[i].grid(row=i + 3, column=0, columnspan=4)

            self.labels_player_name[i] = Label(self.info,
                                               text="Player%d:" % (i),
                                               font=("Helvetica", 12),
                                               foreground=self.colors[i])
            self.labels_player_name[i].grid(row=0, column=2 * i)

            self.option_menus_vars[i] = StringVar(self.root)
            self.option_menus_vars[i].set(self.interractivePlayerName)
            self.option_menus[i] = OptionMenu(self.info,
                                              self.option_menus_vars[i],
                                              *self.possiblePlayers)
            self.option_menus[i].grid(row=0, column=2 * i + 1)
예제 #28
0
 def _GetMaxWidthDescription(self):
     maximum = 0
     for desc in self.descriptionsVideo:
         if maximum < tkFont.Font().measure(desc):
             maximum = tkFont.Font().measure(desc)
     return maximum
예제 #29
0
    def __init__(self, top=None):
        global vMult, changeRomVal
        '''This class configures and populates the toplevel window.
		   top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9'  # X11 color: 'gray85'
        _ana1color = '#d9d9d9'  # X11 color: 'gray85'
        _ana2color = '#ececec'  # Closest X11 color: 'gray92'
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.', background=_bgcolor)
        self.style.configure('.', foreground=_fgcolor)
        self.style.configure('.', font="TkDefaultFont")
        self.style.map('.',
                       background=[('selected', _compcolor),
                                   ('active', _ana2color)])
        self.font = tkFont.Font(family='TkDefaultFont')
        self.tooltip_font = "TkDefaultFont"

        self.top = top
        self.top.geometry(str(750) + "x" + str(450))
        self.top.minsize(750, 450)
        # self.top.maxsize(2000, 600)
        self.top.resizable(1, 1)
        self.top.title(Program_Name)
        self.top.configure(background="#d9d9d9")
        self.top.configure(highlightbackground="#d9d9d9")
        self.top.configure(highlightcolor="black")

        ## Menu Bar
        menubar = tk.Menu(self.top, bg=_bgcolor, fg=_fgcolor, tearoff=0)
        fileMenu = tk.Menu(menubar, tearoff=0)
        fileMenu.add_command(label="Load File...", command=self.setSourceRom)
        fileMenu.add_separator()
        fileMenu.add_command(label="Exit", command=root.quit)
        menubar.add_cascade(label="File", menu=fileMenu)
        self.top.config(menu=menubar)
        helpMenu = tk.Menu(menubar, tearoff=0)
        helpMenu.add_command(label="View Help...", command=self.showHelpPopup)
        helpMenu.add_separator()
        if About_Page_Text is not None and About_Page_Text != "":
            helpMenu.add_command(label="About...", command=self.showAboutPopup)
        helpMenu.add_command(label="Simple Randomizer Maker",
                             command=self.showSRMPopup)
        menubar.add_cascade(label="Help", menu=helpMenu)
        self.top.config(menu=menubar)

        self.style.map('TCheckbutton',
                       background=[('selected', _bgcolor),
                                   ('active', _ana2color)])
        self.style.map('TRadiobutton',
                       background=[('selected', _bgcolor),
                                   ('active', _ana2color)])

        vMult = 700.0 / 600

        # Rom Input Label
        self.Label_RomInput = ttk.Label(self.top)
        self.Label_RomInput.configure(background="#d9d9d9")
        self.Label_RomInput.configure(foreground="#000000")
        self.Label_RomInput.configure(font="TkDefaultFont")
        self.Label_RomInput.configure(relief="flat")
        self.Label_RomInput.configure(anchor='w')
        self.Label_RomInput.configure(justify='left')

        # Rom Input Entry
        self.Entry_RomInput = ttk.Entry(self.top)
        self.Entry_RomInput.configure(state='readonly')
        self.Entry_RomInput.configure(background="#000000")
        self.Entry_RomInput.configure(cursor="ibeam")

        # Change Rom Source Buttons
        if len(Rom_Name) > 1:
            btnSize = .035
            changeRomVal = btnSize * 2 + .01
            # Previous Source Rom Button
            self.Button_PrevSourceRom = ttk.Button(self.top)
            self.Button_PrevSourceRom.place(relx=.035,
                                            rely=.0365 * vMult,
                                            relheight=.057 * vMult,
                                            relwidth=btnSize)
            self.Button_PrevSourceRom.configure(
                command=self.decrementAndSetRomInput)
            self.Button_PrevSourceRom.configure(takefocus="")
            self.Button_PrevSourceRom.configure(text='<')

            # Next Source Rom Button
            self.Button_NextSourceRom = ttk.Button(self.top)
            self.Button_NextSourceRom.place(relx=.035 + btnSize + .005,
                                            rely=.0365 * vMult,
                                            relheight=.057 * vMult,
                                            relwidth=btnSize)
            self.Button_NextSourceRom.configure(
                command=self.incrementAndSetRomInput)
            self.Button_NextSourceRom.configure(takefocus="")
            self.Button_NextSourceRom.configure(text='>')
        else:
            changeRomVal = 0

        # Rom Input Label and Entry
        self.setRomInput()

        # Rom Input Button
        self.Button_RomInput = ttk.Button(self.top)
        self.Button_RomInput.place(relx=.845,
                                   rely=.0365 * vMult,
                                   relheight=.057 * vMult,
                                   relwidth=.12)
        self.Button_RomInput.configure(command=self.setSourceRom)
        self.Button_RomInput.configure(takefocus="")
        self.Button_RomInput.configure(text='Load File')

        # Use Settings Radio Button
        self.RadioButton_UseSettings = ttk.Radiobutton(self.top)
        self.RadioButton_UseSettings.place(
            relx=.035,
            rely=.11 * vMult,
            relheight=.05 * vMult,
            relwidth=self.getTextLength('Use Settings'))
        self.RadioButton_UseSettings.configure(variable=useSeed)
        self.RadioButton_UseSettings.configure(value="0")
        self.RadioButton_UseSettings.configure(text='Use Settings')
        self.RadioButton_UseSettings.configure(compound='none')
        self.RadioButton_UseSettings_tooltip = ToolTip(
            self.RadioButton_UseSettings, self.tooltip_font,
            'Use the settings defined below to create a random seed.')

        # Use Seed Radio Button
        self.RadioButton_UseSeed = ttk.Radiobutton(self.top)
        self.RadioButton_UseSeed.place(
            relx=.035 - .01 + .81 - self.getTextLength("W" * (stringLen + 1)) -
            self.getTextLength('Use Seed'),
            rely=.11 * vMult,
            relheight=.057 * vMult,
            relwidth=self.getTextLength('Use Seed'))
        self.RadioButton_UseSeed.configure(variable=useSeed)
        self.RadioButton_UseSeed.configure(text='''Use Seed''')
        self.RadioButton_UseSeed_tooltip = ToolTip(
            self.RadioButton_UseSeed, self.tooltip_font,
            'Recreate a specific set of changes according to a seed.')

        # Seed Input Entry
        self.Entry_SeedInput = ttk.Entry(self.top)
        # old relx=.37+self.getTextLength('Use Seed')
        self.Entry_SeedInput.place(
            relx=.035 - .01 + .81 - self.getTextLength("W" * (stringLen + 1)),
            rely=.11 * vMult,
            relheight=.05 * vMult,
            relwidth=self.getTextLength("W" * (stringLen + 1)))
        self.Entry_SeedInput.configure(state='normal')
        self.Entry_SeedInput.configure(textvariable=seedInput)
        self.Entry_SeedInput.configure(takefocus="")
        self.Entry_SeedInput.configure(cursor="ibeam")
        self.Entry_SeedInput.bind('<Key>', self.keepUpperCharsSeed)
        self.Entry_SeedInput.bind('<KeyRelease>', self.keepUpperCharsSeed)

        # Frame
        self.TFrame1 = ttk.Frame(self.top)
        self.TFrame1.place(relx=.035,
                           rely=.18 * vMult,
                           relheight=.55 * vMult,
                           relwidth=.93)
        self.TFrame1.configure(relief='groove')
        self.TFrame1.configure(borderwidth="2")
        self.TFrame1.configure(relief="groove")

        # Change Ruleset Page Buttons
        if len(Optional_Rulesets) > 14:
            btnSize = .035
            # Previous Source Rom Button
            self.Button_PrevRulesetPage = ttk.Button(self.top)
            self.Button_PrevRulesetPage.place(relx=.93 - btnSize - .005,
                                              rely=(.18 + .55 - .057) * vMult,
                                              relheight=.057 * vMult,
                                              relwidth=btnSize)
            self.Button_PrevRulesetPage.configure(
                command=self.decrementAndSetDisplayedRulesets)
            self.Button_PrevRulesetPage.configure(takefocus="")
            self.Button_PrevRulesetPage.configure(text='<')

            # Next Source Rom Button
            self.Button_NextRulesetPage = ttk.Button(self.top)
            self.Button_NextRulesetPage.place(relx=.93,
                                              rely=(.18 + .55 - .057) * vMult,
                                              relheight=.057 * vMult,
                                              relwidth=btnSize)
            self.Button_NextRulesetPage.configure(
                command=self.incrementAndSetDisplayedRulesets)
            self.Button_NextRulesetPage.configure(takefocus="")
            self.Button_NextRulesetPage.configure(text='>')

        # Ruleset Check Buttons, Number of Seeds Label, Number of Seeds Dropdown
        self.CheckButtons = []
        self.CheckButtons_tooltips = []
        global optRulesetValues
        for i in range(len(Optional_Rulesets)):
            self.CheckButtons.append(ttk.Checkbutton(
                self.top))  # self.TFrame1 to put in frame
            self.CheckButtons[i].configure(variable=optRulesetValues[i])
            self.CheckButtons[i].configure(offvalue="0")
            self.CheckButtons[i].configure(onvalue="1")
            self.CheckButtons[i].configure(takefocus="")
            self.CheckButtons[i].configure(text=Optional_Rulesets[i].name)
            self.CheckButtons_tooltips.append(
                ToolTip(self.CheckButtons[i], self.tooltip_font,
                        Optional_Rulesets[i].description))
        self.Label_NumSeeds = ttk.Label(self.top)
        self.Label_NumSeeds.configure(background="#d9d9d9")
        self.Label_NumSeeds.configure(foreground="#000000")
        self.Label_NumSeeds.configure(font="TkDefaultFont")
        self.Label_NumSeeds.configure(relief="flat")
        self.Label_NumSeeds.configure(anchor='w')
        self.Label_NumSeeds.configure(justify='left')
        self.Label_NumSeeds.configure(text='# of Seeds')
        self.Label_NumSeeds_tooltip = ToolTip(
            self.Label_NumSeeds, self.tooltip_font,
            'How many seeds would you like to generate?')
        self.ComboBox_NumSeeds = ttk.Combobox(self.top)
        self.ComboBox_NumSeeds.configure(values=[
            '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12',
            '13', '14', '15', '16', '17', '18', '19', '20'
        ])
        self.ComboBox_NumSeeds.configure(state='readonly')
        self.ComboBox_NumSeeds.configure(textvariable=numSeeds)
        self.setDisplayedRulesets()

        # Text Log Check Button
        self.CheckButton_GenerateTextLog = ttk.Checkbutton(self.top)
        self.CheckButton_GenerateTextLog.place(relx=.25,
                                               rely=.895,
                                               relheight=.05 * vMult,
                                               relwidth=.20)
        self.CheckButton_GenerateTextLog.configure(variable=generateLog)
        self.CheckButton_GenerateTextLog.configure(takefocus="")
        self.CheckButton_GenerateTextLog.configure(text='Generate Text Log')
        self.CheckButton_GenerateTextLog_tooltip = ToolTip(
            self.CheckButton_GenerateTextLog, self.tooltip_font,
            'Would you like to generate a text file that details what abilities are tied to each enemy/object in the created seed?'
        )

        # Create Rom Button
        self.Button_CreateRom = ttk.Button(self.top)
        self.Button_CreateRom.place(relx=.55,
                                    rely=.8915,
                                    relheight=.057 * vMult,
                                    relwidth=.144)
        self.Button_CreateRom.configure(takefocus="")
        self.Label_NumSeeds.configure(anchor='w')
        self.Button_CreateRom.configure(text='''Randomize!''')

        # Other
        self.RadioButton_UseSettings.configure(
            command=self.prepareSettingsAndSeed)
        self.RadioButton_UseSeed.configure(command=self.prepareSettingsAndSeed)
        self.Button_CreateRom.configure(command=self.attemptRandomize)
        for i in range(min(len(Optional_Rulesets), 13)):
            self.CheckButtons[i].configure(
                command=self.prepareSettingsFromDependencies)
        self.prepareSettingsFromDependencies()
예제 #30
0
def make_label(box, t, f):  #text, font size
    lbl = Label(box, text=t, height=1)
    lbl['font'] = font.Font(size=f)
    lbl.pack()