Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mystufff' into cygame
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-at-sri committed Aug 21, 2024
2 parents 430faa4 + 8eb261a commit 497750a
Show file tree
Hide file tree
Showing 28 changed files with 1,422 additions and 54 deletions.
139 changes: 87 additions & 52 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,73 @@ export const EDGE_ID_APPEND = 'L';
* Nodes with the matching label will initially display the value of the given node property on the graph.
*/
export const INITIAL_LABEL_MAPPINGS = {
// OS
android_operating_system: 'layout_label',
operating_system: 'layout_label',
// Kernel and Drivers
android_kernel: 'name',
android_memory_driver: 'name',
android_boot_loader: 'name',
android_kernel_binder: 'name',
android_storage_driver: 'name',
android_wifi_driver: 'name',
android_kernel: 'layout_label',
android_boot_loader: 'layout_label',
android_power_manager: 'layout_label',
android_kernel_binder: 'layout_label',
// Kernel Drivers
android_audio_driver: 'layout_label',
android_bluetooth_driver: 'layout_label',
android_camera_driver: 'layout_label',
android_display_driver: 'layout_label',
android_keypad_driver: 'layout_label',
android_memory_driver: 'layout_label',
android_storage_driver: 'layout_label',
android_usb_driver: 'layout_label',
android_wifi_driver: 'layout_label',
// HAL
android_hardware_abstraction_layer: 'name',
android_media_ha: 'name',
android_audio_ha: 'name',
android_binder_ha: 'name',
android_wifi_ha: 'name',
android_telephony_ha: 'name',
android_camera_ha: 'name',
android_hardware_abstraction_layer: 'layout_label',
android_audio_ha: 'layout_label',
android_binder_ha: 'layout_label',
android_bluetooth_ha: 'layout_label',
android_camera_ha: 'layout_label',
android_media_ha: 'layout_label',
android_telephony_ha: 'layout_label',
android_wifi_ha: 'layout_label',
// Libraries
android_native_libraries: 'name',
android_media_library: 'name',
android_ssl_library: 'name',
android_debuggerd_library: 'name',
android_libutils: 'name',
android_binder_library: 'name',
android_bluetooth_library: 'name',
android_camera_library: 'name',
android_shared_memory_library: 'name',
android_open_gl_library: 'name',
android_libc: 'name',
android_core_library: 'layout_label',
android_native_libraries: 'layout_label',
android_binder_library: 'layout_label',
android_bluetooth_library: 'layout_label',
android_camera_library: 'layout_label',
android_debuggerd_library: 'layout_label',
android_libc: 'layout_label',
android_libutils: 'layout_label',
android_media_library: 'layout_label',
android_open_gl_library: 'layout_label',
android_shared_memory_library: 'layout_label',
android_ssl_library: 'layout_label',
// Runtime
android_runtime: 'name',
android_core_library: 'name',
android_framework: 'name',
// OS
android_operating_system: 'name',
operating_system: 'name',
android_runtime: 'layout_label',
android_core_library: 'layout_label',
android_bluetooth_service: 'layout_label',
// UI and Apps
user_interface: 'name',
web_browser: 'name',
android_framework: 'layout_label',
user_interface: 'layout_label',
dialer_app: 'layout_label',
web_browser_app: 'layout_label',
email_app: 'layout_label',
calendar_app: 'layout_label',
camera_app: 'layout_label',
battery_app: 'layout_label',
bluetooth_app: 'layout_label',

// Bugs, vulns, malware
vulnerability: 'name',
exploit: 'name',
system_state: 'name',
malware: 'name',
vulnerability: 'layout_label',
exploit: 'layout_label',
exploit_primitive: 'layout_label',
system_state: 'layout_label',
malware: 'layout_label',
}

export const SAVED_QUERIES = {

// "get node with name marko" : "g.V().has('name', 'marko')",
// "get person nodes that marko has outgoing edges to" : "g.V().has('name', 'marko').out().hasLabel('person')"
// "get person nodes that marko has outgoing edges to" : "g.V().has(lname', 'marko').out().hasLabel('person')"

"Google Android 12 System" : "g.V().has('groups', 'Product: Google Android 12 System')",
"Exploit Chain Mystique" : "g.V().has('groups', 'Exploit Chain: Mystique')",
Expand All @@ -84,47 +102,64 @@ export const SAVED_QUERIES = {
*/
export const ICONS = {
default: require("./icons/default.png"),
// Kernel and Drivers
// OS
android_operating_system: require("./icons/android.png"),
operating_system: require("./icons/operating_system.png"),
// Kernel
android_kernel: require("./icons/operating_system.png"),
android_memory_driver: require("./icons/memory.png"),
android_boot_loader: require("./icons/firmware.png"),
android_power_manager: require("./icons/battery.png"),
android_kernel_binder: require("./icons/binary.png"),
android_storage_driver: require("./icons/binary.png"),
// Kernel Drivers
android_audio_driver: require("./icons/audio.png"),
android_bluetooth_driver: require("./icons/bluetooth.png"),
android_camera_driver: require("./icons/camera.png"),
android_display_driver: require("./icons/touchscreen.png"),
android_keypad_driver: require("./icons/keypad.png"),
android_memory_driver: require("./icons/memory.png"),
android_storage_driver: require("./icons/disk.png"),
android_usb_driver: require("./icons/usb.png"),
android_wifi_driver: require("./icons/wifi.png"),
// HAL
android_hardware_abstraction_layer: require("./icons/binary.png"),
android_audio_ha: require("./icons/audio.png"),
android_binder_ha: require("./icons/binary.png"),
android_bluetooth_ha: require("./icons/bluetooth.png"),
android_camera_ha: require("./icons/camera.png"),
android_media_ha: require("./icons/multimedia.png"),
android_telephony_ha: require("./icons/cellular.png"),
android_wifi_ha: require("./icons/wifi.png"),
// Libraries
android_core_library: require("./icons/library.png"),
android_native_libraries: require("./icons/libraries.png"),
android_media_library: require("./icons/multimedia.png"),
android_ssl_library: require("./icons/x509_certificate.png"),
android_debuggerd_library: require("./icons/library.png"),
android_libutils: require("./icons/library.png"),
android_binder_library: require("./icons/library.png"),
android_bluetooth_library: require("./icons/bluetooth.png"),
android_camera_library: require("./icons/camera.png"),
android_shared_memory_library: require("./icons/memory.png"),
android_open_gl_library: require("./icons/library.png"),
android_debuggerd_library: require("./icons/library.png"),
android_libc: require("./icons/library.png"),
android_libutils: require("./icons/library.png"),
android_media_library: require("./icons/multimedia.png"),
android_open_gl_library: require("./icons/library.png"),
android_shared_memory_library: require("./icons/memory.png"),
android_ssl_library: require("./icons/x509_certificate.png"),
// Runtime
android_runtime: require("./icons/binary.png"),
android_framework: require("./icons/binary.png"),
// OS
android_operating_system: require("./icons/operating_system.png"),
operating_system: require("./icons/operating_system.png"),
android_core_library: require("./icons/library.png"),
android_bluetooth_service: require("./icons/bluetooth.png"),
// UI and Apps
android_framework: require("./icons/binary.png"),
user_interface: require("./icons/user_interface.png"),
web_browser: require("./icons/web_browser.png"),
dialer_app: require("./icons/dialer.png"),
web_browser_app: require("./icons/web_browser.png"),
email_app: require("./icons/email.png"),
calendar_app: require("./icons/calendar.png"),
camera_app: require("./icons/camera.png"),
battery_app: require("./icons/battery.png"),
bluetooth_app: require("./icons/bluetooth.png"),

// Bugs, vulns, malware
vulnerability: require("./icons/vulnerability.png"),
exploit: require("./icons/malware.png"),
exploit_primitive: require("./icons/malware.png"),
system_state: require("./icons/state.png"),
malware: require("./icons/malware.png"),

Expand Down
Binary file added src/icons/android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/battery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/dialer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/disk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/icons/firmware.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/icons/firmware_2.png
Binary file not shown.
Binary file added src/icons/keypad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/icons/sources/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
hard-disk.png https://www.flaticon.com/free-icon/hard-disk_1110837?term=disk+drive&page=1&position=4&origin=search&related_id=1110837
usb.png https://www.flaticon.com/free-icon/usb_483169?term=usb&page=1&position=4&origin=search&related_id=483169
touchscreen.png https://www.flaticon.com/free-icon/touchscreen_4821589?term=touchscreen&page=1&position=12&origin=search&related_id=4821589
mobile-keyboard.png https://www.flaticon.com/free-icon/mobile_14058755?term=mobile+device+keyboard&page=1&position=2&origin=search&related_id=14058755
phone.png https://www.flaticon.com/free-icon/phone_16617747?term=dialer&page=1&position=6&origin=search&related_id=16617747
calendar.png https://www.flaticon.com/free-icon/calendar_2773319?term=calendar&page=1&position=32&origin=search&related_id=2773319
email.png https://www.flaticon.com/free-icon/mail_9068642?term=email&page=1&position=14&origin=search&related_id=9068642
battery.png https://www.flaticon.com/free-icon/battery_3447569?k=1723765927117&log-in=google
android.png https://www.flaticon.com/free-icon/android_888839?term=android&page=1&position=3&origin=search&related_id=888839

Binary file added src/icons/sources/android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/battery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/hard-disk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/keypad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/touchscreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/sources/usb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/touchscreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/usb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions src/logics/graphImpl/cytoImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ function toCyNode(n: NodeData): cy.NodeDefinition {
'background-opacity': 0,
'background-image': getIcon(n.type),
'background-fit': 'none',
'text-max-width' : '100px',
'text-wrap': 'wrap'
//'font-size': '0px',
'text-max-width' : '80px',
'text-wrap': 'wrap',
'text-valign': 'bottom'
},
position: { x: n.x ? n.x : Math.random(), y: n.y ? n.y : Math.random() },
};
Expand Down Expand Up @@ -111,6 +113,7 @@ export function getCytoGraph(container?: HTMLElement, data?: GraphData, options?
width: 1,
"curve-style": "bezier",
"target-arrow-shape": 'triangle',
//"font-size": "0px",
"text-rotation": "autorotate",
"label": "data(label)"
}
Expand Down
Loading

0 comments on commit 497750a

Please sign in to comment.