Skip to content

Commit 3ce912f

Browse files
committed
fix things and add new features to API
1 parent 46c709e commit 3ce912f

15 files changed

Lines changed: 474 additions & 54 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v4
1515
with:
16-
submodules: recursive
16+
submodules: true
17+
fetch-depth: 0
18+
19+
- name: Update submodules (with error handling)
20+
run: |
21+
git submodule sync --recursive || true
22+
git submodule update --init --recursive --force || echo "Warning: Some submodules failed to update"
1723
1824
- name: Set up Go
1925
uses: actions/setup-go@v5

.github/workflows/release.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323
with:
24-
submodules: recursive
24+
submodules: true
25+
fetch-depth: 0
26+
27+
- name: Update submodules (with error handling)
28+
run: |
29+
git submodule sync --recursive || true
30+
git submodule update --init --recursive --force || echo "Warning: Some submodules failed to update"
2531
2632
- name: Set up Go
2733
uses: actions/setup-go@v5
@@ -94,7 +100,13 @@ jobs:
94100
- name: Checkout
95101
uses: actions/checkout@v4
96102
with:
97-
submodules: recursive
103+
submodules: true
104+
fetch-depth: 0
105+
106+
- name: Update submodules (with error handling)
107+
run: |
108+
git submodule sync --recursive || true
109+
git submodule update --init --recursive --force || echo "Warning: Some submodules failed to update"
98110
99111
- name: Set up Docker Buildx
100112
uses: docker/setup-buildx-action@v3

cmd/autoar/main.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Commands:
102102
subdomains get -d <domain>
103103
livehosts get -d <domain>
104104
cnames get -d <domain>
105-
urls collect -d <domain>
105+
urls collect -d <domain> [--subdomain]
106106
js scan -d <domain> [-s <subdomain>]
107107
reflection scan -d <domain>
108108
nuclei run -d <domain>
@@ -2772,8 +2772,9 @@ func handleLivehostsGo(args []string) error {
27722772
func handleURLsGo(args []string) error {
27732773
var domain string
27742774
threads := 100
2775+
skipSubdomainEnum := false
27752776

2776-
// Parse arguments: collect -d <domain> [-t <threads>]
2777+
// Parse arguments: collect -d <domain> [-t <threads>] [--subdomain]
27772778
for i := 0; i < len(args); i++ {
27782779
switch args[i] {
27792780
case "-d", "--domain":
@@ -2788,20 +2789,27 @@ func handleURLsGo(args []string) error {
27882789
}
27892790
i++
27902791
}
2792+
case "--subdomain":
2793+
skipSubdomainEnum = true
27912794
}
27922795
}
27932796

27942797
if domain == "" {
2795-
fmt.Println("Usage: urls collect -d <domain> [-t <threads>]")
2798+
fmt.Println("Usage: urls collect -d <domain> [-t <threads>] [--subdomain]")
2799+
fmt.Println(" --subdomain: Treat input as a single subdomain (skip subdomain enumeration)")
27962800
return fmt.Errorf("domain is required")
27972801
}
27982802

2799-
res, err := urls.CollectURLs(domain, threads)
2803+
res, err := urls.CollectURLs(domain, threads, skipSubdomainEnum)
28002804
if err != nil {
28012805
return err
28022806
}
28032807

2804-
fmt.Printf("[OK] Found %d total URLs; %d JavaScript URLs for %s\n", res.TotalURLs, res.JSURLs, res.Domain)
2808+
mode := "domain"
2809+
if skipSubdomainEnum {
2810+
mode = "subdomain"
2811+
}
2812+
fmt.Printf("[OK] Found %d total URLs; %d JavaScript URLs for %s (mode: %s)\n", res.TotalURLs, res.JSURLs, res.Domain, mode)
28052813
fmt.Printf("[INFO] All URLs saved to %s\n", res.AllFile)
28062814
if res.JSURLs > 0 {
28072815
fmt.Printf("[INFO] JS URLs saved to %s\n", res.JSFile)
@@ -3178,7 +3186,7 @@ func main() {
31783186
if len(args) > 0 && args[0] == "collect" {
31793187
err = handleURLsGo(args[1:])
31803188
} else {
3181-
err = fmt.Errorf("unsupported urls action; use: autoar urls collect -d <domain> [-t <threads>]")
3189+
err = fmt.Errorf("unsupported urls action; use: autoar urls collect -d <domain> [-t <threads>] [--subdomain]")
31823190
}
31833191

31843192
case "dns":

env.example

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ DISCORD_BOT_TOKEN=your_discord_bot_token_here
2323
DISCORD_WEBHOOK=your_discord_webhook_url_here
2424

2525
# Restrict bot to a specific Discord server/guild (optional)
26+
# Option 1: Use Guild ID (GUID) - RECOMMENDED (more reliable)
27+
# Get your server ID: Right-click server name -> Copy Server ID (enable Developer Mode in Discord)
28+
# Example: DISCORD_ALLOWED_GUILD_ID=123456789012345678
29+
DISCORD_ALLOWED_GUILD_ID=
30+
31+
# Option 2: Use Guild Name (legacy, deprecated - use GUID instead)
2632
# Leave empty to allow bot in all servers, or set to server name (e.g., "Zhunterz")
2733
# The bot will reject commands from other servers
28-
DISCORD_ALLOWED_GUILD=Zhunterz
34+
DISCORD_ALLOWED_GUILD=
2935

3036
# ============================================================================
3137
# CORE APPLICATION CONFIGURATION

internal/modules/dalfox/dalfox.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func RunDalfox(domain string, threads int) (*Result, error) {
4545
// Step 1: Ensure URLs exist (run urlfinder if needed)
4646
if info, err := os.Stat(urlsFile); err != nil || info.Size() == 0 {
4747
log.Printf("[INFO] No URLs found for %s, running urlfinder to collect URLs...", domain)
48-
urlRes, err := urls.CollectURLs(domain, threads)
48+
urlRes, err := urls.CollectURLs(domain, threads, false)
4949
if err != nil {
5050
return nil, fmt.Errorf("failed to collect URLs: %w", err)
5151
}

internal/modules/domain/domain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func RunDomain(domain string) (*Result, error) {
5353
return err
5454
}},
5555
{"urls", func() error {
56-
_, err := urls.CollectURLs(domain, 100)
56+
_, err := urls.CollectURLs(domain, 100, false)
5757
return err
5858
}},
5959
{"js_scan", func() error {

internal/modules/fastlook/fastlook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func RunFastlook(domain string) (*Result, error) {
4848

4949
// Step 3: URL/JS collection
5050
log.Printf("[INFO] [3/3] Collecting URLs and JS URLs for %s", domain)
51-
urlRes, err := urls.CollectURLs(domain, 100)
51+
urlRes, err := urls.CollectURLs(domain, 100, false)
5252
if err != nil {
5353
log.Printf("[WARN] URL collection failed for %s: %v", domain, err)
5454
}

0 commit comments

Comments
 (0)