-
Notifications
You must be signed in to change notification settings - Fork 118
/
plzrun.py
75 lines (68 loc) · 2.09 KB
/
plzrun.py
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
import csv
from datetime import date
import os
import subprocess
import pandas as pd
import re
from utilities.make_domains_list import domain_list
from utilities.aquatone_screenshotter import aquatone_run
import gspread
# import pygsheets
import pandas as pd
import ssl
from constants import res
ssl._create_default_https_context = ssl._create_unverified_context
import gspread
# import pygsheets
import pandas as pd
import ssl
import requests
context = ssl.create_default_context()
Context=ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
from urllib3.exceptions import InsecureRequestWarning
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
def csv_uploader(domain):
print("work6")
gc = gspread.service_account()
today=date.today()
d1 = today.strftime("%d/%m/%Y")
sh=gc.create('FFUF'+domain+d1)
print("work7")
content = open('./'+domain+'/tools/FFUF/csv_file.csv', "r").read().encode("utf8")
gc.import_csv(sh.id,data=content)
res[domain]={'FFUF':sh.id}
def to_csv(dir_name):
print("work")
cols=['Subdomain','Text','Status','Size','Words','Lines','Duration']
rows=[]
df=pd.DataFrame(rows,columns=cols)
subdomain=""
f=open('./'+dir_name+'/tools/FFUF/clean_master.txt','r')
flag=1
print("work1")
for line in f:
if(line=='\n'):
print("work3")
flag=2
elif(flag==2):
print("work4")
subdomain=line
flag=1
else:
print("work5")
text=(line.split(' ')[0])
s_idx=line.find('[')
e_idx=line.index(']')
data=line[s_idx:e_idx]
x=re.split(': |,',data)
rows=[]
rows.append({'Subdomain':subdomain,'Text':text,'Status':x[1],'Size':x[3],'Words':x[5],'Lines':x[7],'Duration':x[9]})
df1=pd.DataFrame(rows)
df=pd.concat([df,df1], ignore_index = True)
df.to_csv("./"+dir_name+"/tools/FFUF/csv_file.csv")
to_csv("example.com")