MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / printSessionInfo

Function printSessionInfo

cmd/inject-cli/main.go:409–426  ·  view source on GitHub ↗
(sess *SessionDetail)

Source from the content-addressed store, hash-verified

407}
408
409func printSessionInfo(sess *SessionDetail) {
410 name, ver := formatAgent(sess.UserAgent)
411 agent := name
412 if ver != "" {
413 agent += " " + ver
414 }
415
416 fmt.Println()
417 printSep(56)
418 fmt.Printf(" \033[36mSession\033[0m %s\n", sess.ID)
419 fmt.Printf(" \033[36mAgent\033[0m %s\n", agent)
420 fmt.Printf(" \033[36mFormat\033[0m %s\n", sess.Format)
421 fmt.Printf(" \033[36mKey\033[0m %s\n", sess.APIKeyHash)
422 fmt.Printf(" \033[36mTools\033[0m %d\n", len(sess.Tools))
423 fmt.Printf(" \033[36mCreated\033[0m %s\n", sess.CreatedAt.Format("2006-01-02 15:04:05"))
424 fmt.Printf(" \033[36mActive\033[0m %s (%s)\n", sess.LastActivity.Format("15:04:05"), timeAgo(sess.LastActivity))
425 printSep(56)
426}
427
428func cmdUse(c *apiClient, sessionID string) {
429 sess, err := c.getSession(sessionID)

Callers 2

cmdUseFunction · 0.85
showSessionInfoFunction · 0.85

Calls 4

formatAgentFunction · 0.85
printSepFunction · 0.85
timeAgoFunction · 0.85
FormatMethod · 0.80

Tested by

no test coverage detected