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.
Client is now conservative in memory use.
- Loading branch information
Showing
9 changed files
with
158 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"gopkg.in/alecthomas/kingpin.v2" | ||
"log" | ||
"net/http" | ||
_ "net/http/pprof" | ||
config "www.velocidex.com/golang/velociraptor/config" | ||
logging "www.velocidex.com/golang/velociraptor/logging" | ||
) | ||
|
||
var ( | ||
debug_flag = app.Flag("debug", "Enables debug and profile server.").Bool() | ||
) | ||
|
||
func doDebug() { | ||
config_obj, err := config.LoadClientConfig(*config_path) | ||
kingpin.FatalIfError(err, "Unable to load config file") | ||
|
||
logger := logging.NewLogger(config_obj) | ||
logger.Info("Starting debug server on port 6060") | ||
|
||
go func() { | ||
log.Println(http.ListenAndServe("0.0.0.0:6060", nil)) | ||
}() | ||
} | ||
|
||
func init() { | ||
// Add this first to ensure it always runs. | ||
command_handlers = append([]CommandHandler{ | ||
func(command string) bool { | ||
if *debug_flag { | ||
doDebug() | ||
} | ||
return false | ||
}, | ||
}, command_handlers...) | ||
} |
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