diff --git a/src/components/Results/DomainLookup.tsx b/src/components/Results/DomainLookup.tsx new file mode 100644 index 0000000..a560306 --- /dev/null +++ b/src/components/Results/DomainLookup.tsx @@ -0,0 +1,39 @@ + +import colors from 'styles/colors'; +import { Card } from 'components/Form/Card'; +import Row from 'components/Form/Row'; + +const cardStyles = ` +span.val { + &.up { color: ${colors.success}; } + &.down { color: ${colors.danger}; } +} +`; + +const DomainLookupCard = (props: { data: any, title: string, actionButtons: any }): JSX.Element => { + const domain = props.data; + return ( + + { domain.Domain_Name && } + { domain.Creation_Date && } + { domain.Updated_Date && } + { domain.Registry_Expiry_Date && } + { domain.Registry_Domain_ID && } + { domain.Registrar_WHOIS_Server && } + { domain.Registrar && + Registrar + {domain.Registrar} + } + { domain.Registrar_IANA_ID && } + + {/* + Is Up? + { serverStatus.isUp ? ✅ Online : ❌ Offline} + + + { serverStatus.responseTime && } */} + + ); +} + +export default DomainLookupCard; diff --git a/src/pages/Results.tsx b/src/pages/Results.tsx index e7184d2..0745a37 100644 --- a/src/pages/Results.tsx +++ b/src/pages/Results.tsx @@ -34,6 +34,7 @@ import CarbonFootprintCard from 'components/Results/CarbonFootprint'; import SiteFeaturesCard from 'components/Results/SiteFeatures'; import DnsSecCard from 'components/Results/DnsSec'; import HstsCard from 'components/Results/Hsts'; +import DomainLookup from 'components/Results/DomainLookup'; import SelfScanMsg from 'components/misc/SelfScanMsg'; import ProgressBar, { LoadingJob, LoadingState, initialJobs } from 'components/misc/ProgressBar'; @@ -371,6 +372,14 @@ const Results = (): JSX.Element => { fetchRequest: () => fetch(`/dns-sec?url=${address}`).then(res => parseJson(res)), }); + // Run a manual whois lookup on the domain + const [domainLookupResults, updateDomainLookupResults] = useMotherHook({ + jobId: 'domain-lookup', + updateLoadingJobs, + addressInfo: { address, addressType, expectedAddressTypes: urlTypeOnly }, + fetchRequest: () => fetch(`/whois-lookup?url=${address}`).then(res => parseJson(res)), + }); + /* Cancel remaining jobs after 10 second timeout */ useEffect(() => { const checkJobs = () => { @@ -399,7 +408,7 @@ const Results = (): JSX.Element => { { id: 'location', title: 'Server Location', result: locationResults, Component: ServerLocationCard, refresh: updateLocationResults }, { id: 'ssl', title: 'SSL Info', result: sslResults, Component: SslCertCard, refresh: updateSslResults }, { id: 'headers', title: 'Headers', result: headersResults, Component: HeadersCard, refresh: updateHeadersResults }, - { id: 'whois', title: 'Domain Info', result: whoIsResults, Component: WhoIsCard, refresh: updateWhoIsResults }, + { id: 'domain', title: 'Whois', result: domainLookupResults, Component: DomainLookup, refresh: updateDomainLookupResults }, { id: 'dns', title: 'DNS Records', result: dnsResults, Component: DnsRecordsCard, refresh: updateDnsResults }, { id: 'hosts', title: 'Host Names', result: shoadnResults?.hostnames, Component: HostNamesCard, refresh: updateShodanResults }, { id: 'lighthouse', title: 'Performance', result: lighthouseResults, Component: LighthouseCard, refresh: updateLighthouseResults }, @@ -414,6 +423,7 @@ const Results = (): JSX.Element => { { id: 'screenshot', title: 'Screenshot', result: lighthouseResults?.fullPageScreenshot?.screenshot, Component: ScreenshotCard, refresh: updateLighthouseResults }, { id: 'txt-records', title: 'TXT Records', result: txtRecordResults, Component: TxtRecordCard, refresh: updateTxtRecordResults }, { id: 'hsts', title: 'HSTS Check', result: hstsResults, Component: HstsCard, refresh: updateHstsResults }, + { id: 'whois', title: 'Domain Info', result: whoIsResults, Component: WhoIsCard, refresh: updateWhoIsResults }, { id: 'features', title: 'Site Features', result: siteFeaturesResults, Component: SiteFeaturesCard, refresh: updateSiteFeaturesResults }, { id: 'carbon', title: 'Carbon Footprint', result: carbonResults, Component: CarbonFootprintCard, refresh: updateCarbonResults }, ];