Bug 912495 - pcre support in etterfilter fails
Summary: pcre support in etterfilter fails
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: ettercap
Version: 18
Hardware: All
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-18 19:50 UTC by coppermouth
Modified: 2014-02-05 23:03 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-02-05 23:03:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Filterspec causing SIGSEGV during packet capture/rewrite of HTTP packets. (81 bytes, text/plain)
2013-02-22 14:17 UTC, coppermouth
no flags Details

Description coppermouth 2013-02-18 19:50:05 UTC
Description of problem:

When compiling a filter for ettercap via the etterfilter command that uses the pcre_regex function etterfilter will fail the compilation and produce a warning instead.


Version-Release number of selected component (if applicable):

ettercap.x86_64 0.7.5.3-1.fc18


How reproducible:

always


Steps to Reproduce:

1. Create a filter file (e.g. filter.ecf) and include a line like this:
pcre_regex(DATA.data, "test", "test");

2. Compile the filter with the etterfilter command:
etterfilter filter.ecf


Actual results:

No compiled filter is produced and etterfilter terminates with the following warning:

"WARINING The script contains pcre_regex, but you don't have support for it."

Suppression of the warning (via -w switch) does not fix the issue.


Expected results:

Creation of the compiled filter in the file filter.ef (or a file specified via the -o commandline parameter).


Additional info:

This is most likely related to cmake building the file include/config.h in the source tree and defining the symbol HAVE_PCRE_H instead of HAVE_PCRE, which is referred to in other code segments (especially in ec_filter.h and ec_filter.c).

This behaviour may or may not be specific to Fedora. I cannot be certain at the time, but it definitely affects Fedora.

Although support for pcre seems to be unavailable etterfilter still uses the shared library libpcre:

ldd `which etterfilter` | grep libpcre
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f449e5c3000)

NOTE: compiling ettercap from source and manually defining HAVE_PCRE will build etterfilter with pcre support and works for substitutions where the replacement string is at least of equal length as the replaced string. However it seems to produce SIGSEGV when the replacement string is shorter and the subsitution is performed on an intercepted packet. Thus fixing config.h may lead to problems at runtime.

Comment 1 Gwyn Ciesla 2013-02-20 14:41:41 UTC
Interesting.  Can you provide and example .ecf that causes the segfault?

Comment 2 coppermouth 2013-02-22 14:17:03 UTC
Created attachment 701206 [details]
Filterspec causing SIGSEGV during packet capture/rewrite of HTTP packets.

Comment 3 coppermouth 2013-02-22 14:26:59 UTC
The condition seems to be more specific: i.e. using an empty string as replacement.

The above filter should cause SIGSEGV when receiving an HTTP (port 80) packet with "Accept-Encoding: gzip, deflate" set in the header.

However, replacing "pcre_regex(DATA.data, "gzip, ", "");" with "pcre_regex(DATA.data, "gzip, deflate", "deflate");" seems to work.

FYI:
1. This is build from the latest source from github (master branch, latest commit 5e73e26f42).
2. I don't think i use anything besides standard F18 x86_64 build environment.

Comment 4 Gwyn Ciesla 2013-03-13 17:36:17 UTC
Hm.  Can you give me an exact command-line and menu walkthrough to reproduce this?  I can't make it crash, but I might be doing it wrong. :)

Comment 5 Fedora End Of Life 2013-12-21 15:23:16 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2014-02-05 23:03:12 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.