Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IC-Interface Control
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mateus Goto
IC-Interface Control
Commits
73cbb70c
Commit
73cbb70c
authored
Jun 17, 2022
by
Mateus Goto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADDED] IPfinder - getAllip
parent
5a75ec61
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
0 deletions
+42
-0
.gitignore
.gitignore
+1
-0
Control Interface/controlInterface.py
Control Interface/controlInterface.py
+0
-0
NHR9400/NRH9400.py
NHR9400/NRH9400.py
+15
-0
Utility/IPFinder.py
Utility/IPFinder.py
+26
-0
No files found.
.gitignore
0 → 100644
View file @
73cbb70c
test.py
Control Interface/controlInterface.py
0 → 100644
View file @
73cbb70c
NHR9400/NRH9400.py
View file @
73cbb70c
import
random
import
socket
class
NHR9400
:
def
__init__
(
self
,
name
):
self
.
__id
=
random
.
randrange
(
100
,
300
,
2
)
self
.
__name
=
name
def
start
(
void
):
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
timeout
(
1
)
\ No newline at end of file
Utility/IPFinder.py
0 → 100644
View file @
73cbb70c
import
socket
from
threading
import
local
from
scapy.all
import
ARP
,
Ether
,
srp
class
IPFinder
:
#uses socket and scapy to scan the entire local network and returns all the IPs adresses of the devices connects in this networok
def
getAllIp
():
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
s
.
connect
((
"10.255.255.255"
,
1
))
local_ip
=
s
.
getsockname
()[
0
]
local_ip
=
local_ip
[:
-
1
]
+
"/24"
print
(
local_ip
)
print
(
type
(
local_ip
))
arp
=
ARP
(
pdst
=
local_ip
)
ether
=
Ether
(
dst
=
"ff:ff:ff:ff:ff:ff"
)
packet
=
ether
/
arp
result
=
srp
(
packet
,
timeout
=
1
,
verbose
=
0
)[
0
]
clients
=
[]
for
sent
,
received
in
result
:
clients
.
append
({
"ip"
:
received
.
psrc
})
for
client
in
clients
:
print
(
client
[
'ip'
])
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment