-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDK: abstracted and minimal nuclei v3 sdk (#4104)
* new sdk progress * nuclei v3 new sdk/library * fix TestActionGetResource broken link * fix clistats + clustering and more * fix lint error * fix missing ticker * update advanced library usage example * fix integration tests * misc update * add utm_source and fix lint error --------- Co-authored-by: sandeep <[email protected]>
- Loading branch information
1 parent
f7fe99f
commit 2d31788
Showing
27 changed files
with
1,297 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package main | ||
|
||
import ( | ||
nuclei "github.com/projectdiscovery/nuclei/v2/lib" | ||
"github.com/remeh/sizedwaitgroup" | ||
) | ||
|
||
func main() { | ||
// create nuclei engine with options | ||
ne, err := nuclei.NewThreadSafeNucleiEngine() | ||
if err != nil { | ||
panic(err) | ||
} | ||
// setup sizedWaitgroup to handle concurrency | ||
sg := sizedwaitgroup.New(10) | ||
|
||
// scan 1 = run dns templates on scanme.sh | ||
sg.Add() | ||
go func() { | ||
defer sg.Done() | ||
err = ne.ExecuteNucleiWithOpts([]string{"scanme.sh"}, | ||
nuclei.WithTemplateFilters(nuclei.TemplateFilters{ProtocolTypes: "dns"}), | ||
) | ||
if err != nil { | ||
panic(err) | ||
} | ||
}() | ||
|
||
// scan 2 = run templates with oast tags on honey.scanme.sh | ||
sg.Add() | ||
go func() { | ||
defer sg.Done() | ||
err = ne.ExecuteNucleiWithOpts([]string{"http://honey.scanme.sh"}, nuclei.WithTemplateFilters(nuclei.TemplateFilters{Tags: []string{"oast"}})) | ||
if err != nil { | ||
panic(err) | ||
} | ||
}() | ||
|
||
// wait for all scans to finish | ||
sg.Wait() | ||
defer ne.Close() | ||
|
||
// Output: | ||
// [dns-saas-service-detection] scanme.sh | ||
// [nameserver-fingerprint] scanme.sh | ||
// [dns-saas-service-detection] honey.scanme.sh | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import nuclei "github.com/projectdiscovery/nuclei/v2/lib" | ||
|
||
func main() { | ||
ne, err := nuclei.NewNucleiEngine( | ||
nuclei.WithTemplateFilters(nuclei.TemplateFilters{Tags: []string{"oast"}}), | ||
nuclei.EnableStatsWithOpts(nuclei.StatsOptions{MetricServerPort: 6064}), // optionally enable metrics server for better observability | ||
) | ||
if err != nil { | ||
panic(err) | ||
} | ||
// load targets and optionally probe non http/https targets | ||
ne.LoadTargets([]string{"http://honey.scanme.sh"}, false) | ||
err = ne.ExecuteWithCallback(nil) | ||
if err != nil { | ||
panic(err) | ||
} | ||
defer ne.Close() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.