Skip to content

Commit 717d460

Browse files
Merge pull request #15 from cyclone-github/dev
v1.0.0
2 parents 10b4085 + 28de35e commit 717d460

5 files changed

Lines changed: 469 additions & 219 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
### v1.0.0
2+
```
3+
added flag "-text-match" to filter page text matches
4+
memory and performance optimizations for -file and -url modes
5+
-file mode streams wordlists from disk instead of loading entire files into RAM
6+
reduced RAM usage for large -sort wordlists
7+
default -timeout increased from 1 to 10 seconds
8+
progress bars, stats, and errors now write to stderr
9+
sanitize url fragments for dedup and extension checks
10+
updated default User-Agent
11+
```
112
### v0.9.1
213
```
314
added flag "-agent" to allow user to specify custom user-agent; https://github.com/cyclone-github/spider/issues/8

README.md

Lines changed: 77 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,78 +9,122 @@
99
Spider is a web crawler and wordlist/ngram generator written in Go that crawls specified URLs or local files to produce frequency-sorted wordlists and ngrams. Users can customize crawl depth, output files, frequency sort, and ngram options, making it ideal for web scraping to create targeted wordlists for tools like hashcat or John the Ripper. Since Spider is written in Go, it requires no additional libraries to download or install.
1010
*Spider just works*.
1111

12+
### Install latest release:
13+
```
14+
go install github.com/cyclone-github/spider@latest
15+
```
16+
### Install from latest source code (bleeding edge):
17+
```
18+
go install github.com/cyclone-github/spider@main
19+
```
20+
21+
### Modes
22+
- **URL mode** (`-url`) — crawl a website and create wordlist/ngrams (frequency sorted optional)
23+
- **File mode** (`-file`) — process a local text file to create wordlist/ngrams (frequency sorted optional)
24+
1225
# Spider: URL Mode
1326
```
14-
spider -url 'https://forum.hashpwn.net' -crawl 2 -delay 20 -sort -ngram 1-3 -timeout 1 -url-match wordlist -o forum.hashpwn.net_spider.txt -agent 'foobar agent'
27+
spider -url 'https://github.com/hashpwn' -crawl 2 -delay 20 -sort -ngram 1-3 -timeout 10 -url-match 'hashpwn' -text-match 'hashpwn' -o hashpwn_spider.txt -agent 'foobar agent'
1528
```
1629
```
17-
----------------------
18-
| Cyclone's URL Spider |
19-
----------------------
30+
------------------
31+
| Cyclone's Spider |
32+
------------------
2033
21-
Crawling URL: https://forum.hashpwn.net
22-
Base domain: forum.hashpwn.net
34+
Crawling URL: https://github.com/hashpwn
35+
Base domain: github.com
2336
Crawl depth: 2
2437
ngram len: 1-3
25-
Crawl delay: 20ms (increase this to avoid rate limiting)
26-
Timeout: 1 sec
27-
URLs crawled: 2
28-
Processing... [====================] 100.00%
29-
Unique words: 475
30-
Unique ngrams: 1977
31-
Sorting n-grams by frequency...
38+
Crawl delay: 20ms (increase to avoid rate limiting)
39+
Timeout: 10 sec
40+
URL match: hashpwn
41+
Text match: hashpwn
42+
Scan/match: 22/21
43+
Unique words: 847
44+
Unique ngrams: 3816
45+
Sorting wordlist by frequency...
3246
Writing... [====================] 100.00%
33-
Output file: forum.hashpwn.net_spider.txt
34-
RAM used: 0.02 GB
35-
Runtime: 2.283s
47+
Output file: hashpwn_spider.txt
48+
RAM used: 0.003 GB
49+
Runtime: 11.279s
50+
```
51+
52+
When `-text-match` is used, all pages are still crawled for URL discovery but only pages with matching text are added to the wordlist. Crawl progress shows scanned vs matched:
53+
```
54+
spider -url 'https://en.wikipedia.org/wiki/PBKDF2' -crawl 2 -sort -text-match 'pbkdf2' -delay 10 -o pbkdf2_spider.txt
55+
```
3656
```
57+
------------------
58+
| Cyclone's Spider |
59+
------------------
60+
61+
Crawling URL: https://en.wikipedia.org/wiki/PBKDF2
62+
Base domain: en.wikipedia.org
63+
Crawl depth: 2
64+
ngram len: 1
65+
Crawl delay: 10ms (increase to avoid rate limiting)
66+
Timeout: 10 sec
67+
Text match: pbkdf2
68+
Scan/match: 213/114
69+
Unique words: 34539
70+
Unique ngrams: 34539
71+
Sorting wordlist by frequency...
72+
Writing... [====================] 100.00%
73+
Output file: pbkdf2_spider.txt
74+
RAM used: 0.012 GB
75+
Runtime: 13.715s
76+
```
77+
3778
# Spider: File Mode
3879
```
3980
spider -file kjv_bible.txt -sort -ngram 1-3
4081
```
4182
```
42-
----------------------
43-
| Cyclone's URL Spider |
44-
----------------------
83+
------------------
84+
| Cyclone's Spider |
85+
------------------
4586
4687
Reading file: kjv_bible.txt
4788
ngram len: 1-3
4889
Processing... [====================] 100.00%
4990
Unique words: 35412
5091
Unique ngrams: 877394
51-
Sorting n-grams by frequency...
92+
Sorting wordlist by frequency...
5293
Writing... [====================] 100.00%
5394
Output file: kjv_bible_spider.txt
54-
RAM used: 0.13 GB
55-
Runtime: 1.359s
95+
RAM used: 0.073 GB
96+
Runtime: 1.137s
5697
```
5798

5899
Wordlist & ngram creation tool to crawl a given url or process a local file to create wordlists and/or ngrams (depending on flags given).
59100
### Usage Instructions:
60-
- To create a simple wordlist from a specified url (will save deduplicated wordlist to url_spider.txt):
101+
- To create a simple wordlist from a specified url (will save deduplicated wordlist to url_spider.txt if `-o` is not set):
61102
- `spider -url 'https://github.com/cyclone-github'`
62-
- To set url crawl url depth of 2 and create ngrams len 1-5, use flag "-crawl 2" and "-ngram 1-5"
103+
- To set url crawl depth of 2 and create ngrams len 1-5, use flag "-crawl 2" and "-ngram 1-5"
63104
- `spider -url 'https://github.com/cyclone-github' -crawl 2 -ngram 1-5`
64105
- To set a custom output file, use flag "-o filename"
65106
- `spider -url 'https://github.com/cyclone-github' -o wordlist.txt`
66107
- To set a delay to keep from being rate-limited, use flag "-delay nth" where nth is time in milliseconds
67108
- `spider -url 'https://github.com/cyclone-github' -delay 100`
68-
- To set a URL timeout, use flag "-timeout nth" where nth is time in seconds
69-
- `spider -url 'https://github.com/cyclone-github' -timeout 2`
109+
- To set a URL timeout, use flag "-timeout nth" where nth is time in seconds (default 10)
110+
- `spider -url 'https://github.com/cyclone-github' -timeout 10`
70111
- To create ngrams len 1-3 and sort output by frequency, use "-ngram 1-3" "-sort"
71112
- `spider -url 'https://github.com/cyclone-github' -ngram 1-3 -sort`
72-
- To filter crawled URLs by keyword "foobar"
73-
- `spider -url 'https://github.com/cyclone-github' -url-match foobar`
113+
- To filter crawled URLs by keyword "spider" (only follow/crawl matching URLs)
114+
- `spider -url 'https://github.com/cyclone-github' -url-match 'spider'`
115+
- Only match pages containing text keyword (all URLs are still crawled, but only pages containing keyword are added to wordlist)
116+
- `spider -url 'https://en.wikipedia.org/wiki/PBKDF2' -text-match 'pbkdf2'`
74117
- To specify a custom user-agent
75-
- `spider -url 'https://github.com/cyclone-github' -agent 'foobar'`
118+
- `spider -url 'https://github.com/cyclone-github' -agent 'foobar user agent'`
76119
- To process a local text file, create ngrams len 1-3 and sort output by frequency
77120
- `spider -file foobar.txt -ngram 1-3 -sort`
78121
- Run `spider -help` to see a list of all options
79122

80123
### spider -help
81124
```
125+
Usage of spider:
82126
-agent string
83-
Custom user-agent (default "Spider/0.9.1 (+https://github.com/cyclone-github/spider)")
127+
Custom user-agent (default "Mozilla/5.0 (X11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Spider/1.0.0")
84128
-crawl int
85129
Depth of links to crawl (default 1)
86130
-cyclone
@@ -95,8 +139,10 @@ Wordlist & ngram creation tool to crawl a given url or process a local file to c
95139
Output file for the n-grams
96140
-sort
97141
Sort output by frequency
142+
-text-match string
143+
Only process pages with text containing this keyword (case-insensitive); all URLs are still crawled
98144
-timeout int
99-
Timeout for URL crawling in seconds (default 1)
145+
Timeout for URL crawling in seconds (default 10)
100146
-url string
101147
URL of the website to scrape
102148
-url-match string
@@ -105,15 +151,6 @@ Wordlist & ngram creation tool to crawl a given url or process a local file to c
105151
Display version
106152
```
107153

108-
### Install latest release:
109-
```
110-
go install github.com/cyclone-github/spider@latest
111-
```
112-
### Install from latest source code (bleeding edge):
113-
```
114-
go install github.com/cyclone-github/spider@main
115-
```
116-
117154
### Compile from source:
118155
- If you want the latest features, compiling from source is the best option since the release version may run several revisions behind the source code.
119156
- This assumes you have Go and Git installed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module github.com/cyclone-github/spider
22

3-
go 1.25.5
3+
go 1.26.2
44

55
require github.com/PuerkitoBio/goquery v1.12.0
66

77
require (
88
github.com/andybalholm/cascadia v1.3.3 // indirect
9-
golang.org/x/net v0.52.0 // indirect
9+
golang.org/x/net v0.54.0 // indirect
1010
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
2424
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
2525
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
2626
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
27-
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
28-
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
27+
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
28+
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
2929
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
3030
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
3131
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

0 commit comments

Comments
 (0)