MCPcopy Create free account
hub / github.com/evilsocket/shellz / runCommand

Function runCommand

cmd/shellz/run.go:223–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221}
222
223func runCommand() {
224 log.Debug("onFilter = %s", onFilter)
225 if err, onShells = doShellSelection(onFilter, doForce); err != nil {
226 log.Fatal("%s", err)
227 } else if nShells = len(onShells); nShells == 0 {
228 log.Fatal("no enabled shell selected by the filter %s (use the -force argument to select disabled shells)", tui.Dim(onFilter))
229 }
230
231 if doTest {
232 log.Debug("testing %d shells ...", nShells)
233 } else {
234 log.Debug("running %s on %d shells ...", tui.Dim(command), nShells)
235 }
236
237 runQueue = async.NewQueue(numWorkers, cmdWorker)
238
239 stats.Shells = uint64(nShells)
240 stats.Started = time.Now()
241
242 for name := range onShells {
243 runQueue.Add(onShells[name])
244 }
245
246 runQueue.WaitDone()
247
248 stats.Done = time.Now()
249 if doStats {
250 viewStats()
251 }
252}

Callers 1

mainFunction · 0.85

Calls 3

doShellSelectionFunction · 0.85
viewStatsFunction · 0.85
DebugMethod · 0.80

Tested by

no test coverage detected