-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwebfatch.py
More file actions
68 lines (45 loc) · 1.49 KB
/
Copy pathwebfatch.py
File metadata and controls
68 lines (45 loc) · 1.49 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
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
import webbrowser
import urllib.request as urllib
from urllib.parse import urlparse
import webbrowser
import dependency.nmap.nmap as nmap
url = "http://technoindiauniversity.ac.in"
nmhost = 'www.technoindiauniversity.ac.in'
#unicode responce of the url
responce = urllib.urlopen(url)
print (responce)
#print the http status code as 200 , 401 or etc
code = str(responce.getcode())
print (code)
#return the webpage html code
data = responce.read()
# print (data)
#return the path of website where it is seted
websitepath = urllib.url2pathname(url)
print (websitepath)
#unwrape the url
unwrap = urllib.unwrap(url)
print (unwrap)
#get return the local ip address
address_of_local_host = urllib.thishost()
print ("The local IP address of this host is "+ str(address_of_local_host))
#get host name of site
hostname = urlparse(url).hostname
print (hostname)
#getting the host and corrosponding port
host_port = urllib.splitport(hostname)
print (host_port)
print (urllib.splitpasswd("admin"))
#working with web browser
print (webbrowser.__all__)
webbrowser.Chrome("http://google.com")
print(webbrowser.Chrome("http://google.com"))
# webbrowser.open_new_tab("http://google.com")
print(webbrowser.open_new_tab.__call__)
#nmap features
nm = nmap.PortScanner()
print (nm.nmap_version())
scaninfo = nm.scan(hosts='www.technoindiauniversity.ac.in')
print(scaninfo)
print(nm.scaninfo())
print(nm.has_host('www.technoindiauniversity.ac.in'))