Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
0df4d63a
Commit
0df4d63a
authored
8 years ago
by
gpotter2
Committed by
gpotter2
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix indent
parent
40ad5b67
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scapy/arch/windows/__init__.py
+2
-1
2 additions, 1 deletion
scapy/arch/windows/__init__.py
with
2 additions
and
1 deletion
scapy/arch/windows/__init__.py
+
2
−
1
View file @
0df4d63a
...
@@ -112,6 +112,7 @@ _VBS_WMI_OUTPUT = {
...
@@ -112,6 +112,7 @@ _VBS_WMI_OUTPUT = {
def
_exec_query_vbs
(
cmd
,
fields
):
def
_exec_query_vbs
(
cmd
,
fields
):
"""
Execute a query using VBS. Currently Get-WmiObject queries are
"""
Execute a query using VBS. Currently Get-WmiObject queries are
supported.
supported.
"""
"""
if
not
WINDOWS
:
if
not
WINDOWS
:
return
return
...
@@ -143,6 +144,7 @@ Next
...
@@ -143,6 +144,7 @@ Next
def
exec_query
(
cmd
,
fields
):
def
exec_query
(
cmd
,
fields
):
"""
Execute a system query using PowerShell if it is available, and
"""
Execute a system query using PowerShell if it is available, and
using VBS/cscript as a fallback.
using VBS/cscript as a fallback.
"""
"""
if
conf
.
prog
.
powershell
is
None
:
if
conf
.
prog
.
powershell
is
None
:
return
_exec_query_vbs
(
cmd
,
fields
)
return
_exec_query_vbs
(
cmd
,
fields
)
...
@@ -240,7 +242,6 @@ def get_windows_if_list():
...
@@ -240,7 +242,6 @@ def get_windows_if_list():
query
=
exec_query
([
'
Get-NetAdapter
'
],
query
=
exec_query
([
'
Get-NetAdapter
'
],
[
'
InterfaceDescription
'
,
'
InterfaceIndex
'
,
'
Name
'
,
[
'
InterfaceDescription
'
,
'
InterfaceIndex
'
,
'
Name
'
,
'
InterfaceGuid
'
,
'
MacAddress
'
])
# It is normal that it is in this order
'
InterfaceGuid
'
,
'
MacAddress
'
])
# It is normal that it is in this order
else
:
else
:
query
=
exec_query
([
'
Get-WmiObject
'
,
'
Win32_NetworkAdapter
'
],
query
=
exec_query
([
'
Get-WmiObject
'
,
'
Win32_NetworkAdapter
'
],
[
'
Name
'
,
'
InterfaceIndex
'
,
'
InterfaceDescription
'
,
[
'
Name
'
,
'
InterfaceIndex
'
,
'
InterfaceDescription
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment