Skip to content

Commit

Permalink
ajout fonctions backend interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wrk226 committed Apr 15, 2022
1 parent 7934d49 commit 8a0dc8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion echosounder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ipaddress
import platform

import netifaces
import dns.resolver, dns.reversename
import nmap
import scapy
Expand All @@ -27,6 +28,9 @@ def check_nmap_exist():
# check Nmap is installed, return True if installed, False otherwise
return shutil.which("nmap") is not None

def get_interfaces():
return netifaces.interfaces()

def get_host_and_gateway() -> dict:
"""
grab the
Expand Down Expand Up @@ -450,4 +454,4 @@ def scan_dhcp_discover(target_cidr):

if __name__ == "__main__":
print("TEST")
#print(scan_dhcp_discover('192.168.1.0/24'))
print(scan_dhcp_discover1('192.168.1.0/24'))
5 changes: 5 additions & 0 deletions webchosounder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ def index():
def health():
return jsonify(nmap=echosounder.check_nmap_exist())

@app.route('/json/interfaces')
def get_interfaces():
return jsonify(echosounder.get_interfaces())


@app.route('/json/arp_scan', methods=['POST'])
def scan_arp():
if not if_contain_cible(request.json):
Expand Down

0 comments on commit 8a0dc8f

Please sign in to comment.