Skip to content

Commit

Permalink
Merge pull request ICSec#20 from stryngs/main
Browse files Browse the repository at this point in the history
2.0.8 release
  • Loading branch information
stryngs authored Nov 7, 2022
2 parents 0d7d85d + 8cd2c1f commit 118c2c1
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 88 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,31 @@ WEP using 1 NIC with airtun-ng
```
## Typical usage
airtun-ng -a <BSSID> -w <WEPKEY> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i at0 -m at0 --injection payloads/demo --tun
```

WEP using 2 NICs with airtun-ng
```
## Niche usage
airtun-ng -a <BSSID> -w <WEPKEY> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i <Injecting NIC> -m at0 --injection payloads/demo --inj man --tun
```

WPA using 1 NIC with airtun-ng
```
## Typical usage
airtun-ng -a <BSSID> -e <ESSID> -p <PSK> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i at0 -m at0 --tun --injection payloads/demo
```

WPA using 2 NICs with airtun-ng
```
## Niche usage
airtun-ng -a <BSSID> -e <ESSID> -p <PSK> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i <Injecting NIC> -m at0 --tun --injection payloads/demo --inj man
```

Expand Down
Binary file removed RESOURCEs/airpwn-ng-2.0.6.tar.gz
Binary file not shown.
Binary file added RESOURCEs/airpwn-ng-2.0.8.tar.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions SRC/README
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,31 @@ WEP using 1 NIC with airtun-ng
```
## Typical usage
airtun-ng -a <BSSID> -w <WEPKEY> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i at0 -m at0 --injection payloads/demo --tun
```

WEP using 2 NICs with airtun-ng
```
## Niche usage
airtun-ng -a <BSSID> -w <WEPKEY> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i <Injecting NIC> -m at0 --injection payloads/demo --inj man --tun
```

WPA using 1 NIC with airtun-ng
```
## Typical usage
airtun-ng -a <BSSID> -e <ESSID> -p <PSK> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i at0 -m at0 --tun --injection payloads/demo
```

WPA using 2 NICs with airtun-ng
```
## Niche usage
airtun-ng -a <BSSID> -e <ESSID> -p <PSK> <Monitoring NIC>
ifconfig at0 up
python3 ./airpwn-ng -i <Injecting NIC> -m at0 --tun --injection payloads/demo --inj man
```

Expand Down
20 changes: 15 additions & 5 deletions SRC/airpwn_ng/lib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
import signal
import subprocess
import sys
from airpwn_ng.lib.styles import File
# from airpwn_ng.lib.styles import File
from airpwn_ng.lib.visuals import Bcolors
from airpwn_ng.lib.packet_handler import PacketHandler
from airpwn_ng.lib.parameters import TargetParameters
from airpwn_ng.lib.sniffer import Sniffer

class Core(object):
__slots__ = ('args',)

def __init__(self, args):
self.args = args
Expand Down Expand Up @@ -73,7 +77,7 @@ def main(self):
## Broadcast mode
if self.args.t is None:
print (Bcolors.WARNING + '[!] You are in broadcast mode.')
print ('[!] This means you will inject packets into all targetss you are able to detect.')
print ('[!] This means you will inject packets into all targets you are able to detect.')
print ('[!] Use with caution.' + Bcolors.ENDC)

## Targeted mode
Expand All @@ -85,6 +89,12 @@ def main(self):
for target in self.args.t:
print (Bcolors.OKGREEN + '[+] Adding target ' + Bcolors.OKBLUE + target + Bcolors.ENDC)

## Launch the handler
style = File()
style.handler(self.args)
## Target parameters
tp = TargetParameters(inject_file = self.args.injection)

## Packet handling
ph = PacketHandler(self.args, tp)

## Begin sniffing
snif = Sniffer(ph, self.args)
snif.threaded_sniff(self.args)
17 changes: 0 additions & 17 deletions SRC/airpwn_ng/lib/headers.py

This file was deleted.

29 changes: 18 additions & 11 deletions SRC/airpwn_ng/lib/injector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import scapy.arch
import time
from .headers import Headers
from .visuals import Bcolors
from scapy.config import conf
from scapy.layers.dot11 import RadioTap, Dot11, Dot11QoS
Expand All @@ -11,15 +10,29 @@

class Injector(object):
"""Uses scapy to inject packets on the networks"""
__slots__ = ('interface',
'args',
'injSocket',
'injMac')

def __init__(self, args):
self.interface = args.i
self.args = args
self.hdr = Headers()
self.injSocket = conf.L2socket(iface = self.interface)
if (args.m != args.i) or args.tun is True:
self.injMac = scapy.arch.get_if_hwaddr(self.interface)


def hdrGen(self, injection):
""" Create the HTML headers """
return '\r\n'.join(['HTTP/1.1 200 OK',
'Date: {}'.format(time.strftime('%a, %d %b %Y %H:%M:%S GMT', time.gmtime())),
'Server: Apache',
'Content-Length: {}'.format(len(injection)),
'Connection: close',
'Content-Type: text/html\r\n\r\n'])


def inject(self,
tgtmac,
rtrmac,
Expand All @@ -40,10 +53,6 @@ def inject(self,
FIN/ACK flag is sent to the target with this method.
"""

## Headers
headers = self.hdr.default(injection)

if self.args.tun is False:

## Monitor injection
Expand All @@ -69,7 +78,7 @@ def inject(self,
ack = int(acknum)
)\
/Raw(
load = headers + injection
load = self.hdrGen(injection) + injection
)

if TSVal is not None and TSecr is not None:
Expand All @@ -86,7 +95,6 @@ def inject(self,
]
## Managed injection
else:
headers = self.hdr.default(injection)
packet = Ether(
src = self.injMac,\
dst = tgtmac\
Expand All @@ -103,7 +111,7 @@ def inject(self,
ack = int(acknum)
)\
/Raw(
load = headers + injection
load = self.hdrGen(injection) + injection
)

if TSVal is not None:
Expand All @@ -122,7 +130,6 @@ def inject(self,
## Managed
else:
try:
headers = self.hdr.default(injection)
packet = Ether(
src = self.injMac,\
dst = tgtmac\
Expand All @@ -139,7 +146,7 @@ def inject(self,
ack = int(acknum)
)\
/Raw(
load = headers + injection
load = self.hdrGen(injection) + injection
)

if TSVal is not None:
Expand Down
1 change: 1 addition & 0 deletions SRC/airpwn_ng/lib/menu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse

class Menu(object):
__slots__ = ('parser',)

def __init__(self):
self.parser = argparse.ArgumentParser(description = 'airpwn-ng - the new and improved 802.11 packet injector')
Expand Down
12 changes: 5 additions & 7 deletions SRC/airpwn_ng/lib/packet_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@

class PacketHandler(object):
"""This class does all the heavy-lifting."""
__slots__ = ('i',
'injector',
'target_parameters',
'trigger')

def __init__(self, args, tp):
self.i = args.i
self.target_parameters = tp

# print(keyword_parameters)

if self.i is None:
print ('[ERROR] No injection interface selected')
exit(1)

## Argument handling
# args = keyword_parameters.get('Args')

## Trigger setup
if args.trigger is None:
self.trigger = 'GET /'
Expand Down Expand Up @@ -63,7 +61,7 @@ def proc_handler(self, packet, args):
TSVal = None
TSecr = None

# print(tgtmac, rtrmac, tgtip, svrip, tgtport, svrport, acknum, seqnum, request, TSVal, TSecr)
# print(tgtmac, rtrmac, dstmac, tgtip, svrip, tgtport, svrport, acknum, seqnum, request, TSVal, TSecr)
return (tgtmac,
rtrmac,
dstmac,
Expand Down
5 changes: 5 additions & 0 deletions SRC/airpwn_ng/lib/parameters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
class TargetParameters(object):
"""An instance of this class is always necessary to run the application as
it holds the injections."""
__slots__ = ('file_inject',
'file_injected',
'in_request',
'in_request_handler',
'inject_file')

def __init__(self, *positional_parameters, **keyword_parameters):
self.inject_file = keyword_parameters.get('inject_file')
Expand Down
5 changes: 5 additions & 0 deletions SRC/airpwn_ng/lib/sniffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class Sniffer(object):
It uses an instance of PacketHandler as the processing engine
for packets received from scapy's sniff() function.
"""
__slots__ = ('bp',
'bssid',
'm',
'packethandler',
'tgtList')

def __init__(self, packethandler, args):
self.m = args.m
Expand Down
27 changes: 0 additions & 27 deletions SRC/airpwn_ng/lib/styles.py

This file was deleted.

19 changes: 0 additions & 19 deletions SRC/airpwn_ng/lib/target.py

This file was deleted.

2 changes: 1 addition & 1 deletion SRC/airpwn_ng/lib/visuals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Bcolors(object):
"""Define the color schema"""

__slots__ = tuple()
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
Expand Down
2 changes: 1 addition & 1 deletion SRC/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name = 'airpwn-ng',
version = '2.0.6',
version = '2.0.8',
author = 'stryngs and Jack64',
packages = ['airpwn_ng', 'airpwn_ng.lib'],
include_package_data = True,
Expand Down

0 comments on commit 118c2c1

Please sign in to comment.