Skip to content

Commit

Permalink
Fixes and Features Update!
Browse files Browse the repository at this point in the history
- Added the quickstart guide
- Fixed a Cirrus bug
- Fixed a bug in Flurry
- Added some ease of life fixes in all DLLs
- Exposed the user_add and elevate generators
- Fixed the cirrus build script
- Added initial password_proxy script
  • Loading branch information
iDigitalFlame committed Aug 27, 2022
1 parent 5ef40cf commit cc20f0e
Show file tree
Hide file tree
Showing 34 changed files with 1,660 additions and 238 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion bolt/bolt.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func Start(ignore, load, critical bool, l man.Linker, guard, pipe string, c cfg.
if s.Close(); critical && !z {
device.SetCritical(false)
}
cleanup()
// NOTE(dij): Give some cleanup time to handle any loose ends. (1.5s)
time.Sleep(1500000000)
limits.Reset()
limits.StopNotify(w)
close(w)
Expand Down
21 changes: 0 additions & 21 deletions bolt/bolt_windows.go

This file was deleted.

18 changes: 16 additions & 2 deletions cirrus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,27 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

output="bin/cirrus"
output="cirrus"
buildroot="cmd/cirrus.go"

if [ $# -ge 1 ]; then
output="$1"
if [ -d "$(pwd)/cirrus" ]; then
buildroot="cirrus/cmd/cirrus.go"
fi
else
if [ -d "$(pwd)/cirrus" ]; then
output="$(pwd)/bin/cirrus"
buildroot="cirrus/cmd/cirrus.go"
else
if [ -f "$(pwd)/server.go" ]; then
output="$(pwd)/../bin/cirrus"
fi
fi
fi

printf "Building...\n"
go build -trimpath -buildvcs=false -ldflags "-s -w" -o "$output" cmd/cirrus.go
go build -trimpath -buildvcs=false -ldflags "-s -w" -o "$output" $buildroot

which upx &> /dev/null
if [ $? -eq 0 ] && [ -f "$output" ]; then
Expand Down
3 changes: 2 additions & 1 deletion cirrus/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (j *jobManager) prune(x context.Context) {
delete(j.e, k)
}
}
if len(j.sessions.e) > 0 {
if j.sessions.Lock(); len(j.sessions.e) > 0 {
for i := range j.sessions.e {
if j.sessions.e[i].Lock(); len(j.sessions.e[i].j) == 0 {
j.sessions.e[i].Unlock()
Expand Down Expand Up @@ -113,6 +113,7 @@ func (j *jobManager) prune(x context.Context) {
j.sessions.e[i].Unlock()
}
}
j.sessions.Unlock()
j.Unlock()
case <-x.Done():
t.Stop()
Expand Down
22 changes: 15 additions & 7 deletions cirrus/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ Optional Arguments:
HTTP header for connections. If this is empty, and
the "-no-auth" argument is not specified, a random
password will be generated for you and printed to
stdout during startup.
stdout during startup. If a password was specified
in the "data_file" argument, this can be omitted to
use that instead.
-no-auth Argument that can be used to force Cirrus to NOT
validate connections with a password. If a password
is specified with "-p", this argument is ignored.
However, this value will take precedence over any
passwords saved in the "data_file".
-f <data_file> Path to a file to be used as the backing store for
Cirrus. This can be used to save/load the contents
and state during startup/shutdown for Scripts,
Expand Down Expand Up @@ -117,15 +121,10 @@ func Cmdline() {
log = logx.Console(logx.Normal(e, logx.Info))
}

if len(p) == 0 && !n {
p = text.All.String(16)
os.Stdout.WriteString("Generated authentication password: " + p + "\n")
}

var (
x, q = context.WithCancel(context.Background())
i = c2.NewServerContext(x, log)
a = NewContext(x, i, p)
a = NewContext(x, i, "")
)

if len(d) == 0 {
Expand All @@ -143,6 +142,15 @@ func Cmdline() {
os.Exit(1)
}

switch {
case len(a.Auth) == 0 && n:
case len(a.Auth) == 0 && !n && len(p) > 0:
a.Auth = p
case len(a.Auth) == 0 && !n && len(p) == 0:
a.Auth = text.All.String(16)
os.Stdout.WriteString("Generated authentication password: " + a.Auth + "\n")
}

if err = a.TrackStats(c, t); err != nil {
a.Close()
i.Close()
Expand Down
2 changes: 1 addition & 1 deletion cirrus/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (t taskCommand) Packet() (*com.Packet, error) {
if p.Stdin, err = readEmptyB64(t.Stdin); err != nil {
return nil, err
}
if len(t.Command) == 1 && len(t.Stdin) == 0 {
if len(t.Command) == 0 && len(t.Stdin) == 0 {
return nil, errInvalidCommand
}
switch t.Command[0] {
Expand Down
Loading

0 comments on commit cc20f0e

Please sign in to comment.