mirror of
https://github.com/Lissy93/web-check.git
synced 2025-06-19 19:28:00 +02:00
Implements open port results into UI
This commit is contained in:
parent
5e7c3d167f
commit
a8981b8ca7
36
src/components/Results/OpenPorts.tsx
Normal file
36
src/components/Results/OpenPorts.tsx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import colors from 'styles/colors';
|
||||||
|
import Card from 'components/Form/Card';
|
||||||
|
import Heading from 'components/Form/Heading';
|
||||||
|
import Row from 'components/Form/Row';
|
||||||
|
|
||||||
|
const Outer = styled(Card)`
|
||||||
|
|
||||||
|
small {
|
||||||
|
margin-top: 1rem;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const OpenPortsCard = (portData: any): JSX.Element => {
|
||||||
|
return (
|
||||||
|
<Outer>
|
||||||
|
<Heading as="h3" align="left" color={colors.primary}>Open Ports</Heading>
|
||||||
|
|
||||||
|
{portData.openPorts.map((port: any) => (
|
||||||
|
<Row key={port} lbl="" val="">
|
||||||
|
<span>{port}</span>
|
||||||
|
</Row>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
<br />
|
||||||
|
<small>
|
||||||
|
Unable to establish connections to:<br />
|
||||||
|
{portData.failedPorts.join(', ')}
|
||||||
|
</small>
|
||||||
|
</Outer>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default OpenPortsCard;
|
@ -144,6 +144,7 @@ const jobNames = [
|
|||||||
'redirects',
|
'redirects',
|
||||||
'txt-records',
|
'txt-records',
|
||||||
'status',
|
'status',
|
||||||
|
'ports',
|
||||||
// 'server-info',
|
// 'server-info',
|
||||||
'whois',
|
'whois',
|
||||||
] as const;
|
] as const;
|
||||||
|
@ -25,6 +25,7 @@ import DnsRecordsCard from 'components/Results/DnsRecords';
|
|||||||
import RedirectsCard from 'components/Results/Redirects';
|
import RedirectsCard from 'components/Results/Redirects';
|
||||||
import TxtRecordCard from 'components/Results/TxtRecords';
|
import TxtRecordCard from 'components/Results/TxtRecords';
|
||||||
import ServerStatusCard from 'components/Results/ServerStatus';
|
import ServerStatusCard from 'components/Results/ServerStatus';
|
||||||
|
import OpenPortsCard from 'components/Results/OpenPorts';
|
||||||
import ProgressBar, { LoadingJob, LoadingState, initialJobs } from 'components/misc/ProgressBar';
|
import ProgressBar, { LoadingJob, LoadingState, initialJobs } from 'components/misc/ProgressBar';
|
||||||
import keys from 'utils/get-keys';
|
import keys from 'utils/get-keys';
|
||||||
import { determineAddressType, AddressType } from 'utils/address-type-checker';
|
import { determineAddressType, AddressType } from 'utils/address-type-checker';
|
||||||
@ -198,6 +199,16 @@ const Results = (): JSX.Element => {
|
|||||||
.then(res => parseShodanResults(res)),
|
.then(res => parseShodanResults(res)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Check for open ports
|
||||||
|
const [portsResults] = useMotherHook({
|
||||||
|
jobId: 'ports',
|
||||||
|
updateLoadingJobs,
|
||||||
|
addressInfo: { address: ipAddress, addressType: 'ipV4', expectedAddressTypes: ['ipV4', 'ipV6'] },
|
||||||
|
fetchRequest: () => fetch(`/check-ports?url=${ipAddress}`)
|
||||||
|
.then(res => res.json()),
|
||||||
|
});
|
||||||
|
|
||||||
// Fetch and parse domain whois results
|
// Fetch and parse domain whois results
|
||||||
const [whoIsResults] = useMotherHook<Whois>({
|
const [whoIsResults] = useMotherHook<Whois>({
|
||||||
jobId: 'whois',
|
jobId: 'whois',
|
||||||
@ -282,6 +293,7 @@ const Results = (): JSX.Element => {
|
|||||||
{ title: 'Redirects', result: redirectResults, Component: RedirectsCard },
|
{ title: 'Redirects', result: redirectResults, Component: RedirectsCard },
|
||||||
{ title: 'TXT Records', result: txtRecordResults, Component: TxtRecordCard },
|
{ title: 'TXT Records', result: txtRecordResults, Component: TxtRecordCard },
|
||||||
{ title: 'Server Status', result: serverStatusResults, Component: ServerStatusCard },
|
{ title: 'Server Status', result: serverStatusResults, Component: ServerStatusCard },
|
||||||
|
{ title: 'Open Ports', result: portsResults, Component: OpenPortsCard },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user