Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nmap to latest version #104

Merged
merged 8 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:22.04 AS base

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y software-properties-common \
Expand All @@ -11,8 +11,7 @@ RUN apt-get update && apt-get install -y build-essential \
python3-pip \
wireguard \
iproute2 \
openresolv \
nmap
openresolv

RUN python3.11 -m pip install --upgrade pip
COPY requirement.txt /requirement.txt
Expand All @@ -22,4 +21,33 @@ ENV PYTHONPATH=/app
COPY agent /app/agent
COPY ostorlab.yaml /app/agent/ostorlab.yaml
WORKDIR /app

FROM base AS builder

WORKDIR /tmp

ARG NMAP_VERSION=7.95

RUN apt-get update && apt-get install -y \
wget \
automake \
python3-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN python3 -m pip install build

RUN wget https://nmap.org/dist/nmap-${NMAP_VERSION}.tar.bz2 \
&& tar jxvf nmap-${NMAP_VERSION}.tar.bz2 \
&& cd /tmp/nmap-${NMAP_VERSION} \
&& ./configure \
&& make \
&& sudo make install \
&& cd / \
&& rm -rf /tmp/nmap-$(NMAP_VERSION)

FROM base

3asm marked this conversation as resolved.
Show resolved Hide resolved
COPY --from=builder /usr/local /usr/local

CMD ["python3.11", "/app/agent/nmap_agent.py"]
2 changes: 1 addition & 1 deletion ostorlab.yaml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind: Agent
name: nmap
version: 1.2.0
version: 1.2.1
image: images/logo.png
description: |
This repository is an implementation of [Ostorlab Agent](https://pypi.org/project/ostorlab/) for the [Nmap Scanner](https://github.com/projectdiscovery/nmap) by Project Discovery.
Expand Down
Loading