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

Adding tests, refactoring code, adding documentation #85

Merged
merged 25 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e55ff0c
Removed unneccessary dependencies
KingAkeem May 5, 2018
21cc45a
Adding pyinstaller (module being used to turn torBot into executable)…
May 6, 2018
c9add89
Beginning development on Go branch again
May 7, 2018
d112b5b
Adding documentation and modularizing functions.
May 7, 2018
5d9d7bd
Fixing modules, going to add color next
May 7, 2018
dd93363
Adding interrupt and fixing concurrency issues
KingAkeem May 8, 2018
d353d7a
Checking system calls for weird responses
KingAkeem May 8, 2018
e4ed4b4
Added interface to make checkURL function reusuable and refactoring
May 8, 2018
ca93975
Added some testing for go module
May 8, 2018
cca1124
Handling case of no urls being found
May 8, 2018
376f45f
Adding more coverage for tests
May 9, 2018
8ec4e62
Removed shared object and added file to .gitignore
KingAkeem May 9, 2018
fb8a944
Adding testing documenation
KingAkeem May 9, 2018
66d154e
Fixed some errors with README.md
KingAkeem May 16, 2018
6cd12a6
Merge remote-tracking branch 'origin/gobot' into dev
KingAkeem May 17, 2018
816b24a
Merge branch 'dev' of github.com:DedSecInside/TorBot into dev
KingAkeem May 17, 2018
6fa3bb2
Updated Change log and requirements
KingAkeem May 17, 2018
da52bb3
Merge branch 'dev' of github.com:KingAkeem/TorBot into dev
KingAkeem May 17, 2018
caa2536
Added some shell scripts and made some minor fixes
KingAkeem May 17, 2018
b8ef7b6
Merge branch 'dev' into gobot
KingAkeem May 17, 2018
bb1192a
Merge branch 'gobot' into dev
KingAkeem May 17, 2018
4e00944
Updated Change log
KingAkeem May 17, 2018
816df4a
Merge branch 'dev' of github.com:DedSecInside/TorBot into dev
KingAkeem Jun 16, 2018
0b391a3
Merge branch 'dev' of github.com:DedSecInside/TorBot into dev
KingAkeem Jul 4, 2018
620eebd
Merge branch 'dev' into dev
KingAkeem Jul 30, 2018
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
27 changes: 17 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Modules
modules/.ropeproject/
modules/__pycache__/
modules/.pytest_cache/
# Module Ignores
modules/*.pyc
modules/__init__.py
modules/__pycache__/
modules/.pytest_cache
modules/.ropeproject/
modules/lib/*.so

# Tests
tests/.ropeproject/
# Tests Ignores
tests/.pytest_cache
tests/*.pyc
tests/__pycache__/
tests/.pytest_cache/
tests/.ropeproject/

# Main
__pycache__
# Cache
.cache
*.pyc
.pytestc*
.pytest_cache

# Misc
torBot
.*.swp
.ropeproject/
.idea/
.pytest_cache
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
--------------------
All notable changes to this project will be documented in this file.

## 1.3.0 | Future

### Changed
* Moderate code improvements
* Updated README.md
* Updated dependencies
* Modularize and documented Golang library
* Using Golang library instead of Python library for getting links

### Added
* Unit tests for Golang Library
* Installation shell script to create torBot binary
* Testing documentation for Golang test suite.
* Test for getting links that uses a Mock Object to reproduce tests without touching actual servers.
* Script for getting Golang dependencies
* Script for building Golang shared object
* Installs Golang dependencies when install.sh is executed


## 1.2.0 | Present (Stable)

### Changed
Expand Down
59 changes: 44 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
<pre>


████████╗ ██████╗ ██████╗ ██████╗ ██████╗ ████████╗
╚══██╔══╝██╔═══██╗██╔══██╗ ██╔══██╗██╔═████╗╚══██╔══╝
██║ ██║ ██║██████╔╝ ██████╔╝██║██╔██║ ██║
██║ ██║ ██║██╔══██╗ ██╔══██╗████╔╝██║ ██║
██║ ╚██████╔╝██║ ██║ ██████╔╝╚██████╔╝ ██║
╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝


████████╗ ██████╗ ██████╗ ██████╗ ██████╗ ████████╗
╚══██╔══╝██╔═══██╗██╔══██╗ ██╔══██╗██╔═████╗╚══██╔══╝
██║ ██║ ██║██████╔╝ ██████╔╝██║██╔██║ ██║
██║ ██║ ██║██╔══██╗ ██╔══██╗████╔╝██║ ██║
██║ ╚██████╔╝██║ ██║ ██████╔╝╚██████╔╝ ██║
╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝



`.` `
``.:.--.`
.-+++/-`
`+sso:`
`` /yy+.
-+.oho.
o../+y
-s.-/:y:`
.:o+-`--::oo/-`
`/o+:.```---///oss+-
.+o:.``...`-::-+++++sys-
:y/```....``--::-yooooosh+
-h-``--.```..-:-::ssssssssd+
h:``:.``....`--:-++hsssyyyym.
.d.`/.``--.```:--//odyyyyyyym/
`d.`+``:.```.--/-+/smyyhhhhhm:
os`./`/````/`-/:+oydhhhhhhdh`
`so.-/-:``./`.//osmddddddmd.
/s/-/:/.`/..+/ydmdddddmo`
`:oosso/:+/syNmddmdy/.
`-/++oosyso+/.`


██████╗ ███████╗██████╗ ███████╗██████╗ ██████╗ ██╗███╗ ██╗███████╗██╗██████╗ ███████╗
██╔══██╗██╔════╝██╔══██╗██╔════╝╚════██╗██╔════╝ ██║████╗ ██║██╔════╝██║██╔══██╗██╔════╝
██║ ██║█████╗ ██║ ██║███████╗ █████╔╝██║ ██║██╔██╗ ██║███████╗██║██║ ██║█████╗
██║ ██║██╔══╝ ██║ ██║╚════██║ ╚═══██╗██║ ██║██║╚██╗██║╚════██║██║██║ ██║██╔══╝
██████╔╝███████╗██████╔╝███████║██████╔╝╚██████╗ ██║██║ ╚████║███████║██║██████╔╝███████╗
╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝╚═════╝ ╚══════╝
</pre>
[![Build Status](https://travis-ci.org/DedSecInside/TorBot.svg?branch=dev)](https://travis-ci.org/DedSecInside/TorBoT)
[![](https://img.shields.io/badge/Donate-Bitcoin-blue.svg?style=flat)](https://blockchain.info/address/14st7SzDbQZuu8fpQ74x477WoRJ7gpHFaj)
Expand Down Expand Up @@ -58,14 +87,14 @@ the following steps:
...(will be updated)

## Contribute
Contributions to this project are always welcome.
Contributions to this project are always welcome.
To add a new feature fork the dev branch and give a pull request when your new feature is tested and complete.
If its a new module, it should be put inside the modules directory and imported to the main file.
The branch name should be your new feature name in the format <Feature_featurename_version(optional)>. For example, <i>Feature_FasterCrawl_1.0</i>.
Contributor name will be updated to the below list. :D

## Dependencies
1. Tor
## Dependencies
1. Tor
2. Python 3.x (Make sure pip3 is installed)
3. requests
4. Beautiful Soup 4
Expand All @@ -83,11 +112,12 @@ Before you run the torBot make sure the following things are done properly:
* Run tor service
`sudo service tor start`

* Make sure that your torrc is configured to SOCKS_PORT localhost:9050
* Make sure that your torrc is configured to SOCKS_PORT localhost:9050

On Linux platforms, you can make an executable for TorBot by using the install.sh script.
You will need to give the script the correct permissions using `chmod +x install.sh`
Now you should have an executable file named torBot, run `./torBot` to execute the program.
Now you can run `./install.sh` to create the torBot binary.
Run `./torBot` to execute the program.

An alternative way of running torBot is shown below, along with help instructions.

Expand Down Expand Up @@ -166,4 +196,3 @@ GNU Public License
- [X] [robly78746](https://github.com/robly78746) - New Contributor

![](https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Opensource.svg/200px-Opensource.svg.png)

4 changes: 4 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

# Get Golang Dependencies
go get github.com/mgutz/ansi
go get golang.org/x/net/html

# Makes directory for dependencies and executable to be installed
mkdir -p tmp_build
mkdir -p tmp_dist
Expand Down
21 changes: 21 additions & 0 deletions modules/go_linker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sys

from ctypes import cdll, c_char_p, c_longlong, c_int, Structure

go_linker = cdll.LoadLibrary("modules/lib/go_get_urls.so")

class GoString(Structure):
_fields_ = [("p", c_char_p), ("n", c_longlong)]

go_linker.GetLinks.argtypes = [GoString, GoString, GoString, c_int]

def GetLinks(url, addr, port, timeout):

url = url.encode('utf-8')
addr = addr.encode('utf-8')
port = str(port).encode('utf-8')

go_linker.GetLinks(GoString(url, len(url)),
GoString(addr, len(addr)),
GoString(port, len(port)),
timeout)
81 changes: 0 additions & 81 deletions modules/go_modules/getLinks.go

This file was deleted.

18 changes: 0 additions & 18 deletions modules/go_modules/getLinks.py

This file was deleted.

Binary file removed modules/go_modules/goBot.so
Binary file not shown.
2 changes: 2 additions & 0 deletions modules/lib/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Build script for .so file
go build -o go_get_urls.so -buildmode=c-shared go_get_urls.go
3 changes: 3 additions & 0 deletions modules/lib/go_dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Download Golang dependencies
go get github.com/mgutz/ansi
go get golang.org/x/net/html
Loading