Add one_gadget

master
Carlos Mogas da Silva 2 years ago
parent cc81f3aa22
commit f72b9631d6
  1. BIN
      one_gadget/SOURCES/rubygem-bindata-2.4.10.tar.gz
  2. 12
      one_gadget/SOURCES/rubygem-bindata-fix-gemspec-files.patch
  3. 5
      one_gadget/create_srpm.sh
  4. 41
      one_gadget/one_gadget.spec
  5. BIN
      one_gadget/rubygem-bindata-2.4.10-1.fc34.src.rpm
  6. 40
      one_gadget/rubygem-bindata.spec
  7. 37
      one_gadget/rubygem-elftools.spec

@ -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')

@ -0,0 +1,5 @@
#!/bin/bash
rpmbuild --define "_topdir `pwd`" -bs rubygem-bindata.spec
mv SRPMS/* .
rmdir BUILDROOT RPMS SRPMS BUILD

@ -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 <r3pek@r3pek.org> - 1.7.4-1
- Initial import

@ -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 <r3pek@r3pek.org> - 2.4.10-1
- Initial import

@ -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 <r3pek@r3pek.org> - 1.1.3-1
- Initial import
Loading…
Cancel
Save