diff --git a/one_gadget/SOURCES/rubygem-bindata-2.4.10.tar.gz b/one_gadget/SOURCES/rubygem-bindata-2.4.10.tar.gz new file mode 100644 index 0000000..eb3d2b5 Binary files /dev/null and b/one_gadget/SOURCES/rubygem-bindata-2.4.10.tar.gz differ diff --git a/one_gadget/SOURCES/rubygem-bindata-fix-gemspec-files.patch b/one_gadget/SOURCES/rubygem-bindata-fix-gemspec-files.patch new file mode 100644 index 0000000..e186b0f --- /dev/null +++ b/one_gadget/SOURCES/rubygem-bindata-fix-gemspec-files.patch @@ -0,0 +1,12 @@ +diff -u a/bindata.gemspec b/bindata.gemspec +--- a/bindata.gemspec 2021-05-21 13:29:34.158562502 +0100 ++++ b/bindata.gemspec 2021-05-21 13:42:00.930029375 +0100 +@@ -12,7 +12,7 @@ + s.require_path = 'lib' + s.extra_rdoc_files = ['NEWS.rdoc'] + s.rdoc_options << '--main' << 'NEWS.rdoc' +- s.files = `git ls-files`.split("\n") ++ s.files = Dir['lib/**/*.rb'] + %w(README.md) + s.license = 'Ruby' + + s.add_development_dependency('rake') diff --git a/one_gadget/create_srpm.sh b/one_gadget/create_srpm.sh new file mode 100755 index 0000000..5b54cdf --- /dev/null +++ b/one_gadget/create_srpm.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +rpmbuild --define "_topdir `pwd`" -bs rubygem-bindata.spec +mv SRPMS/* . +rmdir BUILDROOT RPMS SRPMS BUILD diff --git a/one_gadget/one_gadget.spec b/one_gadget/one_gadget.spec new file mode 100644 index 0000000..70a99d0 --- /dev/null +++ b/one_gadget/one_gadget.spec @@ -0,0 +1,41 @@ +%define debug_package %{nil} + +%define gem_name one_gadget + +Name: %{gem_name} +Version: 1.7.4 +Release: 1%{?dist} +Summary: Tool to find an execve call to /bin/sh + +License: MIT +URL: https://github.com/david942j/%{gem_name} +Source: https://github.com/david942j/%{gem_name}/archive/refs/tags/v%{version}.tar.gz + +BuildRequires: rubygems-devel +BuildArch: noarch + +%description +When playing ctf pwn challenges we usually need the one-gadget RCE +(remote code execution), which leads to call execve('/bin/sh', NULL, NULL). + +%prep +%autosetup -n %{gem_name}-%{version} + +%build +gem build %{gem_name}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ +mkdir -p %{buildroot}%{_bindir} +cp -a ./%{_bindir}/* %{buildroot}%{_bindir} + +%files +%_bindir/* +%{gem_dir}/* +%doc LICENSE README.md + +%changelog +* Fri May 21 2021 Carlos Mogas da Silva - 1.7.4-1 +- Initial import \ No newline at end of file diff --git a/one_gadget/rubygem-bindata-2.4.10-1.fc34.src.rpm b/one_gadget/rubygem-bindata-2.4.10-1.fc34.src.rpm new file mode 100644 index 0000000..ff1aee4 Binary files /dev/null and b/one_gadget/rubygem-bindata-2.4.10-1.fc34.src.rpm differ diff --git a/one_gadget/rubygem-bindata.spec b/one_gadget/rubygem-bindata.spec new file mode 100644 index 0000000..2924c1b --- /dev/null +++ b/one_gadget/rubygem-bindata.spec @@ -0,0 +1,40 @@ +%define debug_package %{nil} + +%define gem_name bindata + +Name: rubygem-%{gem_name} +Version: 2.4.10 +Release: 1%{?dist} +Summary: BinData provides a declarative way to read and write structured binary data. + +License: BSD-2-Clause +URL: https://github.com/dmendel/%{gem_name} +Source: %{name}-%{version}.tar.gz +Patch: rubygem-bindata-fix-gemspec-files.patch + +BuildRequires: rubygems-devel +BuildArch: noarch + +%description +BinData makes it easy to create new data types. +It supports all the common primitive datatypes that are found in structured binary data formats. +Support for dependent and variable length fields is built in. + +%prep +%autosetup -n %{gem_name}-%{version} + +%build +gem build %{gem_name}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ + +%files +%{gem_dir}/* +%doc BSDL README.md + +%changelog +* Fri May 21 2021 Carlos Mogas da Silva - 2.4.10-1 +- Initial import \ No newline at end of file diff --git a/one_gadget/rubygem-elftools.spec b/one_gadget/rubygem-elftools.spec new file mode 100644 index 0000000..de8e793 --- /dev/null +++ b/one_gadget/rubygem-elftools.spec @@ -0,0 +1,37 @@ +%define debug_package %{nil} + +%define gem_name elftools + +Name: rubygem-%{gem_name} +Version: 1.1.3 +Release: 1%{?dist} +Summary: Pure ruby library for parsing and patching ELF files. + +License: MIT +URL: https://github.com/david942j/rb%{gem_name} +Source: https://github.com/david942j/rb%{gem_name}/archive/refs/tags/v%{version}.tar.gz + +BuildRequires: rubygems-devel +BuildArch: noarch + +%description +ELF parser in pure ruby implementation. This work is inspired by pyelftools by Eli Bendersky. + +%prep +%autosetup -n rb%{gem_name}-%{version} + +%build +gem build %{gem_name}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ + +%files +%{gem_dir}/* +%doc LICENSE README.md + +%changelog +* Fri May 21 2021 Carlos Mogas da Silva - 1.1.3-1 +- Initial import \ No newline at end of file