Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Sto committed Dec 10, 2019
1 parent 122fdb9 commit 2c21fa4
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 4 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Upload Release Asset

jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
- name: Set GOPATH
# temporary fix
# see https://github.com/actions/setup-go/issues/14
run: |
echo "##[set-env name=RELEASE_VERSION;]$(echo ${GITHUB_REF:10})"
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- name: Checkout code
uses: actions/checkout@v1
with:
path: ./src/github.com/${{ github.repository }}
- name: Build # This would actually build your project, using zip for an example artifact
run: |
GOOS=windows go build -ldflags "-s -w" -o "gosecretsdump_win_${RELEASE_VERSION}.exe"
GOOS=darwin go build -ldflags "-s -w" -o "gosecretsdump_mac_${RELEASE_VERSION}"
GOOS=linux go build -ldflags "-s -w" -o "gosecretsdump_linux_${RELEASE_VERSION}"
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Compress win
uses: svenstaro/upx-action@v1-release
with:
file: gosecretsdump_win_${{ env.RELEASE_VERSION }}.exe
args: -9
#- name: Compress mac
# uses: svenstaro/upx-action@v1-release
# with:
# file: gosecretsdump_mac_${{ env.RELEASE_VERSION }}
# args: -9
- name: Compress nix
uses: svenstaro/upx-action@v1-release
with:
file: gosecretsdump_linux_${{ env.RELEASE_VERSION }}
args: -9
- name: Upload win Asset
id: upload-release-asset-win
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gosecretsdump_win_${{ env.RELEASE_VERSION }}.exe
asset_name: gosecretsdump_win_${{ env.RELEASE_VERSION }}.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Upload mac Asset
id: upload-release-asset-mac
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gosecretsdump_mac_${{ env.RELEASE_VERSION }}
asset_name: gosecretsdump_mac_${{ env.RELEASE_VERSION }}
asset_content_type: application/octet-stream
- name: Upload nix Asset
id: upload-release-asset-nix
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gosecretsdump_linux_${{ env.RELEASE_VERSION }}
asset_name: gosecretsdump_linux_${{ env.RELEASE_VERSION }}
asset_content_type: application/x-elf
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
/impacket*
test.txt
/test/Big/*
/big/*
venv*
.DS_Store
*.cleartext
*.cleartext
*.kerb
*.7z
*.pprof
*.exe
*.dit
*SECURITY
*SYSTEM
8 changes: 6 additions & 2 deletions cmd/dumpSecrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ type Settings struct {
Stream bool
}

func GoSecretsDump(s Settings) {
dr := ditreader.New(s.SystemLoc, s.NTDSLoc)
func GoSecretsDump(s Settings) error {
dr, err := ditreader.New(s.SystemLoc, s.NTDSLoc)
if err != nil {
return err
}
//handle any output
dataChan := dr.GetOutChan()
if s.Outfile != "" {
Expand All @@ -32,6 +35,7 @@ func GoSecretsDump(s Settings) {
} else {
consoleWriter(dataChan, s)
}
return nil
}

func consoleWriter(val <-chan ditreader.DumpedHash, s Settings) {
Expand Down
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,35 @@ package main

import (
"flag"
"fmt"
"os"

"github.com/C-Sto/gosecretsdump/cmd"
)

const version = "0.0.1"

func main() {

//defer profile.Start(profile.ProfilePath("./")).Stop()
//defer profile.Start(profile.MemProfile, profile.ProfilePath("./")).Stop()
//defer profile.Start(profile.BlockProfile, profile.ProfilePath("./")).Stop()

fmt.Println("gosecretsdump v" + version + " (@C__Sto)")
s := cmd.Settings{}
var vers bool
flag.StringVar(&s.Outfile, "out", "", "Location to export output")
flag.StringVar(&s.NTDSLoc, "ntds", "", "Location of the NTDS file (required)")
flag.StringVar(&s.SystemLoc, "system", "", "Location of the SYSTEM file (required)")
flag.BoolVar(&s.Status, "status", false, "Include status in hash output")
flag.BoolVar(&s.EnabledOnly, "enabled", false, "Only output enabled accounts")
flag.BoolVar(&s.NoPrint, "noprint", false, "Don't print output to screen (probably use this with the -out flag)")
flag.BoolVar(&s.Stream, "stream", false, "Stream to files rather than writing in a block. Can be much slower.")
flag.BoolVar(&vers, "version", false, "Print version and exit")
flag.Parse()

if vers {
os.Exit(0)
}
if s.SystemLoc == "" || s.NTDSLoc == "" {
flag.Usage()
os.Exit(1)
Expand Down

0 comments on commit 2c21fa4

Please sign in to comment.