zivgitlab.uni-muenster.de Open in urlscan Pro
2001:4cf0:2:4020::917:1ab  Public Scan

URL: https://zivgitlab.uni-muenster.de/wwu-cert/public/zivvt/-/commit/04125bc26cf278eed7abd41f381b1b599f2cb077.patch
Submission: On May 19 via manual from BE — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

From 04125bc26cf278eed7abd41f381b1b599f2cb077 Mon Sep 17 00:00:00 2001
From: Dustin Gawron <d.gawron@wwu.de>
Date: Mon, 28 Sep 2020 12:17:28 +0200
Subject: [PATCH] URLhaus-Ergebnisanzeige verbessert (Closes #3)

---
 src/components/FileResult.js    |  8 ++++----
 src/components/IPResult.js      |  8 ++++----
 src/components/URLResult.js     | 10 +++++-----
 src/components/URLhausResult.js | 23 ++++++-----------------
 src/components/UploadMask.js    |  2 +-
 5 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/src/components/FileResult.js b/src/components/FileResult.js
index 3d44ec9..44dc173 100644
--- a/src/components/FileResult.js
+++ b/src/components/FileResult.js
@@ -142,8 +142,8 @@ class FileResult extends React.Component {
           <Nav tabs>
             <NavItem><NavLink className={this.state.activeTab === 0 ? 'active' : ''} onClick={() => { this.toggleTab(0); }}>VirusTotal</NavLink></NavItem>
             <NavItem><NavLink className={this.state.activeTab === 1 ? 'active' : ''} onClick={() => { this.toggleTab(1); }}>Cuckoo</NavLink></NavItem>
-            <NavItem><NavLink className={this.state.activeTab === 2 ? 'active' : ''} onClick={() => { this.toggleTab(2); }}>BSI MISP</NavLink></NavItem>
-            <NavItem><NavLink className={this.state.activeTab === 3 ? 'active' : ''} onClick={() => { this.toggleTab(3); }}>URLhaus</NavLink></NavItem>
+            <NavItem><NavLink className={this.state.activeTab === 2 ? 'active' : ''} onClick={() => { this.toggleTab(2); }}>URLhaus</NavLink></NavItem>
+            <NavItem><NavLink className={this.state.activeTab === 3 ? 'active' : ''} onClick={() => { this.toggleTab(3); }}>BSI MISP</NavLink></NavItem>
           </Nav>
           <TabContent activeTab={this.state.activeTab}>
             <TabPane tabId={0} className="p-2">
@@ -153,10 +153,10 @@ class FileResult extends React.Component {
               {!this.state.hash ? <Spinner className="d-block mx-auto" color="warning" /> : <CuckooResult file={this.props.file} hash={this.state.hash} certUser={this.state.certUser} />}
             </TabPane>
             <TabPane tabId={2} className="p-2">
-              {!this.state.hash ? <Spinner className="d-block mx-auto" color="warning" /> : <MISPResult query={this.state.hash} certUser={this.state.certUser} />}
+              {!this.state.hash ? <Spinner className="d-block mx-auto" color="warning" /> : <URLhausResult hash={this.state.hash} />}
             </TabPane>
             <TabPane tabId={3} className="p-2">
-              {!this.state.hash ? <Spinner className="d-block mx-auto" color="warning" /> : <URLhausResult hash={this.state.hash} />}
+              {!this.state.hash ? <Spinner className="d-block mx-auto" color="warning" /> : <MISPResult query={this.state.hash} certUser={this.state.certUser} />}
             </TabPane>
           </TabContent>
         </div>
diff --git a/src/components/IPResult.js b/src/components/IPResult.js
index 0920745..8133bee 100644
--- a/src/components/IPResult.js
+++ b/src/components/IPResult.js
@@ -63,10 +63,10 @@ class IPResult extends React.Component {
               <NavLink className={this.state.activeTab === 0 ? 'active' : ''} onClick={() => { this.toggleTab(0); }}>VirusTotal</NavLink>
             </NavItem>
             <NavItem>
-              <NavLink className={this.state.activeTab === 1 ? 'active' : ''} onClick={() => { this.toggleTab(1); }}>BSI MISP</NavLink>
+              <NavLink className={this.state.activeTab === 1 ? 'active' : ''} onClick={() => { this.toggleTab(1); }}>URLhaus</NavLink>
             </NavItem>
             <NavItem>
-              <NavLink className={this.state.activeTab === 2 ? 'active' : ''} onClick={() => { this.toggleTab(2); }}>URLhaus</NavLink>
+              <NavLink className={this.state.activeTab === 2 ? 'active' : ''} onClick={() => { this.toggleTab(2); }}>BSI MISP</NavLink>
             </NavItem>
             {this.state.certUser ?
               <NavItem>
@@ -80,10 +80,10 @@ class IPResult extends React.Component {
               <VTIPResult ip={this.props.ip} />
             </TabPane>
             <TabPane tabId={1} className="p-2">
-              <MISPResult query={this.props.ip} certUser={this.state.certUser} />
+              <URLhausResult ip={this.props.ip} />
             </TabPane>
             <TabPane tabId={2} className="p-2">
-              <URLhausResult ip={this.props.ip} />
+              <MISPResult query={this.props.ip} certUser={this.state.certUser} />
             </TabPane>
             {this.state.certUser ?
               <TabPane tabId={3} className="p-2">
diff --git a/src/components/URLResult.js b/src/components/URLResult.js
index 977c627..b48b0e6 100644
--- a/src/components/URLResult.js
+++ b/src/components/URLResult.js
@@ -63,10 +63,10 @@ class URLResult extends React.Component {
               <NavLink className={this.state.activeTab === 0 ? 'active' : ''} onClick={() => { this.toggleTab(0); }}>VirusTotal</NavLink>
             </NavItem>
             <NavItem>
-              <NavLink className={this.state.activeTab === 1 ? 'active' : ''} onClick={() => { this.toggleTab(1); }}>BSI MISP</NavLink>
+              <NavLink className={this.state.activeTab === 1 ? 'active' : ''} onClick={() => { this.toggleTab(1); }}>URLhaus</NavLink>
             </NavItem>
             <NavItem>
-              <NavLink className={this.state.activeTab === 2 ? 'active' : ''} onClick={() => { this.toggleTab(2); }}>URLhaus</NavLink>
+              <NavLink className={this.state.activeTab === 2 ? 'active' : ''} onClick={() => { this.toggleTab(2); }}>BSI MISP</NavLink>
             </NavItem>
             {this.state.certUser ?
               <NavItem>
@@ -80,13 +80,13 @@ class URLResult extends React.Component {
               <VTURLResult url={this.props.url} />
             </TabPane>
             <TabPane tabId={1} className="p-2">
-              <MISPResult query={this.props.url} certUser={this.state.certUser} />
+              <URLhausResult url={this.props.url} />
             </TabPane>
             <TabPane tabId={2} className="p-2">
-              <URLhausResult url={this.props.url} />
+              <MISPResult query={this.props.url} certUser={this.state.certUser} />
             </TabPane>
             {this.state.certUser ?
-              <TabPane tabId={2} className="p-2">
+              <TabPane tabId={3} className="p-2">
                 <SFResult query={this.props.url} />
               </TabPane>
               : null
diff --git a/src/components/URLhausResult.js b/src/components/URLhausResult.js
index 5cdf544..2f2dcc6 100644
--- a/src/components/URLhausResult.js
+++ b/src/components/URLhausResult.js
@@ -16,8 +16,6 @@ class URLhausResult extends React.Component {
       result: null,
       type: ''
     };
-
-    this.toggleDetails = this.toggleDetails.bind(this);
   }
 
   componentDidMount() {
@@ -122,17 +120,6 @@ class URLhausResult extends React.Component {
     });
   }
 
-  /**
-   * Toggles the detailed overview.
-   *
-   * @return {undefined}
-   */
-  toggleDetails() {
-    this.setState(prevState => ({
-      showDetails: !prevState.showDetails
-    }));
-  }
-
   render() {
     let content = <div></div>;
     let result  = this.state.result;
@@ -154,7 +141,7 @@ class URLhausResult extends React.Component {
             firstSeen = new Date(result.firstseen.split(' ')[0]);
             content = (
               <div>
-                <Alert color="warning"><p>Diese Datei ist seit dem {firstSeen.getDate() + '.' + (firstSeen.getMonth() + 1) + '.' + firstSeen.getFullYear()} bei URLhaus bekannt und wurde über {result.url_count} bekannte URL{result.url_count === '1' ? '' : 's'} verteilt.</p></Alert>
+                <Alert color="danger"><p>Diese Datei ist seit dem {firstSeen.getDate() + '.' + (firstSeen.getMonth() + 1) + '.' + firstSeen.getFullYear()} bei URLhaus bekannt und wurde über {result.url_count} bekannte URL{result.url_count === '1' ? '' : 's'} verteilt.</p></Alert>
                 <h5>URLs:</h5>
                 <p className="mt-2">
                   <ListGroup>
@@ -177,12 +164,14 @@ class URLhausResult extends React.Component {
                 break;
 
               default:
-                threat = result.threat;
+                threat = 'wurde als "' + result.threat + '" markiert';
             }
 
             content = (
               <div>
-                <Alert color="warning"><p>Diese URL ist seit dem {firstSeen.getDate() + '.' + (firstSeen.getMonth() + 1) + '.' + firstSeen.getFullYear()} bei URLhaus bekannt und {threat}.</p></Alert>
+                <Alert color="danger"><p>Diese URL ist seit dem {firstSeen.getDate() + '.' + (firstSeen.getMonth() + 1) + '.' + firstSeen.getFullYear()} bei URLhaus bekannt und {threat}.</p></Alert>
+                {result.url_status === 'offline' ? <Alert color="success">Die URL wurde mittlerweile bereinigt und ist nicht mehr erreichbar.</Alert> : null}
+                {result.url_status === 'online' ? <Alert color="danger">Die URL ist möglicherweise noch erreichbar.</Alert> : null}
                 <h5>Tags:</h5>
                 <p className="mt-2">{result.tags.map((val, idx) => {
                   return <Badge key={idx} className="mr-2" color="info" pill>{val}</Badge>
@@ -196,7 +185,7 @@ class URLhausResult extends React.Component {
             firstSeen = new Date(result.firstseen.split(' ')[0]);
             content = (
               <div>
-                <Alert color="warning"><p>Diese Domain ist seit dem {firstSeen.getDate() + '.' + (firstSeen.getMonth() + 1) + '.' + firstSeen.getFullYear()} bei URLhaus bekannt und steht mit {result.url_count} schädlichen URL{result.url_count === '1' ? '' : 's'} in Verbindung.</p></Alert>
+                <Alert color="danger"><p>Diese Domain ist seit dem {firstSeen.getDate() + '.' + (firstSeen.getMonth() + 1) + '.' + firstSeen.getFullYear()} bei URLhaus bekannt und steht mit {result.url_count} schädlichen URL{result.url_count === '1' ? '' : 's'} in Verbindung.</p></Alert>
                 <h5>URLs:</h5>
                 <p className="mt-2">
                   <ListGroup>
diff --git a/src/components/UploadMask.js b/src/components/UploadMask.js
index ed4b4a3..2a57548 100644
--- a/src/components/UploadMask.js
+++ b/src/components/UploadMask.js
@@ -191,7 +191,7 @@ class UploadMask extends React.Component {
 
     let manualInput = this.manualInputRef.current.value.trim();
     let ipregex = /^(?!0)(?!.*\.$)((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){4}$/;
-    let urlregex = /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;
+    let urlregex = /(http(s)?:\/\/.)?[-a-zA-Z0-9@:%._+~#=]{2,256}(\.[a-z]{2,6}|:\d+)\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/;
     let hashregex = /^[A-Fa-f0-9]{32,128}$/;
 
     if(manualInput.length === 0) {
-- 
GitLab