forked from MustafaAhmed7316/ghostnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore.py
More file actions
41 lines (34 loc) · 972 Bytes
/
core.py
File metadata and controls
41 lines (34 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import asyncio
from utils.arguments import arguments
from features.icmproot import icmp_ping
from features.icmpnoroot import icmp_ping_noroot
from features.traceroute import traceroute
from features.resolve import resolve
from features.port import start_scan
from features.subnet import subnet_scan
args = arguments()
target = args.ping
trtarget = args.traceroute
rstarget = args.resolve
portscan = args.port
subnetscan = args.subnet
subnetport = args.port
isRoot = os.geteuid() == 0
if not any([target, trtarget, rstarget, portscan, subnetscan]):
print("no target found")
else:
if target:
print(f"pinging {target}...\n")
if isRoot:
icmp_ping(target)
else:
icmp_ping_noroot(target)
if trtarget:
traceroute(trtarget, privileged=isRoot)
if rstarget:
resolve(rstarget)
if portscan:
start_scan(portscan)
if subnetscan:
subnet_scan(subnetscan, subnetport)