Skip to content

Adding host discovery#346

Merged
ehsandeep merged 15 commits intodevfrom
issue-332-hosts-discovery
Jun 25, 2022
Merged

Adding host discovery#346
ehsandeep merged 15 commits intodevfrom
issue-332-hosts-discovery

Conversation

@Mzack9999
Copy link
Copy Markdown
Member

@Mzack9999 Mzack9999 commented Jun 5, 2022

Description

This PR implements various hosts discovery techniques:

Notes

  • Define if host discovery should just list discovered hosts and/or use them for subsequent ports scanning?

- icmp ech
- icmp timestamp
@Mzack9999 Mzack9999 added the Type: Enhancement Most issues will probably ask for additions or changes. label Jun 5, 2022
@Mzack9999 Mzack9999 self-assigned this Jun 5, 2022
@Mzack9999 Mzack9999 added the Status: In Progress This issue is being worked on, and has someone assigned. label Jun 5, 2022
@Mzack9999 Mzack9999 linked an issue Jun 5, 2022 that may be closed by this pull request
@Mzack9999 Mzack9999 added Status: On Hold Similar to blocked, but is assigned to someone Type: Discussion Some ideas need to be planned and disucssed to come to a strategy. and removed Status: In Progress This issue is being worked on, and has someone assigned. labels Jun 12, 2022
@ehsandeep ehsandeep linked an issue Jun 14, 2022 that may be closed by this pull request
@ehsandeep
Copy link
Copy Markdown
Member

ehsandeep commented Jun 14, 2022

Define if host discovery should just list discovered hosts and/or use them for subsequent ports scanning?

  • By default, we can keep host discovery and port scanning independent and optional.
  • If host discovery (sn) flag is used without specifying any available methods, we can automatically use best known methods for discovery, otherwise specified method will be used.
  • If host discovery (sn) flag is used withp flag, port scan will be performed on discovered hosts. Host Discovery + Port Scanning automation #361
  • for the cases when sn flag is not used, the current behavior will remain same, i.e performing syn/connect-based port scan.

@Mzack9999 ^

@ehsandeep ehsandeep added Status: In Progress This issue is being worked on, and has someone assigned. and removed Status: On Hold Similar to blocked, but is assigned to someone Type: Discussion Some ideas need to be planned and disucssed to come to a strategy. labels Jun 14, 2022
@Mzack9999
Copy link
Copy Markdown
Member Author

Mzack9999 commented Jun 17, 2022

  • If host discovery (sn) flag is used with the p flag, port scan will be performed on discovered hosts.

This can't be implemented as is since the -p CLI argument is not a boolean flag but a string one and requires a value different from "", otherwise the CLI help would be shown:

$ echo 192.168.1.1 | go run . -p
flag needs an argument: -p

This should be handled in a follow-up ticket @ehsandeep (#361)

@Mzack9999 Mzack9999 added Status: On Hold Similar to blocked, but is assigned to someone and removed Status: In Progress This issue is being worked on, and has someone assigned. labels Jun 17, 2022
@Mzack9999 Mzack9999 requested a review from ehsandeep June 17, 2022 13:36
@Mzack9999 Mzack9999 removed the Status: On Hold Similar to blocked, but is assigned to someone label Jun 17, 2022
@Mzack9999 Mzack9999 added the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Jun 17, 2022
Copy link
Copy Markdown
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Validation check / error for user permission as host discovery requires sudo

Copy link
Copy Markdown
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time echo 173.0.84.0/24 | sudo ./naabu -sn -silent

173.0.84.24
173.0.84.53
173.0.84.182
173.0.84.51
173.0.84.131
173.0.84.152
173.0.84.13
173.0.84.27
173.0.84.63
173.0.84.85
173.0.84.102
173.0.84.138
173.0.84.175
173.0.84.205
173.0.84.207
173.0.84.255
173.0.84.46
173.0.84.74
173.0.84.232
173.0.84.246
173.0.84.12
173.0.84.48
173.0.84.54
173.0.84.92
173.0.84.142
173.0.84.243
173.0.84.5
173.0.84.141
173.0.84.2
173.0.84.86
173.0.84.136
173.0.84.181
173.0.84.221
173.0.84.22
173.0.84.28
173.0.84.34
173.0.84.147
173.0.84.195
173.0.84.154
173.0.84.6
173.0.84.99
173.0.84.130
173.0.84.77
173.0.84.110
173.0.84.191
173.0.84.202
173.0.84.59
173.0.84.120
173.0.84.183
173.0.84.193
173.0.84.200
173.0.84.4
173.0.84.26
173.0.84.68
173.0.84.107
173.0.84.124
173.0.84.140
173.0.84.155
173.0.84.238
173.0.84.247
173.0.84.87
173.0.84.149
173.0.84.253
173.0.84.58
173.0.84.70
173.0.84.96
173.0.84.112
173.0.84.245
173.0.84.57
173.0.84.95
173.0.84.163
173.0.84.227
173.0.84.7
173.0.84.150
173.0.84.204
173.0.84.79
173.0.84.116
173.0.84.178
173.0.84.249
173.0.84.55
173.0.84.121
173.0.84.160
173.0.84.49
173.0.84.94
173.0.84.159
173.0.84.39
173.0.84.84
173.0.84.93
173.0.84.144
173.0.84.153
173.0.84.44
173.0.84.76
173.0.84.143
173.0.84.187
173.0.84.21
173.0.84.89
173.0.84.134
173.0.84.162
173.0.84.186
173.0.84.10
173.0.84.37
173.0.84.61
173.0.84.64
173.0.84.111
173.0.84.190
173.0.84.225
173.0.84.50
173.0.84.132
173.0.84.164
173.0.84.173
173.0.84.197
173.0.84.216
173.0.84.254
173.0.84.15
173.0.84.83
173.0.84.213
173.0.84.31
173.0.84.67
173.0.84.117
173.0.84.146
173.0.84.189
173.0.84.42
173.0.84.56
173.0.84.101
173.0.84.108
173.0.84.237
173.0.84.239
173.0.84.90
173.0.84.199
173.0.84.210
173.0.84.219
173.0.84.128
173.0.84.198
173.0.84.251
173.0.84.240
173.0.84.229
173.0.84.233
173.0.84.14
173.0.84.18
173.0.84.19
173.0.84.52
173.0.84.66
173.0.84.71
173.0.84.165
173.0.84.215
173.0.84.47
173.0.84.185
173.0.84.1
173.0.84.40
173.0.84.72
173.0.84.103
173.0.84.188
173.0.84.194
173.0.84.206
173.0.84.36
173.0.84.88
173.0.84.228
173.0.84.231
173.0.84.38
173.0.84.109
173.0.84.209
173.0.84.73
173.0.84.168
173.0.84.214
173.0.84.230
173.0.84.45
173.0.84.145
173.0.84.148
173.0.84.211
173.0.84.97
173.0.84.127
173.0.84.179
173.0.84.212
173.0.84.156
173.0.84.241
173.0.84.119
173.0.84.170
173.0.84.176
173.0.84.75
173.0.84.98
173.0.84.220
173.0.84.20
173.0.84.33
173.0.84.100
173.0.84.161
173.0.84.69
173.0.84.135
173.0.84.177
173.0.84.11
173.0.84.78
173.0.84.106
173.0.84.122
173.0.84.244
173.0.84.8
173.0.84.43
173.0.84.81
173.0.84.252
173.0.84.3
173.0.84.129
173.0.84.250
173.0.84.29
173.0.84.41
173.0.84.196
173.0.84.217
173.0.84.30
173.0.84.62
173.0.84.91
173.0.84.167
173.0.84.172
173.0.84.192
173.0.84.223
173.0.84.151
173.0.84.169
173.0.84.137
173.0.84.208
173.0.84.224
173.0.84.125
173.0.84.171
173.0.84.201
173.0.84.0
173.0.84.32
173.0.84.60
173.0.84.80
173.0.84.114
173.0.84.123
173.0.84.218
173.0.84.242
173.0.84.133
173.0.84.248
173.0.84.35
173.0.84.65
173.0.84.126
173.0.84.23
173.0.84.115
173.0.84.158
173.0.84.166
173.0.84.184
173.0.84.17
173.0.84.105
173.0.84.113
173.0.84.139
173.0.84.25
173.0.84.104
173.0.84.174
173.0.84.180
173.0.84.203
173.0.84.9
173.0.84.16
173.0.84.82
173.0.84.118

real	0m2.393s
user	0m0.032s
sys	0m0.073s

}

func (r *Runner) handleOutput() {
func (r *Runner) handleOutput(scanResults *result.Result) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should split this function into multiple individual function as it's a bit hard to read

@ehsandeep ehsandeep merged commit 3c65528 into dev Jun 25, 2022
@ehsandeep ehsandeep deleted the issue-332-hosts-discovery branch June 25, 2022 13:58
@ehsandeep ehsandeep added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. and removed Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hosts discovery: IPv6 Neighbour discovery Add ICMP ping sweep support

3 participants