Skip to content

Instantly share code, notes, and snippets.

@Shivammalaviya
Last active July 15, 2021 20:36
Show Gist options
  • Save Shivammalaviya/41dc8f7e6cb2f5498217e7a851cd08bf to your computer and use it in GitHub Desktop.
Save Shivammalaviya/41dc8f7e6cb2f5498217e7a851cd08bf to your computer and use it in GitHub Desktop.
DeviceNetworkEvents
| where ((ActionType == 'ConnectionSuccess'
and (RemotePort == '5800'
or RemotePort == '5801'
or RemotePort == '5900'
or RemotePort == '5901')
and Protocol == 'tcp') and
((RemoteIP !startswith '10.'
or RemoteIP !startswith '172.16.'
or RemoteIP !startswith '172.17.'
or RemoteIP !startswith '172.18.'
or RemoteIP !startswith '172.19.'
or RemoteIP !startswith '172.20.'
or RemoteIP !startswith '172.21.'
or RemoteIP !startswith '172.22.'
or RemoteIP !startswith '172.23.'
or RemoteIP !startswith '172.24.'
or RemoteIP !startswith '172.25.'
or RemoteIP !startswith '172.26.'
or RemoteIP !startswith '172.27.'
or RemoteIP !startswith '172.28.'
or RemoteIP !startswith '172.29.'
or RemoteIP !startswith '172.30.'
or RemoteIP !startswith '172.31.'
or RemoteIP !startswith '127.'
or RemoteIP !startswith '169.254.'
or RemoteIP !startswith '192.168.')
and (LocalIP !startswith '10.'
or LocalIP !startswith '172.16.'
or LocalIP !startswith '172.17.'
or LocalIP !startswith '172.18.'
or LocalIP !startswith '172.19.'
or LocalIP !startswith '172.20.'
or LocalIP !startswith '172.21.'
or LocalIP !startswith '172.22.'
or LocalIP !startswith '172.23.'
or LocalIP !startswith '172.24.'
or LocalIP !startswith '172.25.'
or LocalIP !startswith '172.26.'
or LocalIP !startswith '172.27.'
or LocalIP !startswith '172.28.'
or LocalIP !startswith '172.29.'
or LocalIP !startswith '172.30.'
or LocalIP !startswith '172.31.'
or LocalIP !startswith '127.'
or LocalIP !startswith '169.254.'
or LocalIP !startswith '192.168.')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment