hackingtool/tools/steganography.py
naveennamani eaa920a7e3 Refactored the whole project
List of changes

+ Handling information about a tool has been improved a lot by providing a `HackingTool` class, which takes care of showing the options, running the selected option, executing the required commands
+ This class is designed with flexibililty and simplicity in mind, so adding a new tool is a lot easier, mention TITLE, DESCRIPTION, list of INSTALL_COMMANDS, RUN_COMMANDS and PROJECT_URL and there you go...

+ grouping all the `HackingTool`s is also made super simpler by providing a `HackingToolsCollection` class which groups the tools into their respective categories. Just add the instances of `HackingTool` classes to the TOOLS property of the `HackingToolsCollection`.

+ Refactored all the tools into separate files based on their categories.
+ Added a READM_template.md and generate_readme.py script to automatically generate Table of contents and the list of tools available automatically.
+ Now each tool in the README.md points to its project url if provided. This makes it easier to visit the project from the readme.
2020-08-14 16:41:59 +05:30

69 lines
2.1 KiB
Python

# coding=utf-8
import subprocess
from core import HackingTool
from core import HackingToolsCollection
from core import validate_input
class SteganoHide(HackingTool):
TITLE = "SteganoHide"
INSTALL_COMMANDS = ["sudo apt-get install steghide -y"]
def run(self):
choice_run = input(
"[1] Hide\n"
"[2] Extract\n"
"[99]Cancel\n"
">> ")
choice_run = validate_input(choice_run, [1, 2, 99])
if choice_run is None:
print("Please choose a valid input")
return self.run()
if choice_run == 99:
return
if choice_run == 1:
file_hide = input("Enter Filename you want to Embed (1.txt) >> ")
file_to_be_hide = input("Enter Cover Filename(test.jpeg) >> ")
subprocess.run(
["steghide", "embed", "-cf", file_to_be_hide, "-ef", file_hide])
elif choice_run == "2":
from_file = input("Enter Filename From Extract Data >> ")
subprocess.run(["steghide", "extract", "-sf", from_file])
class StegnoCracker(HackingTool):
TITLE = "StegnoCracker"
DESCRIPTION = "SteganoCracker is a tool that uncover hidden data inside " \
"files\n using brute-force utility"
INSTALL_COMMANDS = [
"pip3 install stegcracker && pip3 install stegcracker -U --force-reinstall"]
def run(self):
filename = input("Enter Filename:- ")
passfile = input("Enter Wordlist Filename:- ")
subprocess.run(["stegcracker", filename, passfile])
class Whitespace(HackingTool):
TITLE = "Whitespace"
DESCRIPTION = "Use whitespace and unicode chars for steganography"
INSTALL_COMMANDS = [
"sudo git clone https://github.com/beardog108/snow10.git",
"sudo chmod -R 755 snow10"
]
RUN_COMMANDS = ["cd snow10 && firefox index.html"]
PROJECT_URL = "https://github.com/beardog108/snow10"
class SteganographyTools(HackingToolsCollection):
TITLE = "Steganograhy tools"
TOOLS = [
SteganoHide(),
StegnoCracker(),
Whitespace()
]