-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpuwr.py
More file actions
28 lines (22 loc) · 1.19 KB
/
Copy pathpuwr.py
File metadata and controls
28 lines (22 loc) · 1.19 KB
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
import argparse, os, sys
parser = argparse.ArgumentParser(description="Puwr usage")
parser.add_argument("host",type=str,help="Targeted host")
parser.add_argument("username",type=str,help="SSH username")
parser.add_argument("password",type=str,help="SSH password")
parser.add_argument("iprange",type=str,help="subnet range")
parser.add_argument("-p","--port",type=int,help="Port number (22 default)")
parser.add_argument("-s","--seconds",type=int,help="Seconds between requests")
parser.add_argument("--scan",type=int,nargs="+",help="Scanned ports per discovered host")
args = parser.parse_args()
if __name__ == "__main__":
sys.path.append(f'{os.path.abspath(os.getcwd())}/source')
import client, main
port = 22 if not args.port else args.port
seconds = 0 if not args.seconds else args.seconds
portrange = [] if not args.scan else args.scan
ssh = client.connect(args.host,args.username,args.password,port) # sets connection with machine via SSH
main.puwr(ssh,seconds,args.iprange,portrange,args.scan) # starts program
# Author: Xeonrx
# Source: https://github.com/Xeonrx/Puwr
# License: MIT License
# Only you are responsible for the use of this script!