Nmap "operation not permitted" error

559

Solution 1

Maybe your container has a venet interface, which has security restrictions. You need to use veth interfaces to send broadcasts and other nonstandard packets. See Differences between venet and veth.

Solution 2

I know this question is old, but I've been running into this problem on Debian 8 and CentOS 7 and couldn't find an answer (this is a top search result). TCP and segmentation offloading looks to have been the problem, and you can disable it by installing "ethtool" and running:

ethtool -K  eth0  rx off  tx off gso off tso off

Might be worth reviewing what options have changed with this command:

ethtool --show-offload  eth0

Any features you see there can be enabled/disabled by specifying them as an acronym (e.g. "generic-segmentation-offload" = "gso"). These are turned on for a reason, so you'll want to read up on what they do.

And here's a CentOS specific reboot-persistent answer.

Edit: Since invalid and malformed packet protection is built into the kernel, one also needs to allow outbound invalid packets since Nmap uses fun techniques to scan:

iptables -I OUTPUT -m state --state INVALID -j ACCEPT

Share:
559

Related videos on Youtube

Henk1987
Author by

Henk1987

Updated on September 17, 2022

Comments

  • Henk1987
    Henk1987 over 1 year

    Thanks everyone, I edited the question.

    I get the following error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 35

    DELIMITER $$
    CREATE FUNCTION `distance`(Q_LAT FLOAT, Q_LONG FLOAT, NAV_LAT FLOAT, NAV_LONG FLOAT)  RETURNS float
    BEGIN
    DECLARE radlat1 FLOAT;
    DECLARE radlat2 FLOAT;
    DECLARE radlon1 FLOAT;
    DECLARE radlon2 FLOAT;
    DECLARE theta FLOAT;
    DECLARE radtheta FLOAT;
    DECLARE dist FLOAT;
    DECLARE PI FLOAT;
    
    SET PI = PI();
    SET dist = 0;
    
    IF ((Q_LAT IS NULL OR Q_LAT = 0) OR (Q_LONG IS NULL OR Q_LONG = 0)
        OR (NAV_LAT IS NULL OR NAV_LAT = 0) OR (NAV_LONG IS NULL OR NAV_LONG = 0)) THEN
        RETURN dist;
    ELSE
        SET radlat1 = PI * (Q_LAT/180);
        SET radlat2 = PI * (NAV_LAT/180);
        SET radlon1 = PI * (Q_LONG/180);
        SET radlon2 = PI * (NAV_LONG/180);
        SET theta = Q_LONG-NAV_LONG;
        SET radtheta = PI * (theta/180);
        SET dist = SIN(radlat1) * SIN(radlat2) + COS(radlat1) * COS(radlat2) * COS(radtheta);
        SET dist = ACOS(dist);
        SET dist = dist * (180/PI);
        SET dist = dist * 60 * 1.1515;
        SET dist = dist * 1.609344;
    
        SET dist = CEILING(dist);
    
    RETURN dist;
    END IF;
    END$$
    
  • a--
    a-- over 13 years
    Yeah, I am using a venet interface. Unfortunately, I can't control this. Do you know of any "simpler" port scanners that will still be able to function correctly?