Skip to content

Commit c2cd50b

Browse files
committed
v0.5 创建项目更便捷
1 parent 4625176 commit c2cd50b

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README.MD

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,16 @@ cat domain.txt|biu-cli -pid 项目ID
4242

4343
- 查询备案并添加到已有项目中
4444
```shell
45-
biu-cli -icp xx公司|biu-cli -pid 项目ID
45+
biu-cli -icp xx公司 -pid 项目ID
4646
```
4747

48+
49+
- 查询备案并创建项目
50+
```shell
51+
biu-cli -icp xx公司 -pnew 项目名称
52+
```
53+
54+
4855
- 配合https://opendata.rapid7.com/sonar.https/使用
4956

5057
```shell

cmd/biu-cli.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var (
2626
ip string
2727
pageSize int
2828
client = resty.New()
29-
version = "v0.4"
29+
version = "v0.5"
3030
)
3131

3232
func biuPrint(header []string, data [][]string) {
@@ -63,9 +63,19 @@ func icpSearch() {
6363
reg, err := regexp.Compile(`<span class="ranking-ym" rel="nofollow">([a-z0-9-\.]+)`)
6464
if err == nil {
6565
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+
}
6877
}
78+
6979
}
7080
}
7181
}
@@ -113,6 +123,7 @@ func addProject() {
113123
msg := gjson.Get(string(resp.Body()), "msg").Value()
114124
fmt.Println(msg)
115125
fmt.Println(result.Get("project_id").Value())
126+
pid = result.Get("project_id").Str
116127
}
117128
}
118129

0 commit comments

Comments
 (0)