Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuclei: add nuclei-template support #4357

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lists/to-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nuclei
nuclei-templates
11 changes: 8 additions & 3 deletions packages/nuclei-templates/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# See COPYING for license details.

pkgname=nuclei-templates
pkgver=v10.1.0.r275.ga6d7b30a49
pkgver=v10.0.3.r423.gaf6ef96
pkgrel=1
epoch=1
pkgdesc='Community curated list of template files for the nuclei engine.'
groups=('blackarch-scanner')
groups=('blackarch' 'blackarch-scanner')
arch=('any')
url='https://github.com/projectdiscovery/nuclei-templates'
license=('MIT')
Expand All @@ -17,7 +17,12 @@ sha512sums=('SKIP')
pkgver() {
cd $pkgname

git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
( set -o pipefail
git describe --long --tags --abbrev=7 2>/dev/null |
sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "%s.%s" "$(git rev-list --count HEAD)" \
"$(git rev-parse --short=7 HEAD)"
)
}

package() {
Expand Down
25 changes: 21 additions & 4 deletions packages/nuclei/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ url='https://github.com/projectdiscovery/nuclei'
license=('MIT')
depends=('nuclei-templates')
makedepends=('git' 'go')
source=("git+https://github.com/projectdiscovery/$pkgname.git")
sha512sums=('SKIP')
source=("git+https://github.com/projectdiscovery/$pkgname.git"
"config.yaml")
sha512sums=('SKIP'
'33ae33a38717992094e09bad08dcb4d55d604c763c3709d1b01610add2ab64dae39368b443d8c8c216e5ce5f3ed30059aa640943a64a94a0fb3939c411fee662')

pkgver() {
cd $pkgname

git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
( set -o pipefail
git describe --long --tags --abbrev=7 2>/dev/null |
sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "%s.%s" "$(git rev-list --count HEAD)" \
"$(git rev-parse --short=7 HEAD)"
)
}

build() {
Expand All @@ -38,8 +45,18 @@ build() {
package() {
cd $pkgname

install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
install -dm 755 "$pkgdir/usr/bin"
install -Dm 755 $pkgname "$pkgdir/usr/share/$pkgname/$pkgname"
install -Dm 755 ../config.yaml "$pkgdir/usr/share/$pkgname/config.yaml"
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md THANKS.md
install -Dm 644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./$pkgname -config /usr/share/$pkgname/config.yaml "\$@"
EOF

chmod a+x "$pkgdir/usr/bin/$pkgname"
}

35 changes: 35 additions & 0 deletions packages/nuclei/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Headers to include with all HTTP request
header:
- 'X-BugBounty-Hacker: h1/pentester'

# Directory based template execution
templates:
- /usr/share/nuclei-templates/

# Template Filters
tags: exposures,cve
author: geeknik,pikpikcu,dhiyaneshdk
severity: critical,high,medium

# Template Allowlist
#
# Note: This will take precedence over the .nuclei-ignore file and denylist
# entries (exclude-tags or exclude-templates list).
include-tags: dos,fuzz # Tag based inclusion
include-templates: # Template based inclusion
- vulnerabilities/xxx
- misconfiguration/xxxx

# Template Denylist
exclude-tags: info # Tag based exclusion
exclude-templates: # Template based exclusion
- vulnerabilities/xxx
- misconfiguration/xxxx

# Rate Limit configuration
rate-limit: 500
bulk-size: 50
concurrency: 50

# Init checks
disable-update-check: true
Loading