Skip to content

Conversation

@ig-masch
Copy link

@ig-masch ig-masch commented Mar 3, 2025

When using your tool, I ran into some issues. I've managed to find a dirty patch that resolved these issues for me. There were two problems, as listed below:

Issue 1

Description

When running node ./ehf.js confusertargets -b ~/Documents/Projects/project.burp > confuser.json, I got the error message

TypeError: pages.append is not a function
    at loadMessages (/[...]/eighthundredfeet/burp.js:49:15)

Patch

I use pages.push() instead of pages.append().

Issue 2

After applying that patch, I get

SyntaxError: Unexpected token 'P', "POST /sock"... is not valid JSON
    at JSON.parse (<anonymous>)
    at EJSON.parse (/[...]/eighthundredfeet/node_modules/ejson/index.js:933:35)
    at DDPMessage.unwrap (/[...]/eighthundredfeet/ddp.js:47:22)
    at /[...]/eighthundredfeet/burp.js:77:50
    at Array.map (<anonymous>)

The issue seems to be that msgStrings also includes messages like "POST /sockjs/[redacted]/xhr_send HTTP/2\r\nHost: [...], which then yields teh JSON parse error.

Patch

I filter any non-websocket message before applying the map function:

  msgStrings = msgStrings.filter((msg) => 
    msg.startsWith('["{\\"msg') || msg.startsWith('a[\"{\\\"msg')
  );

Note

I am not an experienced developer and my patches are really just quick and dirty solutions to help me use your tool for my project. I don't claim that these are fool proof or elegant solutions, but hopefully they provide some inspiration 😄

Thanks for your work!

2 issues:
- pages.push instead of pages.append -- the former apparently doesnt exist
- fitler out any non-websocket msg from msgStrings before applying unwrap map to avoid issue with JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants