File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,16 @@ cat domain.txt|biu-cli -pid 项目ID
42
42
43
43
- 查询备案并添加到已有项目中
44
44
``` shell
45
- biu-cli -icp xx公司| biu-cli -pid 项目ID
45
+ biu-cli -icp xx公司 -pid 项目ID
46
46
```
47
47
48
+
49
+ - 查询备案并创建项目
50
+ ``` shell
51
+ biu-cli -icp xx公司 -pnew 项目名称
52
+ ```
53
+
54
+
48
55
- 配合https://opendata.rapid7.com/sonar.https/使用
49
56
50
57
``` shell
Original file line number Diff line number Diff line change 26
26
ip string
27
27
pageSize int
28
28
client = resty .New ()
29
- version = "v0.4 "
29
+ version = "v0.5 "
30
30
)
31
31
32
32
func biuPrint (header []string , data [][]string ) {
@@ -63,9 +63,19 @@ func icpSearch() {
63
63
reg , err := regexp .Compile (`<span class="ranking-ym" rel="nofollow">([a-z0-9-\.]+)` )
64
64
if err == nil {
65
65
match := reg .FindAllString (resp .String (), - 1 )
66
- for _ , domain := range match {
67
- fmt .Println (strings .Split (domain , ">" )[1 ])
66
+ if len (match ) > 0 {
67
+ if pnew != "" {
68
+ addProject ()
69
+ }
70
+ for _ , domain := range match {
71
+ if pid != "" {
72
+ addTargetToProject (strings .Split (domain , ">" )[1 ])
73
+ } else {
74
+ fmt .Println (strings .Split (domain , ">" )[1 ])
75
+ }
76
+ }
68
77
}
78
+
69
79
}
70
80
}
71
81
}
@@ -113,6 +123,7 @@ func addProject() {
113
123
msg := gjson .Get (string (resp .Body ()), "msg" ).Value ()
114
124
fmt .Println (msg )
115
125
fmt .Println (result .Get ("project_id" ).Value ())
126
+ pid = result .Get ("project_id" ).Str
116
127
}
117
128
}
118
129
You can’t perform that action at this time.
0 commit comments