Skip to content

Commit 8d540df

Browse files
committed
feat: housekeeping configs, documentation generation, improved text
functions, and naming update
1 parent c311129 commit 8d540df

23 files changed

+523
-178
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[*]
2+
insert_final_newline = true
3+
4+
# Override for Makefile
5+
[{Makefile,makefile,GNUmakefile}]
6+
indent_style = tab
7+
indent_size = 4
8+
9+
[Makefile.*]
10+
indent_style = tab
11+
indent_size = 4
12+
13+
[*.md]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[*.sh]
18+
indent_style = tab
19+
indent_size = 2
20+
21+
[*.{tf,tfvars,tpl}]
22+
indent_style = space
23+
indent_size = 2

.gitignore

Lines changed: 35 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,46 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
78
*.so
9+
*.dylib
810

9-
# Distribution / packaging
10-
.Python
11-
.DS_Store
12-
build/
13-
develop-eggs/
14-
dist/
15-
downloads/
16-
eggs/
17-
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
23-
wheels/
24-
share/python-wheels/
25-
*.egg-info/
26-
.installed.cfg
27-
*.egg
28-
MANIFEST
29-
30-
# PyInstaller
31-
# Usually these files are written by a python script from a template
32-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33-
*.manifest
34-
*.spec
35-
36-
# Installer logs
37-
pip-log.txt
38-
pip-delete-this-directory.txt
39-
40-
# Unit test / coverage reports
41-
htmlcov/
42-
.tox/
43-
.nox/
44-
.coverage
45-
.coverage.*
46-
.cache
47-
nosetests.xml
48-
coverage.xml
49-
*.cover
50-
*.py,cover
51-
.hypothesis/
52-
.pytest_cache/
53-
cover/
54-
55-
# Translations
56-
*.mo
57-
*.pot
58-
59-
# Django stuff:
60-
*.log
61-
local_settings.py
62-
db.sqlite3
63-
db.sqlite3-journal
64-
65-
# Flask stuff:
66-
instance/
67-
.webassets-cache
68-
69-
# Sphinx documentation
70-
docs/_build/
71-
72-
# PyBuilder
73-
.pybuilder/
74-
target/
11+
# Test binary, built with `go test -c`
12+
*.test
7513

76-
# Jupyter Notebook
77-
.ipynb_checkpoints
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
7816

79-
# IPython
80-
profile_default/
81-
ipython_config.py
17+
# Dependency directories (remove the comment below to include it)
18+
# vendor/
8219

83-
# pyenv
84-
# For a library or package, you might want to ignore these files since the code is
85-
# intended to run in multiple environments; otherwise, check them in:
86-
# .python-version
20+
# Go workspace file
21+
go.work
22+
.vscode/
8723

88-
# pipenv
89-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
90-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
91-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
92-
# install all needed dependencies.
93-
#Pipfile.lock
24+
# Module directory
25+
.terraform
26+
**/.idea
27+
**/*.iml
9428

95-
# poetry
96-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
97-
# This is especially recommended for binary packages to ensure reproducibility, and is more
98-
# commonly ignored for libraries.
99-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
100-
#poetry.lock
101-
102-
# pdm
103-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
104-
#pdm.lock
105-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
106-
# in version control.
107-
# https://pdm.fming.dev/#use-with-ide
108-
.pdm.toml
109-
110-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
111-
__pypackages__/
112-
113-
# Celery stuff
114-
celerybeat-schedule
115-
celerybeat.pid
116-
117-
# SageMath parsed files
118-
*.sage.py
119-
120-
# Environments
121-
.env
122-
.venv
123-
env/
124-
venv/
125-
ENV/
126-
env.bak/
127-
venv.bak/
128-
129-
# Spyder project settings
130-
.spyderproject
131-
.spyproject
132-
133-
# Rope project settings
134-
.ropeproject
135-
136-
# mkdocs documentation
137-
/site
138-
139-
# mypy
140-
.mypy_cache/
141-
.dmypy.json
142-
dmypy.json
29+
**/build
30+
**/dist
31+
**/.helmfile/
32+
.DS_Store
33+
/variant
34+
*.tar
35+
*.gz
36+
/bin
14337

144-
# Pyre type checker
145-
.pyre/
38+
# Nix
39+
.envrc
40+
.direnv/
14641

147-
# pytype static type analyzer
148-
.pytype/
42+
# ScrapNGo specific
43+
ScrapNGo.txt
14944

150-
# Cython debug symbols
151-
cython_debug/
45+
dist/
15246

153-
# PyCharm
154-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
155-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
156-
# and can be added to the global gitignore or merged into this file. For a more nuclear
157-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
158-
#.idea/

Brewfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
brew "go"
2+
brew "gofumpt"
3+
brew "exiftool"

FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: rosesecurity

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
BINARY_NAME=scrapngo
2+
VERSION=local
3+
GO=go
4+
5+
default: help
6+
7+
help: ## List Makefile targets
8+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
9+
10+
all: build
11+
12+
fmt: ## Format Go files
13+
gofumpt -w .
14+
15+
build: ## Build ScrapNGo
16+
env $(if $(GOOS),GOOS=$(GOOS)) $(if $(GOARCH),GOARCH=$(GOARCH)) $(GO) build -o build/$(BINARY_NAME) -ldflags "-X 'github.com/RoseSecurity/ScrapNGo/cmd.Version=${VERSION}'" main.go
17+
18+
deps: ## Download dependencies
19+
go mod download
20+
21+
get: ## Install dependencies
22+
go get
23+
24+
clean: ## Clean up build artifacts
25+
$(GO) clean
26+
rm ./build/$(BINARY_NAME)
27+
28+
testacc: ## Run acceptance tests
29+
go test ./...
30+
31+
run: build ## Run ScrapNGo
32+
./build/$(BINARY_NAME)
33+
34+
docs: build ## Generate documentation
35+
./build/$(BINARY_NAME) docs
36+
37+
version: build ## View binary version
38+
chmod +x ./build/$(BINARY_NAME)
39+
./build/$(BINARY_NAME) version
40+
41+
.PHONY: all build install clean run fmt help

SECURITY.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you believe you have found a security vulnerability in any repository owned by RoseSecurity, please let me know straight away. I will investigate all legitimate reports and do my best to quickly fix the problem.
6+
7+
### What to Include in Your Report
8+
9+
To help me better understand the nature and scope of the issue, please include as much of the following information as possible in your report:
10+
11+
- Description of the vulnerability and its potential impact.
12+
- Step-by-step instructions to reproduce the issue.
13+
- Affected versions and configurations.
14+
- Any possible mitigations or workarounds that you have identified.
15+
16+
### What to Expect
17+
18+
> [!NOTE]
19+
> **Bug Bounties**
20+
>
21+
> RoseSecurity **does not** provide bug bounties for vulnerability disclosures.
22+
>
23+
> As an open-source contributor, I release projects for free under a permissive license, encouraging community contributions.
24+
>
25+
26+
After you submit a report, I will:
27+
- Respond to your report within 48 hours to acknowledge receipt.
28+
- Provide an estimated time frame for addressing the vulnerability.
29+
- Notify you when the issue is resolved.

cmd/docs.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package cmd
2+
3+
import (
4+
"github.com/spf13/cobra"
5+
"github.com/spf13/cobra/doc"
6+
)
7+
8+
// Generate documentation for ScrapNGo commands and output to docs directory
9+
var docsCmd = &cobra.Command{
10+
Use: "docs",
11+
Short: "Generate documentation for the CLI",
12+
SilenceUsage: true,
13+
Hidden: true,
14+
RunE: func(cmd *cobra.Command, args []string) error {
15+
err := doc.GenMarkdownTree(cmd.Root(), "./docs")
16+
if err != nil {
17+
return err
18+
}
19+
20+
return nil
21+
},
22+
}

cmd/root.go

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"log"
66

7-
tui "github.com/RoseSecurity/ScrapPY/internal/tui/utils"
8-
"github.com/RoseSecurity/ScrapPY/pkg/utils"
7+
tui "github.com/RoseSecurity/ScrapNGo/internal/tui/utils"
8+
"github.com/RoseSecurity/ScrapNGo/pkg/utils"
99
"github.com/spf13/cobra"
1010
)
1111

@@ -18,11 +18,11 @@ var (
1818
)
1919

2020
var rootCmd = &cobra.Command{
21-
Use: "scrapPY",
22-
Short: "ScrapPY enumerates documents, manuals, and sensitive PDFs for key phrases and words that can be utilized in dictionary and brute force attacks.",
23-
Long: `ScrapPY enumerates documents, manuals, and sensitive PDFs for key phrases and words
21+
Use: "scrapNGo",
22+
Short: "ScrapNGo enumerates documents, manuals, and sensitive PDFs for key phrases and words that can be utilized in dictionary and brute force attacks.",
23+
Long: `ScrapNGo enumerates documents, manuals, and sensitive PDFs for key phrases and words
2424
that can be utilized in dictionary and brute force attacks. These keywords are outputted
25-
to a text file (ScrapPY.txt in the directory which the tool was run from) that can be read
25+
to a text file (ScrapNGo.txt in the directory which the tool was run from) that can be read
2626
by tools such as Hydra, Dirb, and other offensive security tools for initial access and
2727
lateral movement.`,
2828
Run: func(cmd *cobra.Command, args []string) {
@@ -32,8 +32,7 @@ lateral movement.`,
3232

3333
// Print help if no file is provided
3434
if file == "" {
35-
tui.PrintStyledText("SCRAPPY")
36-
fmt.Println(red + "Enter PDF file to scrape or use -h for help menu\n" + norm)
35+
cmd.Help()
3736
return
3837
}
3938

@@ -76,9 +75,18 @@ lateral movement.`,
7675
}
7776

7877
func init() {
78+
// Custom help menu to display banner
79+
rootCmd.SetHelpFunc(func(cmd *cobra.Command, args []string) {
80+
fmt.Println()
81+
tui.PrintStyledText("SCRAPPY")
82+
fmt.Println(cmd.UsageString())
83+
})
84+
// Docs and Version commands
85+
rootCmd.AddCommand(docsCmd)
86+
rootCmd.AddCommand(versionCmd)
7987
rootCmd.Flags().StringP("file", "f", "", "PDF input file")
8088
rootCmd.Flags().StringP("mode", "m", "full", "Modes of operation: full, word-frequency, metadata, entropy")
81-
rootCmd.Flags().StringP("output-file", "o", "ScrapPY.txt", "Output file name")
89+
rootCmd.Flags().StringP("output-file", "o", "ScrapNGo.txt", "Output file name")
8290
}
8391

8492
func Execute() {

0 commit comments

Comments
 (0)