Skip to content

Commit

Permalink
Update curl module
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakerhax committed Nov 20, 2021
1 parent a3303d6 commit d60d751
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions modules/curl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ def urllib_curl(host_list):
for host in host_list:
try:
response = urllib.request.urlopen(host)
print(host)
print(response.read())
print("\n")
print("[+] " + host + " " + "Response code: " + str(response.getcode()))
except urllib.error.URLError as error:
print("[-] Unable to curl: " + str(error.reason))
print("[-] Unable to curl " + str(host) + ": " + str(error.reason))
except urllib.error.HTTPError as error:
print("[-] Unable to curl: " + str(error.reason))
print("[-] Unable to curl " + str(host) + ": " + str(error.reason))
except ValueError as error:
print("[-] Unable to curl: " + str(error))
print("[-] Unable to curl " + str(host) + ": " + str(error))
4 changes: 2 additions & 2 deletions modules/whois.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import whois as whois2
import whois


def get_whois_org(host_list):
for host in host_list:
try:
w = whois2.whois(host)
w = whois.whois(host)
print("[+] Whois data for " + str(host) + ":")
print("Org: " + w.org)
print("Country: " + w.country)
Expand Down

0 comments on commit d60d751

Please sign in to comment.