Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Troy Dawson
d2507477d2 epel8-playground decommissioned : https://pagure.io/epel/issue/136 2022-01-31 18:15:46 -08:00
8 changed files with 1 additions and 12911 deletions

15
.gitignore vendored
View file

@ -1,15 +0,0 @@
/androguard-yara-3.5.0-fc14c0f.tar.gz
/androguard-yara-3.6.0-e4cf5fa.tar.gz
/androguard-yara-3.6.2-e4cf5fa.tar.gz
/androguard-yara-3.6.3-e4cf5fa.tar.gz
/androguard-yara-e4cf5fa.tar.gz
/yara-3.5.0-7473441.tar.gz
/yara-3.6.0.tar.gz
/yara-3.6.2.tar.gz
/yara-3.6.3.tar.gz
/yara-3.7.0.tar.gz
/yara-3.7.1.tar.gz
/androguard-yara-fa11a84.tar.gz
/yara-3.8.1.tar.gz
/yara-3.9.0.tar.gz
/yara-3.10.0.tar.gz

1
dead.package Normal file
View file

@ -0,0 +1 @@
epel8-playground decommissioned : https://pagure.io/epel/issue/136

View file

@ -1,2 +0,0 @@
SHA512 (yara-3.10.0.tar.gz) = 034658e835d59a42f03c062e99b40e96906c5a7de4285037c835d211f53062f8e439ade45e3400c4c35ef64502112e8d3b8d4c575e3265c69286cff2ad919ed9
SHA512 (androguard-yara-fa11a84.tar.gz) = 684f4683c37722078c7d3d0284c1c48269832e935548663ec3f980723df2a1124ed5ab6dd8d755f6cb1ed8931c66811b6d399a9355e1eb233c4f8b3710718b78

View file

@ -1,245 +0,0 @@
Fix from https://github.com/Koodous/androguard-yara/issues/8
Author: Sebastian Bachmann AKA reox https://www.reox.at/about/
diff --git a/androguard.c b/androguard.c
index 3f53965..a8b6911 100644
--- a/androguard.c
+++ b/androguard.c
@@ -50,6 +50,7 @@ struct permissions {
*/
define_function(certificate_subject_lookup)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = parent();
char *value = NULL;
uint64_t result = 0;
@@ -59,7 +60,7 @@ define_function(certificate_subject_lookup)
if (val) {
value = (char *)json_string_value(val);
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}
@@ -86,6 +87,7 @@ void remove_colon(const char* input, char* output) {
*/
define_function(certificate_not_before_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = parent();
char *value = NULL;
uint64_t result = 0;
@@ -97,7 +99,7 @@ define_function(certificate_not_before_lookup_regex)
}
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}
@@ -134,6 +136,7 @@ define_function(certificate_not_before_lookup_string)
*/
define_function(certificate_not_after_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = parent();
char *value = NULL;
uint64_t result = 0;
@@ -145,7 +148,7 @@ define_function(certificate_not_after_lookup_regex)
}
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}
@@ -214,6 +217,7 @@ define_function(certificate_sha1_lookup)
*/
define_function(certificate_issuer_lookup)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = parent();
char *value = NULL;
uint64_t result = 0;
@@ -226,7 +230,7 @@ define_function(certificate_issuer_lookup)
}
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}
@@ -239,12 +243,13 @@ define_function(certificate_issuer_lookup)
*/
define_function(main_activity_lookup)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = get_object(module(), "main_activity");
char* value = obj->data;
uint64_t result = 0;
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}
@@ -257,6 +262,7 @@ define_function(main_activity_lookup)
*/
define_function(permission_lookup)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = get_object(module(), "permission");
struct permissions *a;
@@ -272,7 +278,7 @@ define_function(permission_lookup)
json_array_foreach(list_perms, index, value)
{
- if (yr_re_match(regexp_argument(1), json_string_value(value)) > 0)
+ if (yr_re_match(context, regexp_argument(1), json_string_value(value)) > 0)
{
result = 1;
break;
@@ -282,7 +288,7 @@ define_function(permission_lookup)
if (!result) {
json_array_foreach(list_new_perms, index, value)
{
- if (yr_re_match(regexp_argument(1), json_string_value(value)) > 0)
+ if (yr_re_match(context, regexp_argument(1), json_string_value(value)) > 0)
{
result = 1;
break;
@@ -297,6 +303,7 @@ define_function(permission_lookup)
*/
define_function(activity_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* activity_obj = get_object(module(), "activity");
json_t* list = (json_t*) activity_obj->data;
@@ -306,7 +313,7 @@ define_function(activity_lookup_regex)
json_array_foreach(list, index, value)
{
- if (yr_re_match(regexp_argument(1), json_string_value(value)) > 0)
+ if (yr_re_match(context, regexp_argument(1), json_string_value(value)) > 0)
{
result = 1;
break;
@@ -343,6 +350,7 @@ define_function(activity_lookup_string)
*/
define_function(service_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* service_obj = get_object(module(), "service");
json_t* list = (json_t*) service_obj->data;
@@ -352,7 +360,7 @@ define_function(service_lookup_regex)
json_array_foreach(list, index, value)
{
- if (yr_re_match(regexp_argument(1), json_string_value(value)) > 0)
+ if (yr_re_match(context, regexp_argument(1), json_string_value(value)) > 0)
{
result = 1;
break;
@@ -389,6 +397,7 @@ define_function(service_lookup_string)
*/
define_function(filter_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* filter_obj = get_object(module(), "filter");
json_t* list = (json_t*) filter_obj->data;
@@ -398,7 +407,7 @@ define_function(filter_lookup_regex)
json_array_foreach(list, index, value)
{
- if (yr_re_match(regexp_argument(1), json_string_value(value)) > 0)
+ if (yr_re_match(context, regexp_argument(1), json_string_value(value)) > 0)
{
result = 1;
break;
@@ -435,6 +444,7 @@ define_function(filter_lookup_string)
*/
define_function(receiver_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* receiver_obj = get_object(module(), "receiver");
json_t* list = (json_t*) receiver_obj->data;
@@ -444,7 +454,7 @@ define_function(receiver_lookup_regex)
json_array_foreach(list, index, value)
{
- if (yr_re_match(regexp_argument(1), json_string_value(value)) > 0)
+ if (yr_re_match(context, regexp_argument(1), json_string_value(value)) > 0)
{
result = 1;
break;
@@ -481,12 +491,13 @@ define_function(receiver_lookup_string)
*/
define_function(displayed_version_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = get_object(module(), "displayed_version");
char* value = obj->data;
uint64_t result = 0;
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}
@@ -518,6 +529,7 @@ define_function(displayed_version_lookup_string)
*/
define_function(url_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = get_object(module(), "url");
json_t* list = (json_t*) obj->data;
@@ -527,7 +539,7 @@ define_function(url_lookup_regex)
json_array_foreach(list, index, value)
{
- if (yr_re_match(regexp_argument(1), json_string_value(value)) > 0)
+ if (yr_re_match(context, regexp_argument(1), json_string_value(value)) > 0)
{
result = 1;
break;
@@ -564,12 +576,13 @@ define_function(url_lookup_string)
*/
define_function(appname_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* obj = get_object(module(), "app_name");
char* value = obj->data;
uint64_t result = 0;
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}
@@ -600,12 +613,13 @@ define_function(appname_lookup_string)
*/
define_function(package_name_lookup_regex)
{
+ YR_SCAN_CONTEXT* context = scan_context();
YR_OBJECT* package_name_obj = get_object(module(), "package_name");
char* value = package_name_obj->data;
uint64_t result = 0;
if (value) {
- if (yr_re_match(regexp_argument(1), value) > 0) {
+ if (yr_re_match(context, regexp_argument(1), value) > 0) {
result = 1;
}
}

View file

@ -1,22 +0,0 @@
diff -ru yara-3.7.0.orig/libyara/Makefile.am yara-3.7.0.androguard/libyara/Makefile.am
--- yara-3.7.0.orig/libyara/Makefile.am 2017-11-10 11:21:21.000000000 +0000
+++ yara-3.7.0.androguard/libyara/Makefile.am 2017-11-15 17:35:12.269000000 +0000
@@ -7,6 +7,7 @@
if CUCKOO_MODULE
MODULES += modules/cuckoo.c
+MODULES += modules/androguard.c
endif
if MAGIC_MODULE
diff -ru yara-3.7.0.orig/libyara/modules/module_list yara-3.7.0.androguard/libyara/modules/module_list
--- yara-3.7.0.orig/libyara/modules/module_list 2017-11-10 11:21:21.000000000 +0000
+++ yara-3.7.0.androguard/libyara/modules/module_list 2017-11-15 17:35:12.271000000 +0000
@@ -10,6 +10,7 @@
#ifdef CUCKOO_MODULE
MODULE(cuckoo)
+MODULE(androguard)
#endif
#ifdef MAGIC_MODULE

View file

@ -1,23 +0,0 @@
diff -ru yara-74734418a256c5304ccaf1d322c57e305ff75362/docs/conf.py yara-74734418a256c5304ccaf1d322c57e305ff75362.new/docs/conf.py
--- yara-74734418a256c5304ccaf1d322c57e305ff75362/docs/conf.py 2016-08-02 22:08:18.000000000 +0200
+++ yara-74734418a256c5304ccaf1d322c57e305ff75362.new/docs/conf.py 2016-08-08 23:08:47.637063737 +0200
@@ -102,12 +102,13 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-try:
- import sphinx_rtd_theme
- html_theme = "sphinx_rtd_theme"
- html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
-except:
- html_theme = "default"
+#try:
+# import sphinx_rtd_theme
+# html_theme = "sphinx_rtd_theme"
+# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+#except:
+# html_theme = "default"
+html_theme = "default"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the

File diff suppressed because it is too large Load diff

281
yara.spec
View file

@ -1,281 +0,0 @@
Name: yara
Version: 3.10.0
Release: 3%{?dist}
Summary: Pattern matching Swiss knife for malware researchers
# yara package itself is licensed as ASL 2.0
# bison grammar parsers in libyara/* are dual licensed under ASL 2.0 and GPLv3+ license.
# resulting binary package licensed as ASL 2.0
License: ASL 2.0
# http://github.com/VirusTotal/yara/releases
URL: http://VirusTotal.github.io/yara/
%global gituser VirusTotal
%global gitname yara
# Commit of version 3.10.0
%global commit d9c966b6d576ee8ba2ac5cb17cce1e28cd7cc204
%global shortcommit %(c=%{commit}; echo ${c:0:7})
# additional module for yara
%global androguard_gituser Koodous
%global androguard_gitname androguard-yara
# Commit from 2018-03-07
%global androguard_commit fa11a84d9dc106e6364043062a6e6207c44aceaa
%global androguard_shortcommit %(c=%{androguard_commit}; echo ${c:0:7})
# Build from git commit baseline
#Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
# Build from git release version
Source0: https://github.com/%{gituser}/%{gitname}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# http://github.com/Koodous/androguard-yara/
Source1: https://github.com/%{androguard_gituser}/%{androguard_gitname}/archive/%{androguard_commit}/%{androguard_gitname}-%{androguard_shortcommit}.tar.gz
# Patch based on the androguard-yara installation guide to enable the androguard module
Patch0: %{name}-androguard.patch
# Use default sphix theme to generate documentation rather than sphinx_rtd_theme
# to avoid static installation of font files on fedora >= 24
Patch1: %{name}-docs-theme.patch
# Fixed in 3.6.0 upstream
# Patch https://patch-diff.githubusercontent.com/raw/VirusTotal/yara/pull/627.patch
# Fixes: CVE-2016-10210 CVE-2016-10211 CVE-2017-5923 CVE-2017-5924
# Patch2: %{name}-pull627.patch
# API of yr_re_match changed, fix needed for Androguard
# https://github.com/Koodous/androguard-yara/issues/8
Patch3: yara-androguard-matchapi.patch
BuildRequires: gcc
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: m4
BuildRequires: binutils
BuildRequires: coreutils
BuildRequires: sharutils
BuildRequires: file
BuildRequires: gawk
BuildRequires: gzip
BuildRequires: xz
BuildRequires: pcre
BuildRequires: bison
BuildRequires: flex
BuildRequires: libtool
BuildRequires: file-devel
BuildRequires: jansson-devel >= 2.5
BuildRequires: openssl-devel
# html doc generation
BuildRequires: /usr/bin/sphinx-build
%description
YARA is a tool aimed at (but not limited to) helping malware researchers to
identify and classify malware samples. With YARA you can create descriptions
of malware families (or whatever you want to describe) based on textual or
binary patterns. Each description, a.k.a rule, consists of a set of strings
and a Boolean expression which determine its logic.
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
This package contains documentation for %{name}.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
# setup -qn %{gitname}-%{commit}
%setup -q
# Add the Androguard module
# %setup -qn %{gitname}-%{commit} -a 1 -D -T
%setup -q -a 1 -D -T
pushd %{androguard_gitname}-%{androguard_commit}
# Patch yr_re_match api in androguard-yara
# https://github.com/Koodous/androguard-yara/issues/8
%patch3 -p 1 -b .matchapi
cp -p androguard.c ../libyara/modules/
popd
# Patch based on the androguard-yara installation guide to enable the androguard module
%patch0 -p 1 -b .androguard
# Use default sphix theme to generate documentation rather than sphinx_rtd_theme
# to avoid static installation of font files on fedora >= 24
%patch1 -p 1 -b .fonts
autoreconf --force --install
%build
# macro \configure already does use CFLAGS="\{optflags}" and yara build
# scripts configure/make already honors that CFLAGS
%configure --enable-magic --enable-cuckoo --with-crypto \
--htmldir=%{_datadir}/doc/%{name}/html
make %{?_smp_mflags}
# build the HTML documentation
pushd docs
make html
popd
%install
make install DESTDIR=%{buildroot}
# Remove static libraries
rm %{buildroot}%{_libdir}/lib%{name}.la
rm %{buildroot}%{_libdir}/lib%{name}.a
# Remove the rebuild-needed tag so it is not installed in doc pkg
rm -f %{buildroot}%{_datadir}/doc/%{name}/html/.buildinfo
%ldconfig_scriptlets
%files
%doc AUTHORS CONTRIBUTORS README.md
%license COPYING
%{_bindir}/%{name}
%{_bindir}/%{name}c
%{_libdir}/lib%{name}.so.*
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/%{name}c.1*
%files devel
%{_includedir}/%{name}.h
%{_includedir}/%{name}/
%{_libdir}/*.so
%{_libdir}/pkgconfig/%{name}.pc
%files doc
%license COPYING
%doc docs/_build/html
%changelog
* Fri Sep 28 2019 Michal Ambroz <rebus at, seznam.cz> - 3.10.0-3
- change the sphinx build dependency
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri May 03 2019 Michal Ambroz <rebus at, seznam.cz> - 3.10.0-1
- bump to 3.10.0 release (#1680204)
- Optimize integer range loops by exiting earlier when possible.
- Cache the result of PE modules imphash function in order to improve performance.
- Harden virtual machine against malicious code.
- BUGFIX: “xor” modifier not working as expected if not accompanied by “ascii” (#1053).
- BUGFIX: \s and \S character classes in regular expressions now include vertical tab, new line, carriage return and form feed characters.
- BUGFIX: Regression bug in hex strings containing wildcards (#1025).
- BUGFIX: Buffer overrun in “elf” module.
- BUGFIX: Buffer overrun in “dotnet” module.
* Sat Mar 16 2019 Michal Ambroz <rebus at, seznam.cz> - 3.9.0-1
- bump to 3.9.0 release (#1680203)
- should fix also #1660398, but by design it might be always dangerous
to run yara signatures compiled by 3rd party, it is advised to re-compile
yara rules instead
- switch from python-sphinx to python3-sphinx for generating the documentation
for fc31+
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Aug 27 2018 Michal Ambroz <rebus at, seznam.cz> - 3.8.1-1
- bump to 3.8.1 release (#1613093)
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Mon Feb 05 2018 Michal Ambroz <rebus at, seznam.cz> - 3.7.1-1
- bump to 3.7.1 release (#1534993)
* Wed Nov 15 2017 Michal Ambroz <rebus at, seznam.cz> - 3.7.0-1
- bump to 3.7.0 release (#1511921)
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sun Jul 16 2017 Michal Ambroz <rebus at, seznam.cz> - 3.6.3-1
- bump to 3.6.3 release - bugfix CVE-2017-11328
* Mon Jul 03 2017 Michal Ambroz <rebus at, seznam.cz> - 3.6.2-1
- bump to 3.6.2 release - bugfix CVE-2017-9304, CVE-2017-9465
* Wed May 24 2017 Michal Ambroz <rebus at, seznam.cz> - 3.6.0-1
- bump to 3.6.0 release
- update the androguard-yara with bugfixes
* Thu Apr 13 2017 Michal Ambroz <rebus at, seznam.cz> - 3.5.0-7
- Adding patch from pull request 627 until 3.5.1 is released
- https://patch-diff.githubusercontent.com/raw/VirusTotal/yara/pull/627.patch
- Fixes CVE-2016-10210 CVE-2016-10211 CVE-2017-5923 CVE-2017-5924
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Aug 09 2016 Michal Ambroz <rebus at, seznam.cz> - 3.5.0-5
- import package to Fedora
- remove unnecessary .buildinfo tag from doc package
* Fri Aug 05 2016 Michal Ambroz <rebus at, seznam.cz> - 3.5.0-4
- package review - bugzilla #1362265
- cosmetics of the changelog
- using default spinx theme to remove the static fonts
* Fri Aug 05 2016 Michal Ambroz <rebus at, seznam.cz> - 3.5.0-3
- package review - bugzilla #1362265
- dropped Buildroot, pkgconfig, zlib-devel, defattr
- added buildrequires gcc
- change license back to ASL 2.0 only
* Thu Aug 04 2016 Michal Ambroz <rebus at, seznam.cz> - 3.5.0-2
- package review - bugzilla #1362265
- changed packaging of doc sub-package
* Thu Aug 04 2016 Michal Ambroz <rebus at, seznam.cz> - 3.5.0-1
- bump to new 3.5.0
* Wed Aug 03 2016 Michal Ambroz <rebus at, seznam.cz> - 3.4.0-6
- package review - bugzilla #1362265
- dropped dependency of python-tools
* Mon Aug 01 2016 Michal Ambroz <rebus at, seznam.cz> - 3.4.0-4
- compile with the androguard module
* Wed Jun 08 2016 Michal Ambroz <rebus at, seznam.cz> - 3.4.0-2
- jansson dependency >= 2.5
* Wed Jun 08 2016 Michal Ambroz <rebus at, seznam.cz> - 3.4.0-1
- python3 stuff
* Mon Jun 22 2015 Michal Ambroz <rebus at, seznam.cz> - 3.4.0-0.git20150618
- initial build for Fedora Project