Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI crash in the ATT&CK report tab #577

Closed
shreyamalviya opened this issue Mar 15, 2020 · 3 comments · Fixed by #580
Closed

UI crash in the ATT&CK report tab #577

shreyamalviya opened this issue Mar 15, 2020 · 3 comments · Fixed by #580
Assignees
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. UI User Interface
Milestone

Comments

@shreyamalviya
Copy link
Contributor

Describe the bug

After running Monkey and going to the ATT&CK report and clicking on "System information discovery" or "System network configuration discovery", it should show more details about the selected attack but the UI crashes.

The "List of all techniques" button also fails because of this.

To Reproduce

Run the monkey. Once the report is generated, go to the ATT&CK report tab and click on "System information discovery" or "System network configuration discovery" (or toggle "List of all techniques").

Expected behavior

Should show more details about the attack in the form of a table below the matrix.

@shreyamalviya
Copy link
Contributor Author

Spent some time on this and narrowed it down to this piece of code (this is for "System network configuration discovery" i.e. T1016; it's similar for "System information discovery" i.e. T1082)

in monkey/monkey_island/cc/ui/src/components/attack/techniques/T1016.js.

There's something wrong with this.props.data.network_info. It renders once I comment that line (default value is an empty array).

@VakarisZ
Copy link
Contributor

Thanks a lot! I will see if I can reproduce. Also, if you run UI in debug mode (npm start) you can trace the exact line and error from console. If you also provide the error - this issue is half of the solution already :D

@ShayNehmad ShayNehmad added Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. UI User Interface labels Mar 16, 2020
@VakarisZ VakarisZ self-assigned this Mar 16, 2020
@ShayNehmad ShayNehmad self-assigned this Mar 16, 2020
@ShayNehmad ShayNehmad added this to the 1.8.0 milestone Mar 16, 2020
@shreyamalviya
Copy link
Contributor Author

First, there's this:

Uncaught TypeError: Cannot read property 'forEach' of undefined
    at renderMachineFromSystemData (Helpers.js:35)
    at Object.accessor (T1016.js:66)
    at eval (methods.js:236)
    at Array.forEach (<anonymous>)
    at accessRow (methods.js:235)
    at eval (methods.js:252)
    at Array.map (<anonymous>)
    at ReactTable.getDataModel (methods.js:251)
    at ReactTable._class (lifecycle.js:17)
    at ReactTable._class (methods.js:4)

Which is because it tries accessing a key ips but the key doesn't exist since the object is empty.

If I remove that particular part of the data and only pass the part which has all the required information, then there's this:

Uncaught TypeError: resolvedData.map is not a function
    at ReactTable.getDataModel (methods.js:251)
    at ReactTable._class (lifecycle.js:17)
    at ReactTable._class (methods.js:4)
    at new ReactTable (index.js:28)
    at constructClassInstance (react-dom.development.js:14204)
    at updateClassComponent (react-dom.development.js:18413)
    at beginWork$1 (react-dom.development.js:20186)
    at HTMLUnknownElement.callCallback (react-dom.development.js:336)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
    at invokeGuardedCallback (react-dom.development.js:440)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. UI User Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants