File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 41
41
* v2.0 更新搜索设计和算法
42
42
* v2.1 更新搜索结果输出展现
43
43
* v2.2 优化部分代码,增加项目搜索进度条,解决代码输出BUG
44
- * v2.4 优化程序目录设计,优化源码实现,删除冗余代码
44
+ * v2.4 优化程序目录设计,优化源码实现,增加默认文件输出
45
45
46
46
***
47
47
## Sensitive info scan tool of Github
Original file line number Diff line number Diff line change 4
4
FILE_DB = "pattern/file.db"
5
5
INFO_DB = "pattern/info.db"
6
6
7
+ # Output file default name
8
+ OUTPUT_FILE = "gitprey.txt"
9
+
7
10
# GitHub account config for searching
8
11
USER_NAME = "repoog"
9
- PASSWORD = ""
12
+ PASSWORD = "/*F0r0p3nS0urc3*/ "
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*-
3
3
4
+ try :
5
+ from config .Config import *
6
+ except ImportError :
7
+ print "[!_!]ERROR INFO: Can't find Config file for searching."
8
+ exit ()
4
9
5
10
def error_print (string ):
6
11
# Print error information with red color
@@ -15,17 +20,29 @@ def info_print(string):
15
20
def project_print (string ):
16
21
# Print project information with deep green color
17
22
print "\033 [1;36;40m%s\033 [0m" % string
23
+ __output_result (string )
18
24
19
25
20
26
def file_print (string ):
21
27
# Print file url with yellow color
22
28
print "\033 [1;33;40m%s\033 [0m" % string
29
+ __output_result (string )
23
30
24
31
25
32
def code_print (string ):
26
33
# Print code line with white color
27
34
print "\033 [1;37;40m%s\033 [0m" % string
35
+ __output_result (string )
28
36
29
37
38
+ def __output_result (string ):
39
+ """
40
+ Output search results to text file
41
+ :param results: search results
42
+ :return: None
43
+ """
44
+ with open (OUTPUT_FILE , 'a+' ) as file_obj :
45
+ file_obj .write (string + '\r \n ' )
46
+
30
47
if __name__ == "__main__" :
31
48
pass
You can’t perform that action at this time.
0 commit comments