{"action":"closed","number":540,"pull_request":{"url":"https://api.github.com/repos/nmap/nmap/pulls/540","id":84036843,"html_url":"https://github.com/nmap/nmap/pull/540","diff_url":"https://github.com/nmap/nmap/pull/540.diff","patch_url":"https://github.com/nmap/nmap/pull/540.patch","issue_url":"https://api.github.com/repos/nmap/nmap/issues/540","number":540,"state":"closed","locked":false,"title":"Add tls.servername script-arg for TLS SNI without DNS","user":{"login":"bbc2","id":1645335,"avatar_url":"https://avatars.githubusercontent.com/u/1645335?v=3","gravatar_id":"","url":"https://api.github.com/users/bbc2","html_url":"https://github.com/bbc2","followers_url":"https://api.github.com/users/bbc2/followers","following_url":"https://api.github.com/users/bbc2/following{/other_user}","gists_url":"https://api.github.com/users/bbc2/gists{/gist_id}","starred_url":"https://api.github.com/users/bbc2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbc2/subscriptions","organizations_url":"https://api.github.com/users/bbc2/orgs","repos_url":"https://api.github.com/users/bbc2/repos","events_url":"https://api.github.com/users/bbc2/events{/privacy}","received_events_url":"https://api.github.com/users/bbc2/received_events","type":"User","site_admin":false},"body":"As explained in http://seclists.org/nmap-dev/2016/q1/46, when the DNS cannot be used, or for testing purposes, it can be useful to force the TLS server name indicated by Nmap.  This pull request should thus address #276.\n\nExamples of how this is achieved:\n\n``` bash\nnmap --script ssl-cert --script-args=tls.servername=example.net 192.0.2.1\nnmap --script ssl-cert --script-args=tls.servername=example.net example.org\nnmap --script ssl-enum-ciphers --script-args=tls.servername=example.net example.org\n```\n\nThe script-arg has precedence over `host.targetname` and there is no support for supplying multiple servernames to be attempted.  It basically behaves the same as\n\n``` bash\nopenssl s_client -servername <tls.servername> -connect example.net:<port> <host.targetname>\n```\n\nThe script argument is supported by all scripts already benefiting from Nmap's existing TLS SNI support.  Those using the `tls.lua` library were easy to adapt because of the modularity of that library.  By the way, I think this reduced the complexity of `ssl-enum-ciphers.nse`. Those relying on `sslcert.getCertificate` were adapted with just:\n\n``` lua\nhost.targetname = tls.servername(host)\n```\n\nThe reason is that `sslcert.getCertificate` uses Nmap's nsock implementation of TLS with OpenSSL, which would have been trickier to modify.\n\nMy main use case is building a script that scans the right IP address of a host even if the DNS of that host rotates, which is a common way of performing load-balancing.  It is about to be used (merged into Nmap or not) by https://discovery.cryptosense.com.\n\nI hope this is useful!\n","created_at":"2016-09-05T20:13:10Z","updated_at":"2016-12-05T18:37:15Z","closed_at":"2016-12-05T18:37:15Z","merged_at":null,"merge_commit_sha":"d87ea6c1fc1247a9e52c4b2a7c3f66aeec904f14","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nmap/nmap/pulls/540/commits","review_comments_url":"https://api.github.com/repos/nmap/nmap/pulls/540/comments","review_comment_url":"https://api.github.com/repos/nmap/nmap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nmap/nmap/issues/540/comments","statuses_url":"https://api.github.com/repos/nmap/nmap/statuses/913b4f48bb79d968f41ae983830290ab6fb637b1","head":{"label":"bbc2:tls-servername-arg","ref":"tls-servername-arg","sha":"913b4f48bb79d968f41ae983830290ab6fb637b1","user":{"login":"bbc2","id":1645335,"avatar_url":"https://avatars.githubusercontent.com/u/1645335?v=3","gravatar_id":"","url":"https://api.github.com/users/bbc2","html_url":"https://github.com/bbc2","followers_url":"https://api.github.com/users/bbc2/followers","following_url":"https://api.github.com/users/bbc2/following{/other_user}","gists_url":"https://api.github.com/users/bbc2/gists{/gist_id}","starred_url":"https://api.github.com/users/bbc2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbc2/subscriptions","organizations_url":"https://api.github.com/users/bbc2/orgs","repos_url":"https://api.github.com/users/bbc2/repos","events_url":"https://api.github.com/users/bbc2/events{/privacy}","received_events_url":"https://api.github.com/users/bbc2/received_events","type":"User","site_admin":false},"repo":{"id":50788941,"name":"nmap","full_name":"bbc2/nmap","owner":{"login":"bbc2","id":1645335,"avatar_url":"https://avatars.githubusercontent.com/u/1645335?v=3","gravatar_id":"","url":"https://api.github.com/users/bbc2","html_url":"https://github.com/bbc2","followers_url":"https://api.github.com/users/bbc2/followers","following_url":"https://api.github.com/users/bbc2/following{/other_user}","gists_url":"https://api.github.com/users/bbc2/gists{/gist_id}","starred_url":"https://api.github.com/users/bbc2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbc2/subscriptions","organizations_url":"https://api.github.com/users/bbc2/orgs","repos_url":"https://api.github.com/users/bbc2/repos","events_url":"https://api.github.com/users/bbc2/events{/privacy}","received_events_url":"https://api.github.com/users/bbc2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bbc2/nmap","description":"Nmap - the Network Mapper. Github mirror of official SVN repository.","fork":true,"url":"https://api.github.com/repos/bbc2/nmap","forks_url":"https://api.github.com/repos/bbc2/nmap/forks","keys_url":"https://api.github.com/repos/bbc2/nmap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbc2/nmap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbc2/nmap/teams","hooks_url":"https://api.github.com/repos/bbc2/nmap/hooks","issue_events_url":"https://api.github.com/repos/bbc2/nmap/issues/events{/number}","events_url":"https://api.github.com/repos/bbc2/nmap/events","assignees_url":"https://api.github.com/repos/bbc2/nmap/assignees{/user}","branches_url":"https://api.github.com/repos/bbc2/nmap/branches{/branch}","tags_url":"https://api.github.com/repos/bbc2/nmap/tags","blobs_url":"https://api.github.com/repos/bbc2/nmap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbc2/nmap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbc2/nmap/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbc2/nmap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbc2/nmap/statuses/{sha}","languages_url":"https://api.github.com/repos/bbc2/nmap/languages","stargazers_url":"https://api.github.com/repos/bbc2/nmap/stargazers","contributors_url":"https://api.github.com/repos/bbc2/nmap/contributors","subscribers_url":"https://api.github.com/repos/bbc2/nmap/subscribers","subscription_url":"https://api.github.com/repos/bbc2/nmap/subscription","commits_url":"https://api.github.com/repos/bbc2/nmap/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbc2/nmap/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbc2/nmap/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbc2/nmap/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbc2/nmap/contents/{+path}","compare_url":"https://api.github.com/repos/bbc2/nmap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbc2/nmap/merges","archive_url":"https://api.github.com/repos/bbc2/nmap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbc2/nmap/downloads","issues_url":"https://api.github.com/repos/bbc2/nmap/issues{/number}","pulls_url":"https://api.github.com/repos/bbc2/nmap/pulls{/number}","milestones_url":"https://api.github.com/repos/bbc2/nmap/milestones{/number}","notifications_url":"https://api.github.com/repos/bbc2/nmap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbc2/nmap/labels{/name}","releases_url":"https://api.github.com/repos/bbc2/nmap/releases{/id}","deployments_url":"https://api.github.com/repos/bbc2/nmap/deployments","created_at":"2016-01-31T18:38:28Z","updated_at":"2016-01-31T18:38:36Z","pushed_at":"2016-09-05T19:43:59Z","git_url":"git://github.com/bbc2/nmap.git","ssh_url":"git@github.com:bbc2/nmap.git","clone_url":"https://github.com/bbc2/nmap.git","svn_url":"https://github.com/bbc2/nmap","homepage":"https://svn.nmap.org/","size":74432,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nmap:master","ref":"master","sha":"40c00db51bb3223a193613f2a9d51f200923c76f","user":{"login":"nmap","id":63385,"avatar_url":"https://avatars.githubusercontent.com/u/63385?v=3","gravatar_id":"","url":"https://api.github.com/users/nmap","html_url":"https://github.com/nmap","followers_url":"https://api.github.com/users/nmap/followers","following_url":"https://api.github.com/users/nmap/following{/other_user}","gists_url":"https://api.github.com/users/nmap/gists{/gist_id}","starred_url":"https://api.github.com/users/nmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmap/subscriptions","organizations_url":"https://api.github.com/users/nmap/orgs","repos_url":"https://api.github.com/users/nmap/repos","events_url":"https://api.github.com/users/nmap/events{/privacy}","received_events_url":"https://api.github.com/users/nmap/received_events","type":"Organization","site_admin":false},"repo":{"id":3671479,"name":"nmap","full_name":"nmap/nmap","owner":{"login":"nmap","id":63385,"avatar_url":"https://avatars.githubusercontent.com/u/63385?v=3","gravatar_id":"","url":"https://api.github.com/users/nmap","html_url":"https://github.com/nmap","followers_url":"https://api.github.com/users/nmap/followers","following_url":"https://api.github.com/users/nmap/following{/other_user}","gists_url":"https://api.github.com/users/nmap/gists{/gist_id}","starred_url":"https://api.github.com/users/nmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmap/subscriptions","organizations_url":"https://api.github.com/users/nmap/orgs","repos_url":"https://api.github.com/users/nmap/repos","events_url":"https://api.github.com/users/nmap/events{/privacy}","received_events_url":"https://api.github.com/users/nmap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nmap/nmap","description":"Nmap - the Network Mapper. Github mirror of official SVN repository.","fork":false,"url":"https://api.github.com/repos/nmap/nmap","forks_url":"https://api.github.com/repos/nmap/nmap/forks","keys_url":"https://api.github.com/repos/nmap/nmap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmap/nmap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmap/nmap/teams","hooks_url":"https://api.github.com/repos/nmap/nmap/hooks","issue_events_url":"https://api.github.com/repos/nmap/nmap/issues/events{/number}","events_url":"https://api.github.com/repos/nmap/nmap/events","assignees_url":"https://api.github.com/repos/nmap/nmap/assignees{/user}","branches_url":"https://api.github.com/repos/nmap/nmap/branches{/branch}","tags_url":"https://api.github.com/repos/nmap/nmap/tags","blobs_url":"https://api.github.com/repos/nmap/nmap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmap/nmap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmap/nmap/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmap/nmap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmap/nmap/statuses/{sha}","languages_url":"https://api.github.com/repos/nmap/nmap/languages","stargazers_url":"https://api.github.com/repos/nmap/nmap/stargazers","contributors_url":"https://api.github.com/repos/nmap/nmap/contributors","subscribers_url":"https://api.github.com/repos/nmap/nmap/subscribers","subscription_url":"https://api.github.com/repos/nmap/nmap/subscription","commits_url":"https://api.github.com/repos/nmap/nmap/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmap/nmap/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmap/nmap/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmap/nmap/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmap/nmap/contents/{+path}","compare_url":"https://api.github.com/repos/nmap/nmap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmap/nmap/merges","archive_url":"https://api.github.com/repos/nmap/nmap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmap/nmap/downloads","issues_url":"https://api.github.com/repos/nmap/nmap/issues{/number}","pulls_url":"https://api.github.com/repos/nmap/nmap/pulls{/number}","milestones_url":"https://api.github.com/repos/nmap/nmap/milestones{/number}","notifications_url":"https://api.github.com/repos/nmap/nmap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmap/nmap/labels{/name}","releases_url":"https://api.github.com/repos/nmap/nmap/releases{/id}","deployments_url":"https://api.github.com/repos/nmap/nmap/deployments","created_at":"2012-03-09T14:47:43Z","updated_at":"2016-12-05T15:08:43Z","pushed_at":"2016-12-05T18:37:11Z","git_url":"git://github.com/nmap/nmap.git","ssh_url":"git@github.com:nmap/nmap.git","clone_url":"https://github.com/nmap/nmap.git","svn_url":"https://github.com/nmap/nmap","homepage":"https://svn.nmap.org/","size":166217,"stargazers_count":851,"watchers_count":851,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":366,"mirror_url":null,"open_issues_count":202,"forks":366,"open_issues":202,"watchers":851,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nmap/nmap/pulls/540"},"html":{"href":"https://github.com/nmap/nmap/pull/540"},"issue":{"href":"https://api.github.com/repos/nmap/nmap/issues/540"},"comments":{"href":"https://api.github.com/repos/nmap/nmap/issues/540/comments"},"review_comments":{"href":"https://api.github.com/repos/nmap/nmap/pulls/540/comments"},"review_comment":{"href":"https://api.github.com/repos/nmap/nmap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nmap/nmap/pulls/540/commits"},"statuses":{"href":"https://api.github.com/repos/nmap/nmap/statuses/913b4f48bb79d968f41ae983830290ab6fb637b1"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":62,"deletions":56,"changed_files":7}}
{"actor":{"display_login":"nmap-bot"}}