forked from rajeshmajumdar/BruteXSS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckurl.py
More file actions
25 lines (23 loc) · 703 Bytes
/
checkurl.py
File metadata and controls
25 lines (23 loc) · 703 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
#! /usr/bin/env python
__author__ = 'Rajesh Majumdar'
import httplib
import socket
import urlparse
def checkurl(url, status):
if "http://" in url:
pass
elif "https://" in url:
pass
else:
url = "http://"+url
finalurl = urlparse.urlparse(url)
urldata = urlparse.parse_qsl(finalurl.query)
domain0 = '{uri.scheme}://{uri.netloc}/'.format(uri=finalurl)
domain = domain0.replace("https://","").replace("http://","").replace("www.","").replace("/","")
try:
request = httplib.HTTPConnection(domain)
request.connect()
status = "1"
except (httplib.HTTPResponse):
status = "0"
return status