OSCP-Exam-Report-Template-Markdown
OSCP-Exam-Report-Template-Markdown copied to clipboard
ArchLinux PKGBUILD
ArchLinux PKGBUILD
ArchLinux PKGBUILD
Hello @noraj Happy to meet you also here in this your wonderful project. If you wish, I can try to make a PKGBUILD for this. It could be very nice having it in some Arch repos. Just need to understand the name of the package: like OSERT or SecuReport or others.
Hi, thanks. osert is a good idea.
Hi, thanks.
osertis a good idea.
Just some considerations:
- I'm noting in Arch that from
pandocpkg theeisvogeltemplate is not provided anymore, so it must be retrieved from AUR or manually from its git repo. Could be good to inserteisvogel.latexfile in your OSERT repo? - Currently my approach on PKGBUILD was installing the
srcfiles (the.mdones) to/usr/share/osertand, according the logic ofgenerate.rb, the output will be stored in/usr/share/osert/outputfolder. Since for storing output, privileges are needed, the user should runosertby sudo. For avoiding this, could I try to editgenerate.rbin order that, when the user selects the preferred.mdfile, it will be copied in its current or $home folder, the tool will inform the user to write the.mdreport and, when he/she wrote it, to run a command likeosert -i OSCP-xxx.md -o OSCP-xxx.pdf, so the user can edit the.mdfile with its exam evidences, and then, I would like to add a-i/-oor--input/--outputarguments so that the user can save the.pdfin its preferred location (and avoid to save it in/usrsubfolders)? Once done I can make a PR for it
Here the current PKGBUILD (currently, as described in the first bullet above, we need to retrieve eisvogel manually, unless it will be brought on this repository or obtained by the PKGBUILD in some efficient manner:
pkgname=osert
pkgver=69.8dc1a32
pkgrel=1
pkgdesc="Markdown Templates for Offensive Security exam reports."
arch=('any')
url='https://github.com/noraj/OSCP-Exam-Report-Template-Markdown'
license=('GPL3')
depends=('p7zip' 'pandoc' 'texlive-core' 'texlive-fontsextra' 'texlive-latexextra' 'xdg-utils')
makedepends=('git' 'unzip')
source=("git+https://github.com/noraj/OSCP-Exam-Report-Template-Markdown.git"
"https://github.com/Wandmalfarbe/pandoc-latex-template/releases/download/v2.0.0/Eisvogel.tar.gz")
sha256sums=('SKIP'
'c9bf5d7019b65a28b397cb1ac12676bce11f5badb10a156098073950a07d3e37')
pkgver() {
cd OSCP-Exam-Report-Template-Markdown/
echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}
prepare(){
tar -zxvf Eisvogel.tar.gz
}
package() {
mkdir -p "$pkgdir/usr/share/$pkgname"
mkdir -p "$pkgdir/usr/bin"
mkdir -p "$pkgdir/usr/share/pandoc/data/templates/"
mv eisvogel.latex "$pkgdir/usr/share/pandoc/data/templates/"
cp -rf "${srcdir}/OSCP-Exam-Report-Template-Markdown/src" "${pkgdir}/usr/share/$pkgname/"
install -Dm 755 -t "$pkgdir/usr/share/$pkgname/" "${srcdir}/OSCP-Exam-Report-Template-Markdown/generate.rb"
cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec /usr/share/$pkgname/generate.rb "\$@"
EOF
chmod a+x "$pkgdir/usr/bin/$pkgname"
}
PS: about the 2nd bullet point of my previous comment, I implemented that approach on the Pull Request I opened on generate.rb.
Instead of textlive-most that consists in 12 packages: 1) texlive-bibtexextra 2) texlive-core 3) texlive-fontsextra 4) texlive-formatsextra 5) texlive-games 6) texlive-humanities 7) texlive-latexextra 8) texlive-music 9) texlive-pictures 10) texlive-pstricks 11) texlive-publishers 12) texlive-science, I identified the three needed packages for OSERT: texlive-core, texlive-fontsextra and texlive-latexextra. In this way the user can keep just the texlive packages he/she needs.
I'm noting in Arch that from
pandocpkg theeisvogeltemplate is not provided anymore, so it must be retrieved from AUR or manually from its git repo. Could be good to inserteisvogel.latexfile in your OSERT repo?
You should retrieve it from the git and add it in sources.
Ref.
- https://wiki.archlinux.org/title/PKGBUILD#source
- https://man.archlinux.org/man/PKGBUILD.5#USING_VCS_SOURCES
- https://wiki.archlinux.org/title/VCS_package_guidelines#VCS_sources
Currently my approach on PKGBUILD was installing the
srcfiles (the.mdones) to/usr/share/osertand, according the logic ofgenerate.rb, the output will be stored in/usr/share/osert/outputfolder. Since for storing output, privileges are needed, the user should runosertby sudo. For avoiding this, could I try to editgenerate.rbin order that, when the user selects the preferred.mdfile, it will be copied in its current or $home folder, the tool will inform the user to write the.mdreport and, when he/she wrote it, to run a command likeosert -i OSCP-xxx.md -o OSCP-xxx.pdf, so the user can edit the.mdfile with its exam evidences, and then, I would like to add a-i/-oor--input/--outputarguments so that the user can save the/usrsubfolders)? Once done I can make a PR for it
Good point, I should think about that.
I'm noting in Arch that from
pandocpkg theeisvogeltemplate is not provided anymore, so it must be retrieved from AUR or manually from its git repo. Could be good to inserteisvogel.latexfile in your OSERT repo?You should retrieve it from the git and add it in sources.
Ref.
- https://wiki.archlinux.org/title/PKGBUILD#source
- https://man.archlinux.org/man/PKGBUILD.5#USING_VCS_SOURCES
- https://wiki.archlinux.org/title/VCS_package_guidelines#VCS_sources
Currently my approach on PKGBUILD was installing the
srcfiles (the.mdones) to/usr/share/osertand, according the logic ofgenerate.rb, the output will be stored in/usr/share/osert/outputfolder. Since for storing output, privileges are needed, the user should runosertby sudo. For avoiding this, could I try to editgenerate.rbin order that, when the user selects the preferred.mdfile, it will be copied in its current or $home folder, the tool will inform the user to write the.mdreport and, when he/she wrote it, to run a command likeosert -i OSCP-xxx.md -o OSCP-xxx.pdf, so the user can edit the.mdfile with its exam evidences, and then, I would like to add a-i/-oor--input/--outputarguments so that the user can save the/usrsubfolders)? Once done I can make a PR for itGood point, I should think about that.
I edited my comment above with the updated PKGBUILD code. Now it retrieves and stores eisvogel.latex automatically. In the Pull Request of the repo, you can find the generate.rb updated with the file input/output approach. The following is a screen of the osert -h command:

I just updated the code in the PR. I hope it could be good for you @noraj
Now the user for first chooses the certification and then only the templates related to the chosen certification are shown. I used a nested array of objects. Then, each certification and some related output are colored according to the original OffSec certifications badge colors.
Also, now when the user inserts its OSID and Author (email address), it is automatically added in the .md file so it does not need to change this information manually. Also the date field in the .md file is automatically filled with the current date.
When run the command quoted in the screen above, the result will be the following with already author, OSID and current date information written:

I'll review and modify #35 soon. Thanks for your great PR.
I'll review and modify #35 soon. Thanks for your great PR.
You're welcome.
I made a PR on BA with a cleaner PKGBUILD https://github.com/BlackArch/blackarch/pull/3569/files
I made a PR on BA with a cleaner PKGBUILD https://github.com/BlackArch/blackarch/pull/3569/files
When the PR will be merged to BA repo, I will test it on Athena OS.