Skip to content

Commit 32cbfda

Browse files
authored
Merge branch 'edoardottt:main' into trufflehog
2 parents 3519c94 + 9e5c233 commit 32cbfda

File tree

6 files changed

+400
-13
lines changed

6 files changed

+400
-13
lines changed

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Installation 📡
3838
----------
3939

4040
### Homebrew
41+
4142
```
4243
brew install cariddi
4344
```
@@ -180,7 +181,44 @@ Examples 💡
180181
- use `powershell.exe -Command "cat urls | .\cariddi.exe"` inside the Command prompt
181182
- or just `cat urls | cariddi.exe` using PowerShell
182183

183-
- To integrate cariddi with Burpsuite [follow these steps](https://github.com/edoardottt/cariddi/wiki/BurpSuite-Integration).
184+
- To integrate cariddi with Burpsuite [follow these steps](https://github.com/edoardottt/cariddi/wiki/BurpSuite-Integration) or click the button below:
185+
186+
<details>
187+
<summary>Integrate cariddi with Burpsuite</summary>
188+
189+
Normally you use Burpsuite within your browser, so you just have to trust the burpsuite's certificate in the browser and you're done.
190+
In order to use cariddi with the BurpSuite proxy you should do some steps further.
191+
192+
If you try to use cariddi with the option `-proxy http://127.0.0.1:8080` you will find this error in the burpsuite error log section:
193+
194+
```bash
195+
Received fatal alert: bad_certificate (or something similar related to the certificate).
196+
```
197+
198+
To make cariddi working fine with Burpsuite you have also to trust the certificate within your entire pc, not just only the browser. These are the steps you have to follow:
199+
200+
Go to Proxy tab in Bupsuite, then Options. Click on the CA Certificate button and export Certificate in DER format
201+
202+
```bash
203+
openssl x509 -in burp.der -inform DER -out burp.pem -outform PEM
204+
sudo chown root:root burp.pem
205+
sudo chmod 644 burp.pem
206+
sudo cp burp.pem /usr/local/share/ca-certificates/
207+
sudo c_rehash
208+
cd /etc/ssl/certs/
209+
sudo ln -s /usr/local/share/ca-certificates/burp.pem
210+
sudo c_rehash .
211+
```
212+
213+
Source: Trust Burp Proxy certificate in Debian/Ubuntu
214+
215+
After these steps, in order to use cariddi with Burpsuite you have to:
216+
217+
1. Open Burpsuite, making sure that the proxy is listening.
218+
2. Use cariddi with the flag `-proxy http://127.0.0.1:8080`.
219+
3. You will see that requests and responses will be logged in Burpsuite.
220+
221+
</details>
184222

185223
Changelog 📌
186224
-------
@@ -202,7 +240,7 @@ If there aren't errors, go ahead :)
202240

203241
**Help me building this!**
204242

205-
Special thanks to: [go-colly](http://go-colly.org/), [ocervell](https://github.com/ocervell), [zricethezav](https://github.com/zricethezav/gitleaks/blob/master/config/default.go), [projectdiscovery](https://github.com/projectdiscovery/nuclei-templates/tree/master/file/keys), [tomnomnom](https://github.com/tomnomnom/gf/tree/master/examples), [RegexPassive](https://github.com/hahwul/RegexPassive) and [all the contributors](https://github.com/edoardottt/cariddi/wiki/Contributors).
243+
Special thanks to: [go-colly](http://go-colly.org/), [ocervell](https://github.com/ocervell), [zricethezav](https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml), [projectdiscovery](https://github.com/projectdiscovery/nuclei-templates/tree/master/file/keys), [tomnomnom](https://github.com/tomnomnom/gf/tree/master/examples), [RegexPassive](https://github.com/hahwul/RegexPassive) and [all the contributors](https://github.com/edoardottt/cariddi/wiki/Contributors).
206244

207245
License 📝
208246
-------

internal/slice/slice_test.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ func TestRemoveDuplicateValues(t *testing.T) {
5050
slice: nil,
5151
want: []string{},
5252
},
53+
{
54+
name: "one element",
55+
slice: []string{"a"},
56+
want: []string{"a"},
57+
},
5358
{
5459
name: "withous duplicates",
5560
slice: []string{"a", "b", "c"},
@@ -133,7 +138,7 @@ func TestCheckCookies(t *testing.T) {
133138
},
134139
},
135140
{
136-
name: "several paris",
141+
name: "several pairs",
137142
input: "name1:some_value@1;name_2:some$%_value@",
138143
want: []*http.Cookie{
139144
{
@@ -146,6 +151,24 @@ func TestCheckCookies(t *testing.T) {
146151
},
147152
},
148153
},
154+
{
155+
name: "several pairs 2",
156+
input: "name1:some_value@1;name_2:some$%_value@;name_3:somevalueeeeee",
157+
want: []*http.Cookie{
158+
{
159+
Name: "name1",
160+
Value: "some_value@1",
161+
},
162+
{
163+
Name: "name_2",
164+
Value: "some$%_value@",
165+
},
166+
{
167+
Name: "name_3",
168+
Value: "somevalueeeeee",
169+
},
170+
},
171+
},
149172
{
150173
name: "some pairs are not valid",
151174
input: "name1:value:_1;name;2:value2;name_3:value_3",

pkg/crawler/useragents.go

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ import (
3737

3838
// genOsString generates a random OS string for a User Agent.
3939
func genOsString() string {
40-
rand.Seed(time.Now().UnixNano())
40+
source := rand.NewSource(time.Now().UnixNano())
41+
rng := rand.New(source)
42+
4143
// Operating system.
4244
var OsStrings = []string{
4345
"Macintosh; Intel Mac OS X 10_10",
@@ -48,15 +50,43 @@ func genOsString() string {
4850
"X11; Linux x86_64",
4951
}
5052

51-
return OsStrings[rand.Intn(len(OsStrings))]
53+
return OsStrings[rng.Intn(len(OsStrings))]
5254
}
5355

5456
// genFirefoxUA generates a random Firefox User Agent.
5557
func genFirefoxUA() string {
56-
rand.Seed(time.Now().UnixNano())
58+
source := rand.NewSource(time.Now().UnixNano())
59+
rng := rand.New(source)
5760

5861
// Firefox versions.
5962
var FirefoxVersions = []float32{
63+
127.0,
64+
126.0,
65+
124.0,
66+
123.0,
67+
122.0,
68+
121.0,
69+
120.0,
70+
119.0,
71+
118.0,
72+
117.0,
73+
116.0,
74+
115.0,
75+
114.0,
76+
113.0,
77+
112.0,
78+
111.0,
79+
110.0,
80+
109.0,
81+
108.0,
82+
107.0,
83+
106.0,
84+
105.0,
85+
104.0,
86+
103.0,
87+
102.0,
88+
101.0,
89+
100.0,
6090
58.0,
6191
57.0,
6292
56.0,
@@ -66,25 +96,50 @@ func genFirefoxUA() string {
6696
35.0,
6797
}
6898

69-
version := FirefoxVersions[rand.Intn(len(FirefoxVersions))]
99+
version := FirefoxVersions[rng.Intn(len(FirefoxVersions))]
70100

71101
return fmt.Sprintf("Mozilla/5.0 (%s; rv:%.1f) Gecko/20100101 Firefox/%.1f", genOsString(), version, version)
72102
}
73103

74104
// genChromeUA generates a random Chrome User Agent.
75105
func genChromeUA() string {
76-
rand.Seed(time.Now().UnixNano())
106+
source := rand.NewSource(time.Now().UnixNano())
107+
rng := rand.New(source)
77108

78109
// Chrome versions.
79110
var ChromeVersions = []string{
111+
"126.0.6478.126",
112+
"124.0.6367.60",
113+
"123.0.6312.105",
114+
"121.0.6167.160",
115+
"120.0.6099.199",
116+
"119.0.6045.199",
117+
"118.0.5993.70",
118+
"117.0.5938.149",
119+
"116.0.5845.140",
120+
"115.0.5790.170",
121+
"114.0.5735.90",
122+
"113.0.5672.126",
123+
"112.0.5615.137",
124+
"111.0.5563.110",
125+
"109.0.5414.119",
126+
"108.0.5359.94",
127+
"107.0.5304.62",
128+
"106.0.5249.15",
129+
"105.0.5195.51",
130+
"104.0.5112.105",
131+
"103.0.5060.2",
132+
"102.0.5005.156",
133+
"101.0.4951.69",
134+
"100.0.4896.163",
80135
"65.0.3325.146",
81136
"64.0.3282.0",
82137
"41.0.2228.0",
83138
"40.0.2214.93",
84139
"37.0.2062.124",
85140
}
86141

87-
version := ChromeVersions[rand.Intn(len(ChromeVersions))]
142+
version := ChromeVersions[rng.Intn(len(ChromeVersions))]
88143

89144
return fmt.Sprintf("Mozilla/5.0 (%s) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",
90145
genOsString(), version)
@@ -93,9 +148,10 @@ func genChromeUA() string {
93148
// GenerateRandomUserAgent generates a random user agent
94149
// (can be Chrome or Firefox).
95150
func GenerateRandomUserAgent() string {
96-
rand.Seed(time.Now().UnixNano())
151+
source := rand.NewSource(time.Now().UnixNano())
152+
rng := rand.New(source)
97153

98-
decision := rand.Intn(100)
154+
decision := rng.Intn(100)
99155

100156
var ua string
101157
if decision%2 == 0 {

pkg/output/banner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535

3636
// nolint: checknoglobals
3737
const (
38-
version = "v1.3.4"
38+
version = "v1.3.5"
3939
banner = ` _ _ _ _
4040
(_) | | | (_)
4141
___ __ _ _ __ _ __| | __| |_

0 commit comments

Comments
 (0)