Skip to content

Commit

Permalink
Initial repo layout
Browse files Browse the repository at this point in the history
  • Loading branch information
digehode committed Jul 29, 2020
1 parent 01d8ded commit be83c75
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
INVENV = $(shell pip3 -V | grep 'venv')
current_dir = $(shell pwd)

prereqs: venvcheck FORCE
pip install -r requirements.txt

venv: FORCE
python3 -m venv venv

docs:
pdoc --html ./src/harbourmaster.py --force

venvcheck:
ifeq ($(INVENV),)
$(error You should only run this from within the venv. Use '. ./venv/bin/activate')
else
@echo "venv check passed\n"
endif


test: FORCE venvcheck
py.test -v tests/


FORCE:
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# harbourmaster
---
title: Harbourmaster
author: James Shuttleworth and YOUR NAME HERE
---

# HarbourMaster

Harbourmaster is a simple port-scanning tool

# Introduction

This is a very simple tool, but it does (or will do) a few useful things.

In cybersecurity, we often have to work with data in different
representations. For example, when creating payloads for exploits, we
might have to switch between bytes represented as their ASCII values
and their binary, decimal or hexadecimal (hex) representation. For
example, the capital letter A has the ASCII code 65. 65 in hex
is 41. In octal it is 101, and in binary it is 01000001.


# Completing Transcoder

TODO:


# TODO - things left to do before students get access

- Clear up TODO items
- Put proper pydoc generation in and fill in all docstrings
- Write bit about cloning repo

4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wheel
colored
pytest
pdoc3
16 changes: 16 additions & 0 deletions src/harbourmaster.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!python
"""Simple program for scanning ports on a given host and acting on results"""
import colored


def testPort(host:str,portnum:int):
"""Given a host (IP or name) and a port number, connect if possible and return any data transmitted.

Args:
host (string): the host to scan. Can be an IP address or hostname
portnum (int): the port number, between 0 and 65535

Returns:
string or None: the data returned by the connection, or None if the connection failed.
"""
return "Not implemented"
6 changes: 6 additions & 0 deletions tests/test_hm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest
import sys
sys.path.append("./src/")
import harbourmaster

#TODO: write tests

0 comments on commit be83c75

Please sign in to comment.