Skip to content

Commit fa9c585

Browse files
committed
V1.0
1 parent 2ed4a18 commit fa9c585

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def check_webshell(dir):
8585
other += 1
8686

8787
if y_pred[0] == 1:
88-
print "%s is webshell" % fulpath
88+
print "%s may be a webshell file" % fulpath
8989
webshell += 1
9090

9191
print "Scan %d files(%d php files, %d asp files, %d jsp files, %d other files),%d files is webshell" % (all, all_php, all_asp, all_jsp, other, webshell)

train_asp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
max_features = 50000
1414

15-
webshell_dir = "Data2/WebShell/asp/"
16-
normal_dir = "Data2/normal/asp/"
15+
webshell_dir = "Data/WebShell/asp/"
16+
normal_dir = "Data/normal/asp/"
1717

1818
white_count = 0
1919
black_count = 0

train_jsp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
max_features = 50000
1414

15-
webshell_dir = "Data2/WebShell/jsp/"
16-
normal_dir = "Data2/normal/jsp/"
15+
webshell_dir = "Data/WebShell/jsp/"
16+
normal_dir = "Data/normal/jsp/"
1717

1818
white_count = 0
1919
black_count = 0
@@ -32,7 +32,7 @@ def load_files(dir):
3232
g = os.walk(dir)
3333
for path, d, filelist in g:
3434
for filename in filelist:
35-
if filename.endswith('.jsp'):
35+
if filename.endswith('.jsp') or filename.endswith('txt'):
3636
fulpath = os.path.join(path, filename)
3737
print "Load %s" % fulpath
3838
t = load_str(fulpath)

train_php.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
max_features = 50000
1414

15-
webshell_dir = "Data2/WebShell/php/"
16-
normal_dir = "Data2/normal/php/"
15+
webshell_dir = "Data/WebShell/php/"
16+
normal_dir = "Data/normal/php/"
1717

1818
white_count = 0
1919
black_count = 0

0 commit comments

Comments
 (0)