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

ported to python3 and some minor changes #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
<img src="https://img.shields.io/badge/Python-2-yellow.svg"></a> <img src="https://img.shields.io/badge/license-GPLv3-red.svg">
<img src="https://img.shields.io/badge/Python-3-yellow.svg"></a> <img src="https://img.shields.io/badge/license-GPLv3-red.svg">
<a href="http://www.blackhat.com/eu-17/arsenal/schedule/#wipi-hunter---wifi-pineapple-activities-detection-9091"><img src="https://rawgit.com/toolswatch/badges/master/arsenal/europe/2017.svg"></a>
<a href="https://www.blackhat.com/asia-18/arsenal/schedule/index.html#wipi-hunter---detects-illegal-wireless-network-activities-9854"><img src="https://rawgit.com/toolswatch/badges/master/arsenal/asia/2018.svg"></a>
<a href="https://defcon.org/html/defcon-26/dc-26-demolabs.html#WiPi-Hunter"><img src="https://hackwith.github.io/badges/defcon/26/demolabs.svg"></a>
Expand Down Expand Up @@ -53,15 +53,15 @@ The goal of this project is to find out the fake access points opened by the WiF
* **Hardware:** TP LINK TL-WN722N
* **Modules:** scapy, time, termcolor, argparse, commands, netifaces, logging

#### Kali Linux:
#### Parrot OS or Kali Linux:

Download pisavar:

`git clone https://github.com/WiPi-Hunter/PiSavar.git`
`git clone https://github.com/xcod3/PiSavar.git`

Install Python librarie(s):

`pip install termcolor`
`pip3 install termcolor`

It's done!

Expand All @@ -83,7 +83,7 @@ Run:

```python
cd PiSavar
python pisavar.py -h
python3 pisavar.py -h
```

### Screenshots
Expand All @@ -94,7 +94,8 @@ python pisavar.py -h

### Demo Video

+ new: https://www.youtube.com/watch?v=zJZkPz9ZPMk
+ new: update: https://youtu.be/82t14LtWbWE
+ old: https://www.youtube.com/watch?v=zJZkPz9ZPMk
+ old: https://youtu.be/P7mfh37NZc0

### Authors
Expand Down
Binary file removed images/attack.png
Binary file not shown.
Binary file removed images/dosnew.png
Binary file not shown.
Binary file modified images/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/pisavar_attack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/pisavar_detect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/pisavar_log2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/pisavarnew.png
Binary file not shown.
62 changes: 31 additions & 31 deletions pisavar.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# coding=utf-8

# Modulles
Expand All @@ -6,7 +7,7 @@
import argparse
from termcolor import colored
from argparse import RawTextHelpFormatter
import commands
import subprocess
import netifaces
from scapy.all import *
from termcolor import colored
Expand Down Expand Up @@ -38,7 +39,7 @@
the attacking device.


Pisavar Methods =
Pisavar Methods:

1 : Identify and log only PineAP activities
2 : Identify, attack and log PineAP activities
Expand All @@ -50,7 +51,6 @@
parser.add_argument('-i', '--interface',required=True, help="Interface (Monitor Mode)", type=str)
args = parser.parse_args()


def logging(log):
with open("/var/log/pisavar.log", "a") as f:
f.write(str(log)+"\n")
Expand Down Expand Up @@ -82,21 +82,21 @@ def pp_analysis(info_list, pp, pisavar_method):
"""
for i in info_list:
bssid, ssid= i.split("=*=")
if bssid not in pp.keys():
if bssid not in list(pp.keys()):
pp[bssid] = []
pp[bssid].append(ssid)
elif bssid in pp.keys() and ssid not in pp[bssid]:
elif bssid in list(pp.keys()) and ssid not in pp[bssid]:
pp[bssid].append(ssid)

"""
Detects networks opened by PineAP Suite.
"""
for v in pp.keys():
for v in list(pp.keys()):
if len(pp[v]) >= 2 and v not in blacklist:
print colored("\033[1m[*] PineAP module activity was detected.", 'magenta', attrs=['reverse', 'blink'])
print "\033[1m[*] MAC Address : ", v
print "\033[1m[*] FakeAP count: ", len(pp[v])
log_time = time.strftime("%c")
print(colored("\033[1m[*] PineAP module activity was detected.", 'magenta', attrs=['reverse', 'blink']))
print("\033[1m[*] MAC Address : ", v)
print("\033[1m[*] FakeAP count: ", len(pp[v]))
log_time = time.strftime("%c")
blacklist.append(v)
if pisavar_method == "2":
pp_deauth(blacklist)
Expand All @@ -122,7 +122,7 @@ def pp_deauth(blacklist):
Starts deauthentication attack for PineAP Suite.
"""
attack_start = "[*] Attack has started for " + str(blacklist)
print colored(attack_start, 'red', attrs=['reverse', 'blink'])
print(colored(attack_start, 'red', attrs=['reverse', 'blink']))
time.sleep(2)
channel = 1
for target in blacklist:
Expand All @@ -131,31 +131,31 @@ def pp_deauth(blacklist):
deauth = RadioTap() / Dot11(addr1="ff:ff:ff:ff:ff:ff", addr2=target.lower(), addr3=target.lower()) / Dot11Deauth()
sendp(deauth, iface=iface, count=120, inter=.2, verbose=False)
time.sleep(1)
print colored("[*] Attack has completed..", 'green', attrs=['reverse', 'blink'])
print(colored("[*] Attack has completed..", 'green', attrs=['reverse', 'blink']))
time.sleep(2)


if __name__ == '__main__':
path = "/var/log/pisavar/pisavar.log"
os.system("reset")
now = time.strftime("%c")
print(banner_intro)
print(DESCRIPTION)
iface = args.interface
mode = "Monitor"
pisavar_method = args.attack_method
os.system("reset")
now = time.strftime("%c")
print banner_intro
print "Information about test:"
print "----------"*5
print "[*] Start time: ", now
print "[*] Detects PineAP module activity and starts deauthentication attack \n (for fake access points - WiFi Pineapple Activities Detection) "
print "------------"*7
print("Information about test:")
print("----------"*5)
print("[*] Start time: ", now)
print("[*] Detects PineAP module activity and starts deauthentication attack \n (for fake access points - WiFi Pineapple Activities Detection) ")
print("------------"*7)
while True:
time.sleep(10)
channel = 0
blacklist = []
info_list = []
pp = {}
sniff_channel_hop(iface)
blacklist = pp_analysis(info_list, pp, pisavar_method)
time.sleep(2)
if len(blacklist)!=0:
print "--------"*5
time.sleep(10)
channel = 0
blacklist = []
info_list = []
pp = {}
sniff_channel_hop(iface)
blacklist = pp_analysis(info_list, pp, pisavar_method)
time.sleep(2)
if len(blacklist)!=0:
print("--------"*5)