File tree Expand file tree Collapse file tree 4 files changed +6
-14
lines changed Expand file tree Collapse file tree 4 files changed +6
-14
lines changed Original file line number Diff line number Diff line change 11import os
2- import re
3- import numpy as np
42
53from sklearn .feature_extraction .text import CountVectorizer
64from sklearn .feature_extraction .text import TfidfTransformer
@@ -57,23 +55,23 @@ def check_webshell(dir):
5755 for filename in filelist :
5856 fulpath = os .path .join (path , filename )
5957 all += 1
60- if filename .endswith ('.php' ):
58+ if filename .endswith ('.php' ) or filename . endswith ( '.txt' ) :
6159 all_php += 1
6260 t = load_str (fulpath )
6361 t_list = []
6462 t_list .append (t )
6563 x = CV1 .transform (t_list ).toarray ()
6664 x = transformer .fit_transform (x ).toarray ()
6765 y_pred = clf1 .predict (x )
68- elif filename .endswith ('.asp' ):
66+ elif filename .endswith ('.asp' ) or filename . endswith ( '.txt' ) :
6967 all_asp += 1
7068 t = load_str (fulpath )
7169 t_list = []
7270 t_list .append (t )
7371 x = CV2 .transform (t_list ).toarray ()
7472 x = transformer .fit_transform (x ).toarray ()
7573 y_pred = clf2 .predict (x )
76- elif filename .endswith ('.jsp' ):
74+ elif filename .endswith ('.jsp' ) or filename . endswith ( '.txt' ) :
7775 all_jsp += 1
7876 t = load_str (fulpath )
7977 t_list = []
Original file line number Diff line number Diff line change 1- import re
21import os
3- import numpy as np
42
53from sklearn .feature_extraction .text import CountVectorizer
64from sklearn .model_selection import train_test_split
@@ -32,7 +30,7 @@ def load_files(dir):
3230 g = os .walk (dir )
3331 for path , d , filelist in g :
3432 for filename in filelist :
35- if filename .endswith ('.asp' ) or filename . endswith ( '.txt' ) :
33+ if filename .endswith ('.asp' ):
3634 fulpath = os .path .join (path , filename )
3735 print "Load %s" % fulpath
3836 t = load_str (fulpath )
Original file line number Diff line number Diff line change 1- import re
21import os
3- import numpy as np
42
53from sklearn .feature_extraction .text import CountVectorizer
64from sklearn .model_selection import train_test_split
@@ -32,7 +30,7 @@ def load_files(dir):
3230 g = os .walk (dir )
3331 for path , d , filelist in g :
3432 for filename in filelist :
35- if filename .endswith ('.jsp' ) or filename . endswith ( 'txt' ) :
33+ if filename .endswith ('.jsp' ):
3634 fulpath = os .path .join (path , filename )
3735 print "Load %s" % fulpath
3836 t = load_str (fulpath )
Original file line number Diff line number Diff line change 1- import re
21import os
3- import numpy as np
42
53from sklearn .feature_extraction .text import CountVectorizer
64from sklearn .model_selection import train_test_split
@@ -32,7 +30,7 @@ def load_files(dir):
3230 g = os .walk (dir )
3331 for path , d , filelist in g :
3432 for filename in filelist :
35- if filename .endswith ('.php' ) or filename . endswith ( '.txt' ) :
33+ if filename .endswith ('.php' ):
3634 fulpath = os .path .join (path , filename )
3735 print "Load %s" % fulpath
3836 t = load_str (fulpath )
You can’t perform that action at this time.
0 commit comments