View Issue Details

IDProjectCategoryView StatusLast Update
0002317Kali LinuxKali Package Improvementpublic2015-07-28 21:48
Reporterg0tmi1k Assigned Torhertzog  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version2.0 
Fixed in Version2.0 
Summary0002317: BeEF XSS - start command
Description

The current beef-xss command which start the service and gives some feedback currently looks like this:

root@kali:~# cat /usr/bin/beef-xss 
#!/bin/bash

if [[ $EUID -ne 0 ]]; then
   echo "[*] This script must be run as root" 1>&2
   exit 1
fi

echo '[*] Please wait as BeEF services are started.'
echo '[*] You might need to refresh your browser once it opens.'
service beef-xss start
sleep 5
xdg-open http://127.0.0.1:3000/ui/panel

root@kali:~#

1. Sleep

I suggest that the delay is increased.
Current value: 5 seconds
I've had 'better' responses with a longer wait: 7-10 seconds

2. Service

Rather than just service beef-xss start, how about stopping it first, then starting or using service beef-xss restart instead?

3. Hook information

If you were to start beef like the follow:

root@kali:/usr/share/beef-xss# ./beef 
[19:11:02][*] Bind socket [imapeudora1] listening on [0.0.0.0:2000].
[19:11:02][*] Browser Exploitation Framework (BeEF) 0.4.4.9-alpha
[19:11:02]    |   Twit: @beefproject
[19:11:02]    |   Site: http://beefproject.com
[19:11:02]    |   Blog: http://blog.beefproject.com
[19:11:02]    |_  Wiki: https://github.com/beefproject/beef/wiki
[19:11:02][*] Project Creator: Wade Alcorn (@WadeAlcorn)
[19:11:02][*] BeEF is loading. Wait a few seconds...
[19:11:06][*] 10 extensions enabled.
[19:11:06][*] 196 modules enabled.
[19:11:06][*] 17 network interfaces were detected.
[19:11:06][+] running on network interface: 127.0.0.1
[19:11:06]    |   Hook URL: http://127.0.0.1:3000/hook.js
[19:11:06]    |_  UI URL:   http://127.0.0.1:3000/ui/panel
[19:11:06][+] running on network interface: 192.168.0.32
[19:11:06]    |   Hook URL: http://192.168.0.32:3000/hook.js
[19:11:06]    |_  UI URL:   http://192.168.0.32:3000/ui/panel
[19:11:06][+] running on network interface: 192.168.155.175
[19:11:06]    |   Hook URL: http://192.168.155.175:3000/hook.js
[19:11:06]    |_  UI URL:   http://192.168.155.175:3000/ui/panel
...SNIP...

You see information regarding the 'hook'. I suggest something like:

echo '[*] Hook: <script src="http://<IP>:<PORT>/hook.js"></script>'
echo '[*] Example: <script src="http://127.0.0.1:3000/hook.js"></script>'

4. [BUG] Not using port information

If you were to alter which port beef uses in '/usr/share/beef-xss/config.yaml' e.g (port: "3001"), the script is hardcoded to use 3000.

grep -e ' port:.*"' /usr/share/beef-xss/config.yaml | awk -F '"' '{print $2}'

root@kali:~# grep -e ' port:.*"' /usr/share/beef-xss/config.yaml | awk -F '"' '{print $2}'
3000
root@kali:~#    

For the record, I know 'awk' is slower than other commands and theres better bash fu

Additional Information

root@kali:~# dpkg -l | grep beef
ii beef-xss 0.4.4.9-0kali8 all Browser Exploitation Framework (BeEF)
root@kali:~# uname -a
Linux kali 3.18.0-kali3-amd64 0000001 SMP Debian 3.18.6-1~kali2 (2015-03-02) x86_64 GNU/Linux
root@kali:~# lsb_release -a
No LSB modules are available.
Distributor ID: Kali
Description: Kali GNU/Linux 1.1.0
Release: 1.1.0
Codename: moto
root@kali:~#

Attached Files
beef-xss (589 bytes)   
#!/bin/bash

if [[ $EUID -ne 0 ]]; then
   echo "[*] This script must be run as root" 1>&2
   exit 1
fi

port=$(grep -e ' port:.*"' /usr/share/beef-xss/config.yaml | awk -F '"' '{print $2}')

echo '[*] Please wait as BeEF service is started.'
service beef-xss restart
sleep 3

echo '[*]    Hook: <script src="http://<IP>:<PORT>/hook.js"></script>'
echo '[*] Example: <script src="http://127.0.0.1:'${port}'/hook.js"></script>'
echo '[*] Default credentials: beef / beef'
echo '[*] You might need to refresh your browser once it opens.'
sleep 5

xdg-open http://127.0.0.1:${port}/ui/panel

beef-xss (589 bytes)   

Activities

rhertzog

rhertzog

2015-07-28 21:48

administrator   ~0003625

Fixed points 1, 3, 4 in beef-xss_0.4.6.1-0kali2.dsc.

For point 2, I don't see why you would want to stop beef-xss in the script. With systemd in sana, "service beef-xss start" is a no-op if it's already started.

And for the last comments about login credentials, I don't think that we should diverge from the default user/password. I agree it should be adressed through documentation.

Issue History

Date Modified Username Field Change
2015-06-06 18:21 g0tmi1k New Issue
2015-07-27 10:16 g0tmi1k File Added: beef-xss
2015-07-27 10:16 g0tmi1k Product Version => 2.0
2015-07-27 14:41 rhertzog Assigned To => rhertzog
2015-07-27 14:41 rhertzog Status new => assigned
2015-07-28 21:48 rhertzog Note Added: 0003625
2015-07-28 21:48 rhertzog Status assigned => resolved
2015-07-28 21:48 rhertzog Fixed in Version => 2.0
2015-07-28 21:48 rhertzog Resolution open => fixed