{"action":"created","issue":{"url":"https://api.github.com/repos/nmap/nmap/issues/447","repository_url":"https://api.github.com/repos/nmap/nmap","labels_url":"https://api.github.com/repos/nmap/nmap/issues/447/labels{/name}","comments_url":"https://api.github.com/repos/nmap/nmap/issues/447/comments","events_url":"https://api.github.com/repos/nmap/nmap/issues/447/events","html_url":"https://github.com/nmap/nmap/issues/447","id":163854101,"number":447,"title":"Make --top-ports and -p a union instead of an intersection","user":{"login":"dmiller-nmap","id":10443029,"avatar_url":"https://avatars.githubusercontent.com/u/10443029?v=3","gravatar_id":"","url":"https://api.github.com/users/dmiller-nmap","html_url":"https://github.com/dmiller-nmap","followers_url":"https://api.github.com/users/dmiller-nmap/followers","following_url":"https://api.github.com/users/dmiller-nmap/following{/other_user}","gists_url":"https://api.github.com/users/dmiller-nmap/gists{/gist_id}","starred_url":"https://api.github.com/users/dmiller-nmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmiller-nmap/subscriptions","organizations_url":"https://api.github.com/users/dmiller-nmap/orgs","repos_url":"https://api.github.com/users/dmiller-nmap/repos","events_url":"https://api.github.com/users/dmiller-nmap/events{/privacy}","received_events_url":"https://api.github.com/users/dmiller-nmap/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nmap/nmap/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/nmap/nmap/labels/Nmap","name":"Nmap","color":"5319e7"},{"url":"https://api.github.com/repos/nmap/nmap/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-05T13:44:13Z","updated_at":"2016-07-23T22:28:51Z","closed_at":null,"body":"Currently, `--top-ports` selects the most popular ports from the `nmap-services` file or from the list of ports given on the command line. If any of the ports given on the command line are not listed in the `nmap-services` file, they will not be scanned. This seems like a very unusual interaction and not one that users are probably relying on. The only useful combination of these was probably [my hacky Perl script](http://seclists.org/nmap-dev/2012/q2/159) to approximate the `--exclude-ports` option before that was added two years ago. Of course, because I missed the part about not scanning ports that are not in the file, it doesn't even work as advertised.\r\n\r\nI propose that `--top-ports` and `-p` should be allowed to *add* to each other, so that all the ports specified in `-p` will be scanned in addition to all of the ports that would usually be scanned with the `--top-ports` option chosen.\r\n\r\nSome examples:\r\n\r\n* `--top-ports 10 -p 12354`\r\n    * currently scans: nothing, scan phase skipped.\r\n    * proposed: 21-23,25,80,110,139,443,445,3389,12354 (11 ports)\r\n* `--top-ports 10 -p 21,22,23`\r\n    * currently scans: 21-23\r\n    * proposed: 21-23,25,80,110,139,443,445,3389 (10 ports)\r\n\r\nAn alternative implementation would be to scan the *n* `--top-ports` left after the `-p` ports have been chosen. This would make the number of scanned ports more predictable, but I don't favor it. The first example would be unchanged, and the second would scan 13 ports: 21-23,25,53,80,110,135,139,143,443,445,3389."},"comment":{"url":"https://api.github.com/repos/nmap/nmap/issues/comments/234744265","html_url":"https://github.com/nmap/nmap/issues/447#issuecomment-234744265","issue_url":"https://api.github.com/repos/nmap/nmap/issues/447","id":234744265,"user":{"login":"djcater","id":856675,"avatar_url":"https://avatars.githubusercontent.com/u/856675?v=3","gravatar_id":"","url":"https://api.github.com/users/djcater","html_url":"https://github.com/djcater","followers_url":"https://api.github.com/users/djcater/followers","following_url":"https://api.github.com/users/djcater/following{/other_user}","gists_url":"https://api.github.com/users/djcater/gists{/gist_id}","starred_url":"https://api.github.com/users/djcater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djcater/subscriptions","organizations_url":"https://api.github.com/users/djcater/orgs","repos_url":"https://api.github.com/users/djcater/repos","events_url":"https://api.github.com/users/djcater/events{/privacy}","received_events_url":"https://api.github.com/users/djcater/received_events","type":"User","site_admin":false},"created_at":"2016-07-23T22:28:51Z","updated_at":"2016-07-23T22:28:51Z","body":"I have often wanted to do what your first proposal suggests: scan for common ports and a handful of specific ones. E.g. top 1000 TCP plus a couple of non-standard ports that I know are likely to be open on the target based on a company policy for example (like moving SSH to a particular port). --top-ports=1000 -pXXXXX,YYYYY is what would be intuitive to me, without caring much whether the custom ports are already in that top 1000 or not.\r\n\r\nHaving protocol modifiers for top ports would also be useful as mentioned above (--top-ports=T:1000,U:20). In both cases, I think a union is more intuitive than an intersection."}}
{"actor":{"display_login":"djcater"}}