phishing-frenzy icon indicating copy to clipboard operation
phishing-frenzy copied to clipboard

BeEF integration from @antisnatchor with love

Open antisnatchor opened this issue 10 years ago • 11 comments

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 avatar Oct 14 '14 15:10 antisnatchor

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.

antisnatchor avatar Oct 14 '14 15:10 antisnatchor

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 avatar Oct 24 '14 21:10 zeknox

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

zeknox avatar Oct 24 '14 22:10 zeknox

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 avatar Oct 26 '14 08:10 antisnatchor

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 avatar Oct 26 '14 08:10 antisnatchor

Check this: https://github.com/antisnatchor/phishing-frenzy/commit/72e3556a1cd24d6de22eae3ac4d4f8391ceac12b I've fixed the exceptions when synching with BeEF is the server isn't reachable.

antisnatchor avatar Oct 27 '14 09:10 antisnatchor

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 avatar Nov 13 '14 19:11 zeknox

@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 avatar Dec 06 '14 21:12 zeknox

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

zeknox avatar Jan 22 '15 19:01 zeknox

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

Meatballs1 avatar Jul 17 '15 23:07 Meatballs1

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 avatar Dec 10 '15 13:12 antisnatchor