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

BeEF integration from @antisnatchor with love #102

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

antisnatchor
Copy link

I wrote a new page in the reports area that queries BeEF via RESTful API.
Make sure you enable geolocation in BeEF, as well as PhishingFrenzy integration (I've added a new config option to the main config.yaml). In the campaign 'phishing options' category, you will also see a new 'BeEF RESTful API key', which is needed to call BeEF.

Other than a world offline map showing hooked browsers and online/offline browser detail tables, I've also added a nice feature to correlate the hooked browser with the victim email (based on the UID).
I've also fixed the BeEF tag injection code, which now replaces rather than adding the script at the start of the file.

I'm not done working on this, will send more code in the coming weeks, for example an 'auto-refresh' feature to fetch data from BeEF every 5 seconds. Right now you can easily achieve that with a manual refresh :-)

@antisnatchor
Copy link
Author

It's all dynamic now ;-) I've fixed that in more recent commits, I'm not the best with commenting commits :D just merge the code in a testing environment and try it out buddy.

@zeknox
Copy link
Member

zeknox commented Oct 24, 2014

So I tested this out and ran into a couple observations.

When testing the hooked browser map with Google chrome you will run into cross origin issues as seen in the screenshot below. What do you think is the best approach to handle this?

cross-origin

The next observation was a JSON parsing issue that I was getting when trying to browse the hooked browsers map. It is weird because it looks like my JSON repsonse was a 200 OK with proper looking JSON. Perhaps you can notice something I'm missing.

screen shot 2014-10-24 at 4 34 36 pm

json-response

@zeknox
Copy link
Member

zeknox commented Oct 24, 2014

Also we need to find a way for sync_with_beef to fail more gracefully. For example, here is what happens when the beef service is no longer running and a user attempt to download the Excel file from reports.

download-xlsx

@antisnatchor
Copy link
Author

To prevent SOP issues you need to allow PF origin in BeEF.
Modify 'cors_allowed_domains' and 'allow_cors' variables in the main BeEF config.yaml according to your setup. For a quick test 'allow_cors':true, and 'cors_allowed_domains':'*'

But I suggest you to whitelist only a specific origin rather than using a wildcard for security reasons ;-)

@antisnatchor
Copy link
Author

And yep I agree about synch_with_beef. I was in a rush coding, this features isn't finished yet, that's why I haven't sent you a pull request with this code yet ;-)

@antisnatchor
Copy link
Author

Check this: antisnatchor@72e3556 I've fixed the exceptions when synching with BeEF is the server isn't reachable.

@zeknox
Copy link
Member

zeknox commented Nov 13, 2014

Haven't forgot about this @antisnatchor. Thanks for being patient here. I'll keep you posted when I get around to testing this again. Excited!

@zeknox
Copy link
Member

zeknox commented Dec 6, 2014

@antisnatchor thanks for the updates man, just a heads up that I have taken this PR and created a new branch located here: https://github.com/pentestgeek/phishing-frenzy/tree/antisnatchor-beef-love

This new branch includes a lot of changes due to the master branch changing so much with the recent upgrade to rails4. I'm really impressed with the features that this PR has now that I'm able to get most of it working. I think we have a little more polishing to do but we are getting close.

hooked-browsers

@zeknox
Copy link
Member

zeknox commented Jan 22, 2015

Following up here @antisnatchor I see you've added some additional commits, is this ready to be reviewed again?

@Meatballs1
Copy link
Contributor

Poke @antisnatchor to prevent the logging of beefhook something like below works, syntax might be a little off as its off the top of my head:

SetEnvIf "(^/BEEFHOOK.js)|(^/dh\.+$)" nolog
CustomLog /var/log/apache2/access.log Combined env=!nolog

@antisnatchor
Copy link
Author

Thanks @Meatballs1 I will add that ;-) sorry for not being so active here, but at the same time when you see more commits related to this pull request I guess you should have a look and finally merge it.

I maintain my PF fork so the code changes are usually pretty much stable as I use it in production.

@antisnatchor antisnatchor mentioned this pull request Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants