mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Added an error message when the user runs nping in a priviliged mode and specifies a port. I choose to add an error message to keep nping's behavior inline withnmaps.
This commit is contained in:
parent
85768b98a0
commit
a9a6c431cd
1 changed files with 9 additions and 0 deletions
|
|
@ -163,6 +163,15 @@ int main(int argc, char *argv[] ){
|
|||
outFatal(QT_3,"Unable to properly format time");
|
||||
outPrint(QT_1, "\nStarting %s %s ( %s ) at %s", NPING_NAME, NPING_VERSION, NPING_URL, tbuf);
|
||||
|
||||
/*If nping is called on something that doesn't take port scanning
|
||||
* we should alert the user that their port command is going to be ignored
|
||||
* I choose to print out a Fatal error since the scan doesn't make sense.
|
||||
*/
|
||||
if(o.isRoot() && o.issetTargetPorts() && (o.getMode() != TCP || o.getMode() != UDP))
|
||||
outFatal(QT_3, "You cannot use -p (explicit port selection) in your current scan mode.\n(Perhaps you meant to use --tcp or --udp");
|
||||
|
||||
|
||||
|
||||
/* Resolve and cache target specs */
|
||||
outPrint(DBG_2,"Resolving specified targets...");
|
||||
o.targets.processSpecs();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue