(Host, metadata, uri, customuri, customuriGET, customuriPOST, CDN, CDN_Value, Profile string, Forwarder bool)
| 247 | } |
| 248 | |
| 249 | func GenerateHTTPVaribles(Host, metadata, uri, customuri, customuriGET, customuriPOST, CDN, CDN_Value, Profile string, Forwarder bool) map[string]string { |
| 250 | Beacon_GETPOST := &Beacon_GETPOST{} |
| 251 | Beacon_GETPOST.Variables = make(map[string]string) |
| 252 | Beacon_GETPOST.Variables["Host"] = Host |
| 253 | if Profile == "" { |
| 254 | num_Profile, _ = strconv.Atoi(Utils.GenerateNumer(1, 5)) |
| 255 | } else { |
| 256 | num_Profile, _ = strconv.Atoi(Profile) |
| 257 | } |
| 258 | if metadata == "base64" { |
| 259 | Beacon_GETPOST.Variables["metadata_mode"] = metadata |
| 260 | } else if metadata == "base64url" { |
| 261 | Beacon_GETPOST.Variables["metadata_mode"] = metadata |
| 262 | } else if metadata == "netbios" { |
| 263 | Beacon_GETPOST.Variables["metadata_mode"] = metadata |
| 264 | } else if metadata == "netbiosu" { |
| 265 | Beacon_GETPOST.Variables["metadata_mode"] = metadata |
| 266 | } else if metadata == "" { |
| 267 | Beacon_GETPOST.Variables["metadata_mode"] = "netbios" |
| 268 | } else { |
| 269 | log.Fatal("Error: Please provide a valid metadata option") |
| 270 | } |
| 271 | if uri == "" { |
| 272 | Post = false |
| 273 | uri := customuri |
| 274 | if customuriGET != "" && customuriPOST != "" { |
| 275 | uri = customuriGET |
| 276 | fmt.Println("[*] GET URI base: " + uri) |
| 277 | } |
| 278 | |
| 279 | Beacon_GETPOST.Variables["HTTP_GET_URI"] = Utils.GenerateURIValues(1, num_Profile, Post, uri) |
| 280 | Post = true |
| 281 | if customuriGET != "" && customuriPOST != "" { |
| 282 | uri = customuriPOST |
| 283 | fmt.Println("[*] POST URI base: " + uri) |
| 284 | } |
| 285 | |
| 286 | Beacon_GETPOST.Variables["HTTP_POST_URI"] = Utils.GenerateURIValues(1, num_Profile, Post, uri) |
| 287 | |
| 288 | } |
| 289 | if uri != "" { |
| 290 | num_uri, _ := strconv.Atoi(uri) |
| 291 | Post = false |
| 292 | uri := customuri |
| 293 | if customuriGET != "" && customuriPOST != "" { |
| 294 | uri = customuriGET |
| 295 | fmt.Println("[*] GET URI base: " + uri) |
| 296 | } |
| 297 | Beacon_GETPOST.Variables["HTTP_GET_URI"] = Utils.GenerateURIValues(num_uri, num_Profile, Post, uri) |
| 298 | Post = true |
| 299 | if customuriGET != "" && customuriPOST != "" { |
| 300 | uri = customuriPOST |
| 301 | fmt.Println("[*] POST URI base: " + uri) |
| 302 | } |
| 303 | Beacon_GETPOST.Variables["HTTP_POST_URI"] = Utils.GenerateURIValues(num_uri, num_Profile, Post, uri) |
| 304 | } |
| 305 | if CDN != "" { |
| 306 | Beacon_GETPOST.Variables["CDN"] = "header \"Cookie\" \"" + CDN + "=" + CDN_Value + "\";" |
no test coverage detected