LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   nmap (https://www.linuxquestions.org/questions/linux-general-1/nmap-86439/)

psyklops 08-27-2003 08:49 PM

nmap
 
Id like to run -sS without being su. Is this a matter of file permissions? How would I go about doing this?

trickykid 08-27-2003 08:55 PM

Probably best to setup sudo but I think this is actually built in to it.

shellcode 08-27-2003 09:37 PM

TCP Syn means that nmap has to use generate raw sockets. the only user who has access to the raw socket interface is root. thus you need root.

raw sockets:
Code:

int sockfd;
sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);

as an example with ICMP.

psyklops 08-27-2003 09:44 PM

[psyklops@MoBAP dl]$ sudo nmap -sS -p1-100 localhost.localdomain
sudo nmap -sS -p1-100 localhost.localdomain
Password:
psyklops is not in the sudoers file. This incident will be reported.
[psyklops@MoBAP dl]$

Im alittle confused on the format to allow me to run -sS without su'ing though. I cant make heads or tails of the sudoers man. Has anyone set up an sudoers files before. If so what would be the correct syntax?

psyklops 08-27-2003 10:44 PM

Heres a copy of my sudoers file in case anyone else gets stuck. I had problems with the format even though its pretty straight forward. : P




sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
psyklops MoBAP=/usr/bin/nmap


All times are GMT -5. The time now is 04:06 AM.