-
Notifications
You must be signed in to change notification settings - Fork 0
/
wcping.py
95 lines (56 loc) · 1.29 KB
/
wcping.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import pyping
import nmap
import dominate
from dominate.tags import *
import paramiko
import base64
# <codecell>
nm = nmap.PortScanner()
# <codecell>
allscan = nm.scan('192.168.1.*')
# <codecell>
allhosts = nm.all_hosts()
# <codecell>
pinglis = []
nplis = []
# <codecell>
for hosts in allhosts:
print(hosts)
pinglis.append(pyping.ping(hosts))
# <codecell>
for pls in pinglis:
print pls.output[0]
nplis.append(pls.output[0])
# <codecell>
nplis
# <codecell>
nmapdoc = dominate.document(title='nmap scan')
# <codecell>
doc = dominate.document(title='nmap ping')
with doc.head:
link(rel='stylesheet', href='style.css')
script(type='text/javascript', src='script.js')
with doc:
#with div(id='header').add(ol()):
# for i in pinglis:
# li(a(i(), href='/%s.html' % i))
with div():
attr(cls='body')
p(nplis)
print doc
# <codecell>
key = paramiko.RSAKey(data=base64.decodestring('AAA...'))
# <codecell>
key = paramiko.RSAKey(data=base64.decodestring('AAA...'))
# <codecell>
client = paramiko.SSHClient()
# <codecell>
clientkey = client.get_host_keys()
# <codecell>
clientkey
# <codecell>
client.connect('192.168.1.6', username='deb', password='deb')
# <rawcell>