Cybersecurity Attacks – Red Team Strategies by Johann Rehberger
Author:Johann Rehberger
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2020-03-30T00:00:00+00:00
Figure 6.27: Loading CSV files into the graph database
Here we see the successful load of a CSV file so that it can be processed by Neo4j. However, at this point, we have not yet created nodes in the graph database. Let's look at how to do that.
Loading CSV data and creating nodes and relationships
The following Cypher statement shows how to successfully load the machines.csv file into the graph database, create nodes for services and computer, and create relationships between these nodes:
LOAD CSV WITH HEADERS FROM "file:///machines.csv" AS line
FIELDTERMINATOR ';'
MERGE (s:Services {port: line.PORT, service: line.SERVICE, hostname: line.FQDN})
MERGE (c:Computer {hostname: line.FQDN, ip: line.IP, operatingsystem: line.OS})
MERGE (c)-[e:EXPOSES]->(s)
Afterward, we can query the graph using this:
MATCH graph=(c:Computer)-[]-(s:Services) RETURN services
This will show the computer nodes and what services each node exposes:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7810)
Grails in Action by Glen Smith Peter Ledbrook(7720)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6864)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6862)
Running Windows Containers on AWS by Marcio Morales(6393)
Kotlin in Action by Dmitry Jemerov(5092)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5082)
Combating Crime on the Dark Web by Nearchos Nearchou(4659)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4644)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4438)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4348)
The Age of Surveillance Capitalism by Shoshana Zuboff(3985)
Python for Security and Networking - Third Edition by José Manuel Ortega(3904)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3568)
Learn Wireshark by Lisa Bock(3555)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3530)
Mastering Python for Networking and Security by José Manuel Ortega(3376)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3359)
Blockchain Basics by Daniel Drescher(3329)
