executeRegQueryValue queries a registry subkey value
(ctx context.Context, client *csclient.Client, beaconID string, action Action)
| 534 | |
| 535 | // executeRegQueryValue queries a registry subkey value |
| 536 | func (e *Executor) executeRegQueryValue(ctx context.Context, client *csclient.Client, beaconID string, action Action) (string, error) { |
| 537 | arch, ok := action.Parameters["arch"].(string) |
| 538 | if !ok { |
| 539 | return "", fmt.Errorf("arch parameter required for reg_queryv") |
| 540 | } |
| 541 | path, ok := action.Parameters["path"].(string) |
| 542 | if !ok { |
| 543 | return "", fmt.Errorf("path parameter required for reg_queryv") |
| 544 | } |
| 545 | subkey, ok := action.Parameters["subkey"].(string) |
| 546 | if !ok { |
| 547 | return "", fmt.Errorf("subkey parameter required for reg_queryv") |
| 548 | } |
| 549 | |
| 550 | resp, err := client.RegQueryValue(ctx, beaconID, arch, path, subkey) |
| 551 | if err != nil { |
| 552 | return "", err |
| 553 | } |
| 554 | return e.waitForOutput(ctx, client, resp.TaskID) |
| 555 | } |
no test coverage detected