Skip to content

Commit

Permalink
doc: add docker usage and installation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ajutamangdev committed Sep 15, 2024
1 parent bc9c2b8 commit 555ffdc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ main
.DS_Store
dist/
./dist
node_modules/
node_modules/
S3Khoj
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
# S3Khoj

[S3Khoj](https://github.com/ajutamangdev/S3Khoj), is a robust tool designed to help detect sensitive files at AWS public S3 buckets. "Khoj", a Nepali word meaning search or explore, perfectly encapsulates the tool's functionality for searching sensitive files within them.
<p align="center">
<img src="https://img.shields.io/github/go-mod/go-version/ajutamangdev/s3khoj">
<a href="https://github.com/ajutamangdev/s3khoj/releases"><img src="https://img.shields.io/github/downloads/ajutamangdev/s3khoj/total">
<a href="https://github.com/ajutamangdev/s3khoj"><img src="https://img.shields.io/github/release/ajutamangdev/s3khoj">
<a href="https://github.com/ajutamangdev/s3khoj/issues"><img src="https://img.shields.io/github/issues-raw/ajutamangdev/s3khoj">
<a href="https://github.com/ajutamangdev/s3khoj/discussions"><img src="https://img.shields.io/github/discussions/ajutamangdev/s3khoj">

[S3Khoj](https://github.com/ajutamangdev/S3Khoj), is a robust tool designed for pentesters to extract juicy information from the public accessible S3 buckets. "Khoj", a Nepali word meaning search or explore, perfectly encapsulates the tool's functionality for searching sensitive files within them.

Blog about [S3Khoj](https://csaju.com/posts/hunting-secrets-at-public-s3-buckets-using-s3khoj/).

# Installation
## Installation

Manual
```
git clone https://github.com/ajutamangdev/S3Khoj
cd S3Khoj
make build
./S3Khoj -h
```
> Ensure you have installed go in your machine.
> Ensure you have installed go in your machine for the build process.
# Usage
Build S3khoj uusing Docker locally
```
docker build -t S3Khoj .
```

Pull S3Khoj docker image using DockerHub
```
docker pull ajutamangdev/s3khoj
```

You can also download the binary from https://github.com/ajutamangdev/S3Khoj/releases and installed on your machine.

## Usage

You can check with the help flag by executing the given command.
```
Expand All @@ -30,15 +50,23 @@ Flags:
-h, --help help for S3Khoj
-o, --output string Output format: text, json, csv, or html (default "text")
-w, --source string Custom Wordlist configuration file
```

## Example
```
S3Khoj -b name-of-the-bucket
```

If you are running from Docker, you have to mount the volumes.
```
docker run -v $(pwd):/app -w /app s3 -b test1011hify -o html
```

For Custom regex configuration
```
S3Khoj -b name-of-the-bucket -w custom-config.txt
```
```

### License

S3Khoj is distributed under [MIT License](https://github.com/ajutamangdev/S3Khoj/blob/main/LICENSE)
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func runMain() {

result.IsPublic = checkBucketPublic(*bucketName)

var svc *s3.Client // Declare svc here
var svc *s3.Client

if result.IsPublic {
for _, region := range regions {
Expand All @@ -163,7 +163,7 @@ func runMain() {
continue
}

svc = s3.NewFromConfig(cfg) // Assign svc here
svc = s3.NewFromConfig(cfg)

_, err = svc.HeadBucket(context.TODO(), &s3.HeadBucketInput{
Bucket: bucketName,
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ func printBanner() {
/_______ //______ /____|__ \___| /\____/\__| |
\/ \/ \/ \/ \______|
S3 inspector tool that help pentesters to extract juicy information from the public accessible S3 buckets.
S3Khoj is a robust tool designed for pentesters to extract juicy information from the public accessible S3 buckets
`)
}

var (
bucketName string
externalFileList string
outputFormat string
downloadFiles bool // Make sure this is defined as bool
downloadFiles bool
)

var rootCmd = &cobra.Command{
Expand Down

0 comments on commit 555ffdc

Please sign in to comment.