forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an uploader plugin and sync with the latest vfilter code.
- Loading branch information
Showing
10 changed files
with
87 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package vql | ||
|
||
import ( | ||
"www.velocidex.com/golang/vfilter" | ||
) | ||
|
||
// The upload plugin is a passthrough plugin which uploads the files | ||
// to the server. | ||
|
||
// Args: | ||
// - hits: A series of rows to upload. These are typically | ||
// subselects. The rows will be passed directly to the output of | ||
// the plugin. | ||
|
||
// Example: | ||
// SELECT * from upload(hits= { SELECT FullPath FROM glob(globs=['/tmp/*.txt']) }) | ||
|
||
func MakeUploaderPlugin() vfilter.GenericListPlugin { | ||
plugin := vfilter.GenericListPlugin{ | ||
PluginName: "upload", | ||
RowType: nil, | ||
} | ||
|
||
plugin.Function = func(args *vfilter.Dict) []vfilter.Row { | ||
var result []vfilter.Row | ||
// Extract the glob from the args. | ||
hits, ok := args.Get("hits") | ||
if ok { | ||
switch t := hits.(type) { | ||
case []vfilter.Any: | ||
for _, item := range t { | ||
plugin.RowType = item | ||
result = append(result, item) | ||
} | ||
default: | ||
return result | ||
} | ||
} | ||
return result | ||
} | ||
|
||
return plugin | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters