From d82a0e1f49a58c5c82f6d919eda3f4ef3ed8175e Mon Sep 17 00:00:00 2001 From: Mika Suomalainen Date: Sat, 20 Aug 2011 19:57:25 +0300 Subject: [PATCH] bash_aliases: aliases for nmap now ask for sudo password if the scan requires root If something requires root, alias will run "sudo command" instead of that command. Running only command will only say "This must be run as root." But there is one expection. Nmap-traceroute doesn't require root, but it will say "traceroute requires root, cancelling" and tells that the host is up (or down depending on it). I added sudo for it, because we usually want to see traceroute if we want traceroute. This is the longest commit message which I have ever written. Maybe I will write longer someday... --- bash_aliases | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bash_aliases b/bash_aliases index fdc43757..695f8adf 100644 --- a/bash_aliases +++ b/bash_aliases @@ -26,14 +26,14 @@ alias nautilus="nautilus ./" # Why I must write "weechat-curses" to start it? alias weechat="weechat-curses" -#NMAP specific. WARNING: Some things might require root. Note: these are same things as those in Zenmap by default. Do I even need to mention that these require nmap? ;) +#NMAP specific. All nmap things should be run as root, so it's probably best to copy these aliases to root's .bashrcs. Things which don't run without root ask for sudo password. alias nmap-intense="nmap -T4 -A -v -PE -PS22,25,80 -PA21,23,80,3389 " -alias nmap-intense-udp="nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,3389 " +alias nmap-intense-udp="sudo nmap -sS -sU -T4 -A -v -PE -PS22,25,80 -PA21,23,80,3389 " alias nmap-intense-all-tcp="nmap -p 1-65535 -T4 -A -v -PE -PS22,25,80 -PA21,23,80,3389 " alias nmap-intense-no-ping="nmap -T4 -A -v -PN " alias nmap-ping="nmap -sP -PE -PA21,23,80,3389 " alias nmap-quick="nmap -T4 -F " -alias nmap-quick-plus="nmap -sV -T4 -O -F --version-light " -alias nmap-traceroute="nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute " +alias nmap-quick-plus="sudo nmap -sV -T4 -O -F --version-light " +alias nmap-traceroute="sudo nmap -sP -PE -PS22,25,80 -PA21,23,80,3389 -PU -PO --traceroute " alias nmap-regular="nmap " -alias nmap-comprehensive="nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all " +alias nmap-comprehensive="sudo nmap -sS -sU -T4 -A -v -PE -PP -PS21,22,23,25,80,113,31339 -PA80,113,443,10042 -PO --script all "