Skip to content

Commit

Permalink
minor fixes and removed the warning about ipv6 routes
Browse files Browse the repository at this point in the history
  • Loading branch information
fportantier committed Mar 16, 2018
1 parent 5b1476b commit ab833ee
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 6 deletions.
2 changes: 2 additions & 0 deletions habu/cli/cmd_arping.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import click

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ARP, IP, TCP, Ether, conf, srp


Expand Down
4 changes: 3 additions & 1 deletion habu/cli/cmd_arpoison.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import time

import logging
import click

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ARP, Ether, conf, getmacbyip, sendp


Expand Down
4 changes: 4 additions & 0 deletions habu/cli/cmd_arpsniff.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from time import time
import click
import habu.lib.manuf
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ARP, IP, TCP, sniff, conf

hosts = {}
Expand Down
9 changes: 6 additions & 3 deletions habu/cli/cmd_b64.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import click
import base64
import sys
#import codecs


@click.command()
@click.argument('f', type=click.File('r'))
@click.argument('f', type=click.File('rb'))
@click.option('-d', 'do_decode', is_flag=True, default=False, help='decode instead of encode')
def cmd_b64(f, do_decode):

print("WARNING: This tool has problems decoding b64 data.", file=sys.stderr)

data = f.read()

if not data:
Expand All @@ -17,9 +20,9 @@ def cmd_b64(f, do_decode):
#decoded = codecs.decode(data, "hex")

if do_decode:
print(base64.b64decode(data).decode())
print(base64.b64decode(data), file=sys.stdout)
else:
print(base64.b64encode(data.encode()).decode())
print(base64.b64encode(data).decode())


if __name__ == '__main__':
Expand Down
4 changes: 4 additions & 0 deletions habu/cli/cmd_dhcp_discover.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import click
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ICMP, IP, conf, sr1, UDP, TCP, Ether, BOOTP, DHCP, get_if_raw_hwaddr, srp


Expand Down
4 changes: 4 additions & 0 deletions habu/cli/cmd_ping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import click
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ICMP, IP, conf, sr1
from time import sleep

Expand Down
4 changes: 4 additions & 0 deletions habu/cli/cmd_portscan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import click
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ICMP, IP, conf, sr, sr1, TCP


Expand Down
4 changes: 4 additions & 0 deletions habu/cli/cmd_protoscan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import click
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ICMP, IP, conf, sr, sr1, TCP


Expand Down
5 changes: 4 additions & 1 deletion habu/cli/cmd_synflood.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import sys
import logging
from random import randint

import click

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import IP, TCP, Ether, RandMAC, conf, sendp


Expand Down Expand Up @@ -33,7 +36,7 @@ def cmd_synflood(ip, interface, count, port, forgemac, forgeip, verbose):

counter = 0

print("please, remember to block your RST responses")
print("Please, remember to block your RST responses", file=sys.stderr)

while True:
if forgeip:
Expand Down
4 changes: 4 additions & 0 deletions habu/cli/cmd_tcpflags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import click
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ICMP, IP, conf, sr, sr1, TCP


Expand Down
3 changes: 3 additions & 0 deletions habu/cli/cmd_tcpscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import click
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import IP, TCP, conf, sr, sr1


Expand Down
4 changes: 4 additions & 0 deletions habu/cli/cmd_traceroute.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import click
import logging

logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

from scapy.all import ICMP, IP, conf, sr1, UDP, TCP


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='habu',
version='0.0.49',
version='0.0.50',
description='Python Network Hacking Toolkit',
long_description=readme,
author='Fabian Martinez Portantier',
Expand Down

0 comments on commit ab833ee

Please sign in to comment.