MCPcopy Index your code
hub / github.com/LCBOWER33/StegoScan / main

Function main

StegoScan.py:1748–1891  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1746
1747
1748def main():
1749 global results_folder
1750 parser = argparse.ArgumentParser(description="Download specific or all file types from a webpage.")
1751 parser.add_argument('-u', '--url', nargs='+',
1752 help="Base URL(s), IP address(es), or IP range(s) to scrape files from")
1753 parser.add_argument('-t', '--types',
1754 help="Comma-separated list of file extensions (e.g., pdf,jpg,png) or '*' for all files")
1755 parser.add_argument('-n', '--num', type=int, default=10,
1756 help="Number of files to download (ignored if '-t *' is used)")
1757 parser.add_argument('-o', '--output', help="Directory to save downloaded files")
1758 parser.add_argument('-m', '--mode',
1759 help="Test mode: specify test case(s) (e.g., lsb,hist) or 'all' to run all tests")
1760 parser.add_argument('-l', '--local', help="Path to a local file or directory to copy into the output directory")
1761 parser.add_argument('--max_depth', type=int, default=1, help="Maximum depth of the crawl (default is 1)")
1762 args = parser.parse_args()
1763
1764 # Make sure all tools are installed here
1765 if platform.system() == "Windows":
1766 return
1767
1768 elif platform.system() == "Linux":
1769 print("Installing tools on Linux...")
1770 install_commands = [
1771 "sudo apt update -y > /dev/null 2>&1",
1772 "sudo apt install -y stegdetect ruby binwalk exiftool steganography stego-rat stegosuite john > /dev/null 2>&1",
1773 "sudo gem install zsteg stegseek > /dev/null 2>&1"
1774 ]
1775 for command in install_commands:
1776 result = run_silent_command(command)
1777 if result:
1778 prGreen(f"Success: {command}")
1779 else:
1780 prRed(f"Failure: {command}")
1781 check_and_install_poppler()
1782 # print("All tools installed successfully on Linux!")
1783
1784 if len(sys.argv) == 1:
1785 print("No arguments provided. Load GUI...")
1786 create_gui()
1787 else:
1788 output_dir = os.path.abspath(args.output)
1789 os.makedirs(output_dir, exist_ok=True)
1790
1791 if args.local:
1792 copy_local_files(args.local, output_dir)
1793
1794 #print("URL NULL: ", args.url != "", type(args.url))
1795
1796 if args.url:
1797 sources = []
1798 for u in args.url:
1799 if re.match(r'\d+\.\d+\.\d+\.\d+', u): # Single IP
1800 if is_web_server(u):
1801 sources.append(f"http://{u}/")
1802 elif re.match(r'^\d+\.\d+\.\d+\.\d+/\d+$', u): # IP range
1803 sources.extend([f"http://{ip}/" for ip in process_ip_range(u)])
1804 else:
1805 sources.append(u if u.startswith("http") else f"http://{u}/")

Callers 1

StegoScan.pyFile · 0.85

Calls 15

run_silent_commandFunction · 0.85
prGreenFunction · 0.85
prRedFunction · 0.85
create_guiFunction · 0.85
copy_local_filesFunction · 0.85
is_web_serverFunction · 0.85
process_ip_rangeFunction · 0.85
extract_from_fileFunction · 0.85
process_imagesFunction · 0.85
clean_up_folderFunction · 0.85
t_lsbFunction · 0.85

Tested by

no test coverage detected