MCPcopy
hub / github.com/eldraco/domain_analyzer / printout

Function printout

domain_analyzer.py:1874–2063  ·  view source on GitHub ↗

This function prints the domain information obtained

(domain,ip,option)

Source from the content-addressed store, hash-verified

1872 print(" ! ! \n ! ! ! ! \n ! . ! ! . ! \n ^^^^^^^^^ ^ \n ^ ^ \n ^ (0) (0) ^ \n ^ "" ^ \n ^ *************** ^ \n ^ * * ^ \n ^ * /\ /\ /\ * ^ \n ^ * * ^ \n ^ * /\ /\ /\ /\ * ^ \n ^ * * ^ \n ^ * * ^ \n ^ * * ^ \n ^ * * ^ \n ^* * ^ \n ^ * * ^ \n ^ * * ^ \n ^ * ) ( * ^ \n ^^^^^^^^ ^^^^^^^^^ \n Totoro \n")
1873
1874def printout(domain,ip,option):
1875 """
1876 This function prints the domain information obtained
1877 """
1878 global debug
1879 global domain_data
1880 global output_file
1881 global output_directory
1882 global create_pdf
1883 global output_file_handler
1884 ip_vect=[]
1885 try:
1886
1887 # If option = 1 we print all the data extracted
1888 if option==1:
1889 logging.debug('--Finished--')
1890 logging.info('Summary information for domain '+domain)
1891 logging.info('-----------------------------------------')
1892
1893 # We store information for statistics
1894
1895 if output_directory!=False:
1896 output_file_handler.writelines('\n\n--Finished--\n')
1897 output_file_handler.writelines('Summary information for domain '+domain+'\n')
1898 output_file_handler.writelines('-----------------------------------------\n')
1899
1900 # Print information for the domain first
1901 if len(domain_data['DomainInfo'])!=0:
1902
1903 print('\tDomain Specific Information:')
1904 if output_file!="":
1905 output_file_handler.writelines('\tDomain Specific Information:\n')
1906
1907 for domdata in domain_data['DomainInfo']:
1908 # We print the emails found for this domain
1909 if domdata.__contains__('Email'):
1910 logging.warning('\t\tEmail: {0}'.format(domdata['Email']))
1911 if output_file!="":
1912 output_file_handler.writelines('\t\tEmail: {0}\n'.format(domdata.get('Email')))
1913
1914
1915 print('\n\tDomain Ips Information:')
1916 if output_file!="":
1917 output_file_handler.writelines('\n\tDomain Ips Information:\n')
1918
1919
1920 # For each IP in the main dictionary
1921 for ip in domain_data['IpsInfo']:
1922 hostname=""
1923 # We extract its vector
1924 ip_vect=domain_data['IpsInfo'][ip]
1925 logging.debug('\t\tIP: {0}'.format(ip))
1926 if output_file!="":
1927 output_file_handler.writelines('\t\tIP: {0}\n'.format(ip))
1928 # These things are many times for ip
1929 for dicts in ip_vect:
1930 if dicts.__contains__('PTR'):
1931 if dicts.get('PTR') != hostname:

Callers 5

get_NS_recordsFunction · 0.70
get_MX_recordsFunction · 0.70
dns_requestFunction · 0.70
check_A_recordsFunction · 0.70
analyze_domainFunction · 0.70

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected