MCPcopy Create free account
hub / github.com/damit5/gitdorks_go / parseparam

Function parseparam

main.go:126–168  ·  view source on GitHub ↗

* 解析token和dork */

()

Source from the content-addressed store, hash-verified

124解析token和dork
125 */
126func parseparam(){
127 // 解析token
128 if Token != "" {
129 Tokens = []string {Token}
130 } else if TokenFile != "" {
131 tfres,err := ioutil.ReadFile(TokenFile)
132 if err != nil {
133 color.Red("file error: %v", err)
134 os.Exit(0)
135 } else {
136 tfresLine := strings.Split(string(tfres), "\n")
137 for {
138 if tfresLine[len(tfresLine)-1] == "" {
139 tfresLine = tfresLine[:len(tfresLine)-1]
140 } else {
141 break
142 }
143 }
144 Tokens = tfresLine
145 }
146 }
147 // 解析dork
148 if Keyword != "" {
149 Dorks = []string {Keyword}
150 } else if DorkFile != "" {
151 dkres,err := ioutil.ReadFile(DorkFile)
152 if err != nil {
153 color.Red("file error: %v", err)
154 os.Exit(0)
155 } else {
156 dkresLine := strings.Split(string(dkres), "\n")
157 for {
158 if dkresLine[len(dkresLine)-1] == "" {
159 dkresLine = dkresLine[:len(dkresLine)-1]
160 } else {
161 break
162 }
163 }
164 Dorks = dkresLine
165 }
166 }
167 color.Blue("[+] got %d tokens and %d dorks\n\n", len(Tokens), len(Dorks))
168}
169
170/*
171多个token轮询

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected