Bug 280341 - [NEW PORT] security/exploit-pattern: search pattern generator
Summary: [NEW PORT] security/exploit-pattern: search pattern generator
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-17 23:26 UTC by gatekeeper
Modified: 2024-07-25 18:23 UTC (History)
1 user (show)

See Also:


Attachments
git patch (2.37 KB, patch)
2024-07-17 23:26 UTC, gatekeeper
no flags Details | Diff
git patch (2.25 KB, patch)
2024-07-25 16:04 UTC, gatekeeper
no flags Details | Diff
git patch (2.25 KB, patch)
2024-07-25 16:08 UTC, gatekeeper
no flags Details | Diff
git patch (2.25 KB, patch)
2024-07-25 16:12 UTC, gatekeeper
no flags Details | Diff
git patch (2.24 KB, patch)
2024-07-25 16:16 UTC, gatekeeper
no flags Details | Diff
git patch (2.28 KB, patch)
2024-07-25 18:20 UTC, gatekeeper
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description gatekeeper 2024-07-17 23:26:20 UTC
Created attachment 252133 [details]
git patch

I propose to add to the ports tree the "pattern" script that can be used to generate search patterns, which is generally used for security research purposes.
Comment 1 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-25 14:38:12 UTC
Where is WWW?
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-25 15:03:05 UTC
Why do you need "STRIP="?
Comment 3 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-25 15:05:30 UTC
distinfo have duplicate lines.

MASTER_SITES=	https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/master/
Comment 4 gatekeeper 2024-07-25 16:04:16 UTC
Created attachment 252277 [details]
git patch

Added WWW
Fixed the distinfo file

I need STRIP= otherwise, if I remove that line, I get the following error:

strip: file format not recognized
strip: file format not recognized
install: strip command strip failed on /root/work/ports_2/security/pattern/work/stage/usr/local/bin/INS@l3vybt
*** Error code 70

Is there any other way to fix this error without STRIP= ?
Comment 5 gatekeeper 2024-07-25 16:05:17 UTC
(In reply to gatekeeper from comment #4)

Fixed MASTER_SITES also in the previous patch from comment #4
Comment 6 gatekeeper 2024-07-25 16:08:08 UTC
Created attachment 252278 [details]
git patch

and now use ${GH_ACCOUNT}/${GH_PROJECT} in the WWW variable
Comment 7 gatekeeper 2024-07-25 16:12:15 UTC
Created attachment 252280 [details]
git patch

use ${INSTALL_SCRIPT} instead of ${INSTALL_PROGRAM}
Comment 8 gatekeeper 2024-07-25 16:16:21 UTC
Created attachment 252281 [details]
git patch

remove STRIP= 
using INSTALL_SCRIPT instead of INSTALL_PROGRAM does not generate the error message anymore...
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-25 16:16:59 UTC
https://github.com/Svenito/exploit-pattern/blob/master/requirements.txt:
clipboard==0.0.4

https://github.com/Svenito/exploit-pattern/blob/master/pattern.py#L6:
import clipboard

Maybe we need add dependency from this "clipboard" module? What is it?
Comment 10 gatekeeper 2024-07-25 16:23:46 UTC
(In reply to Vladimir Druzenko from comment #9)

The clipboard is not really necessary. If this optional module is available, when generating a pattern, it gets also automatically copy-pasted into the clipboard.

As far as I have seen, we do not (yet) have a py-clipboard port.
So, I guess that if I add this as an option, I would also have to add the corresponding py-clipboard port?
Comment 11 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-25 16:27:44 UTC
(In reply to gatekeeper from comment #10)
Ye.
Comment 12 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-25 17:41:50 UTC
If no versions or tags use commit date as version:
DISTVERSION=    g20230527

Why portname pattern, but not exploit-pattern?

You don't need:
MASTER_SITES=	https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/master/
if use:
USE_GITHUB=     yes
GH_ACCOUNT=     Svenito
GH_PROJECT=     exploit-pattern
GH_TAGNAME=     59bb0c5
Comment 13 Vladimir Druzenko freebsd_committer freebsd_triage 2024-07-25 17:49:32 UTC
If PORTNAME=exploit-pattern then you can remove:
GH_PROJECT=     exploit-pattern
Comment 14 gatekeeper 2024-07-25 18:20:27 UTC
Created attachment 252284 [details]
git patch

changed accordingly
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-07-25 18:23:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2f3f70a3621c503f5e521c732205a713640ec5b0

commit 2f3f70a3621c503f5e521c732205a713640ec5b0
Author:     gatekeeper <tiago.gasiba@gmail.com>
AuthorDate: 2024-07-25 18:20:51 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-07-25 18:20:51 +0000

    security/exploit-pattern: new port: Python Exploit Pattern Tool

    Python implementation of Metasploit's pattern generator and search.
    Should be python version agnostic, tested and working with Python
    2.7.12 up to and including Python 3.11.1
    Starts faster and rolls both tools into one.
    No extra dependencies required, works with vanilla python
    https://github.com/Svenito/exploit-pattern

    PR:     280341

 security/Makefile                        |  1 +
 security/exploit-pattern/Makefile (new)  | 27 +++++++++++++++++++++++++++
 security/exploit-pattern/distinfo (new)  |  3 +++
 security/exploit-pattern/pkg-descr (new) |  7 +++++++
 4 files changed, 38 insertions(+)