Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from urllib.request import *
- from random import *
- import os
- urlt = [] * 1
- def menu ():
- print("----------------------------")
- print("[1] Password generator ")
- print("[2] Take urls from a webpage ")
- print("[3] Take e-mail from a webpage ")
- print("[4] Connect to a web page and save source on a txt")
- print("[5] Steal data (GOT)")
- print("----------------------------")
- #choix = int(input(""))
- choix = int(input(""))
- if choix == 1 :
- passgen()
- elif choix == 2 :
- findurl()
- elif choix == 3 :
- femail()
- elif choix == 4 :
- femail()
- elif choix == 5 :
- fgot()
- def findurl():
- connecturl()
- fichier = open("code.txt","r")
- text = fichier.read()
- fichier.close()
- os.remove("code.txt")
- a = text[0]
- b = a
- c=b
- d=c
- e=d
- comp2=0
- for i in range(len(text)):
- a = text[i]
- b=text[i-1]
- c=text[i-2]
- d=text[i-3]
- e=text[i-4]
- urls=""
- comp=0
- if (a+b+c+d+e) == "=ferh" :
- url = text[i+2:len(text)]
- for j in range(len(url)):
- if url[j] == chr(34) and url[0]=="h" and comp==0:
- comp=1
- comp2 = comp2 + 1
- urls=url[0:j]
- urlt.append(urls)
- print(urls)
- print("\nAmount of url found : ",comp2)
- sav = input(".txt name\n")
- if sav != "":
- fichier = open(sav+".txt","w")
- for i in range(len(urlt)):
- fichier.write(urlt[i]+"\n")
- fichier.close()
- def femail():
- import re
- connecturl()
- fichier = open("code.txt","r")
- text = fichier.read()
- fichier.close()
- os.remove("code.txt")
- print(re.match("([^@|\s]+@[^@]+\.[^@|\s]+)",text))
- def connecturl() :
- domaine = input("Enter url Ex : http://google.com\n")
- aResp = urlopen(domaine);
- code = aResp.read()
- fichier = open("code"+".txt","w")
- fichier.write(str(code))
- fichier.close
- def passgen() :
- long = input("Enter passowrd lenght\n")
- amount = input("Amount of password to generate\n")
- mdp = ""
- chaine = "abcdefghijklmopqrstuvwxyz123456789/*-+()'#é@&|ç{à}°?!è§=:µ£%ù$^[]"
- save = int(input("Save the list ? 1/0\n"))
- if save == 1 :
- namef = input("Enter the name of the txt \n")
- fichier = open(namef+".txt",'w')
- for i in range(int(amount)):
- chaine = "N°"+str(i+1)+": "+gen(amount,long)+"\n"
- fichier.write(chaine)
- print(chaine,end="")
- fichier.close()
- def gen(amount,long) :
- mdp = ""
- chaine = "abcdefghijklmopqrstuvwxyz123456789/*-+()'#é@&|ç{à}°?!è§=:µ£%ù$^[]"
- for j in range(int(amount)):
- for i in range(int(long)) :
- mdp = mdp + chaine[randrange(len(chaine))]
- return(mdp)
- mdp = ""
- def fgot():
- nfichier = input("Entrer le nom du fichier")
- while(1):
- menu()
Add Comment
Please, Sign In to add comment