├── README.md ├── upload-macos.sh ├── upload-unix.sh └── upload-win.cmd /README.md: -------------------------------------------------------------------------------- 1 | # REDD's PCAP UPLOADER (RPU) 2 | 3 | A cross-platform utility for uploading PCAP files to Online Hash Crack (OHC). 4 | 5 | ## About the Project 6 | 7 | RPU was created to give the Flipper Zero WiFi Dev Board and Marauder Community an easy way to upload all those wonderful 8 | PCAP files to OHC - ([OnlineHashCrack.com](https://OnlineHashCrack.com)) and get results in Email on-the-go. RPU was written in BATCH (Windows 9 | Systems) and BASH (Most Unix Based Systems) to provide as wide of compatibility as possible. 10 | 11 | ## Version 2.1 - New Features & Improvements 12 | 13 | This version includes three platform-specific scripts that maintain consistent behavior and output across different operating systems: 14 | 15 | - `upload-unix.sh` - For Linux and other Unix-based systems 16 | - `upload-macos.sh` - Specifically optimized for macOS 17 | - `upload-win.cmd` - For Windows 10 and newer 18 | 19 | ### New Features 20 | 21 | - Email validation across all platforms 22 | - Automatic creation of a "sent" directory for processed files 23 | - Persistent email storage (saves your email in email.txt) 24 | - Compatible path handling for each operating system 25 | - Consistent output messages across all platforms 26 | - Upload history logging (in upload_history.log) 27 | - Recursive directory scanning 28 | - Optional PCAP file verification 29 | - Progress indicators for uploads 30 | - Command-line options for scripting 31 | 32 | ## Little About PCAP Files 33 | 34 | ### What is a PCAP? 35 | Packet capture (PCAP) is a networking practice involving the interception of data packets travelling over a network. 36 | Once the packets are captured, they can be stored by IT teams for further analysis. 37 | 38 | ### What is packet capture used for? 39 | Packet capturing helps to analyze networks, identify network performance issues and manage network traffic. It allows 40 | IT teams to detect intrusion attempts, security issues, network misuse, packet loss, and network congestion. It enables 41 | network managers to capture data packets directly from the computer network. The process is known as packet sniffing. 42 | 43 | IT teams prefer using packet monitoring software to perform crucial tasks, such as: 44 | * Monitoring WAN Traffic 45 | * Tracking Network Usage 46 | * Isolating Compromised Systems 47 | * Testing Security of WAN's 48 | * Detecting Suspicious Traffic 49 | * Identify Rogue Attacks 50 | 51 | ## Command-Line Options 52 | 53 | All scripts now support the following command-line options: 54 | 55 | ``` 56 | -h, --help Show this help message 57 | -r, --recursive Search for PCAP files in subdirectories 58 | -v, --verify Verify files are valid PCAP files before upload 59 | -n, --no-verify Skip PCAP file verification (default behavior) 60 | -s, --silent Hide progress indicators 61 | -e EMAIL Specify email address for results 62 | ``` 63 | 64 | Example: `./upload-unix.sh -r -e your@email.com` 65 | 66 | ## How to Use 67 | 68 | ### Windows 69 | 70 | 1. Place your .pcap files in the same directory as the script 71 | 2. Double-click `upload-win.cmd` to run or use command-line options 72 | 3. Enter your email when prompted (or pre-configure in the script) 73 | 4. All PCAP files will be uploaded to OHC and moved to the "sent" folder 74 | 75 | ### macOS 76 | 77 | 1. Place your .pcap files in the same directory as the script 78 | 2. Open Terminal and navigate to the script directory 79 | 3. Make the script executable with: `chmod +x upload-macos.sh` 80 | 4. Run with: `./upload-macos.sh` or use command-line options 81 | 5. Enter your email when prompted (or pre-configure in the script) 82 | 6. All PCAP files will be uploaded to OHC and moved to the "sent" folder 83 | 84 | ### Linux/Unix 85 | 86 | 1. Place your .pcap files in the same directory as the script 87 | 2. Open Terminal and navigate to the script directory 88 | 3. Make the script executable with: `chmod +x upload-unix.sh` 89 | 4. Run with: `./upload-unix.sh` or use command-line options 90 | 5. Enter your email when prompted (or pre-configure in the script) 91 | 6. All PCAP files will be uploaded to OHC and moved to the "sent" folder 92 | 93 | ## Pre-configuring Your Email 94 | 95 | To avoid entering your email each time, you can either: 96 | 97 | 1. Edit the script directly and set the EMAIL variable at the top 98 | 2. Create a file named `email.txt` in the same directory with your email address 99 | 3. Use the `-e` command-line option when running the script 100 | 101 | ### Reset Email Address 102 | To reset the EMAIL used to receive results, just delete "email.txt" in the directory where you have the script running. The script will prompt you for your EMAIL next time you run it. 103 | 104 | ## Configuration Options 105 | 106 | You can customize the behavior by setting these options in the script: 107 | 108 | - RECURSIVE_MODE - Set to true to scan subdirectories (default: false) 109 | - VERIFY_PCAP - Set to true to verify PCAP files before upload (default: false) 110 | - SHOW_PROGRESS - Set to true to show curl progress meter (default: true) 111 | 112 | ## Requirements 113 | 114 | - Windows: curl.exe (included in Windows 10 1803 and later) 115 | - macOS/Linux: curl (usually pre-installed) 116 | 117 | ## Known Issues 118 | 119 | - Some AV's (Anti-Viruses/Firewalls) may block scripts from using CURL correctly on Windows 120 | - In Version 2.1, the issue with spaces in usernames and paths has been fixed 121 | 122 | ## Credits 123 | 124 | Created by REDD (InfoSecREDD) - Creator/Developer 125 | -------------------------------------------------------------------------------- /upload-macos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Credits: REDD 3 | # TARGET OS: macOS 4 | # Version: 2.1 - Unified macOS Version 5 | 6 | # SET YOUR EMAIL BELOW OR SET IT IN THE SCRIPT! 7 | 8 | 9 | EMAIL="" 10 | 11 | # CONFIGURATION OPTIONS 12 | RECURSIVE_MODE=false # Set to true to scan subdirectories 13 | VERIFY_PCAP=false # Set to false to skip PCAP file verification (original behavior) 14 | SHOW_PROGRESS=true # Set to true to show curl progress meter 15 | 16 | 17 | CURR_DIR="$PWD" 18 | SENT_DIR="$CURR_DIR/sent" 19 | LOG_FILE="$CURR_DIR/upload_history.log" 20 | 21 | # Check for dependencies 22 | check_dependencies() { 23 | local missing_deps=() 24 | 25 | # Check for curl - required 26 | if ! command -v curl &> /dev/null; then 27 | missing_deps+=("curl") 28 | fi 29 | 30 | # Check for file - useful for PCAP verification but not required 31 | if ! command -v file &> /dev/null; then 32 | if [ "$VERIFY_PCAP" = true ]; then 33 | echo "Note: 'file' command not found. Basic PCAP verification will be used." 34 | fi 35 | fi 36 | 37 | # Check for greadlink/realpath - helpful for path resolution 38 | if ! command -v greadlink &> /dev/null && ! command -v realpath &> /dev/null; then 39 | echo "Note: For improved path handling, consider installing GNU coreutils:" 40 | echo " brew install coreutils" 41 | fi 42 | 43 | # If curl is missing, we need to report it 44 | if [ ${#missing_deps[@]} -gt 0 ]; then 45 | echo "Error: Required dependencies missing: ${missing_deps[*]}" 46 | echo "Please install the missing dependencies and try again." 47 | echo "Using Homebrew: brew install ${missing_deps[*]}" 48 | echo "Using MacPorts: sudo port install ${missing_deps[*]}" 49 | exit 1 50 | fi 51 | } 52 | 53 | # Run dependency check 54 | check_dependencies 55 | 56 | if [ -f "email.txt" ]; then 57 | if [ "$EMAIL" == "" ]; then 58 | EMAIL_FROM_FILE=$(cat email.txt) 59 | EMAIL="$EMAIL_FROM_FILE" 60 | fi 61 | fi 62 | clear; 63 | 64 | # Check if a command exists 65 | command_exists() { 66 | command -v "$1" >/dev/null 2>&1 67 | } 68 | 69 | # Check if file is a valid PCAP 70 | is_valid_pcap() { 71 | local file="$1" 72 | if command_exists file; then 73 | # Check with file command if available 74 | file -b "$file" | grep -qi "pcap\|libpcap\|tcpdump\|capture" && return 0 75 | else 76 | # Simple header check if file command not available 77 | # Check for pcap magic numbers: d4c3b2a1 or a1b2c3d4 78 | # PCAPNG: 0a0d0d0a 79 | local magic=$(hexdump -n 4 -e '1/4 "%08x"' "$file" 2>/dev/null) 80 | if [[ "$magic" == "d4c3b2a1" || "$magic" == "a1b2c3d4" || "$magic" == "0a0d0d0a" ]]; then 81 | return 0 82 | fi 83 | fi 84 | return 1 85 | } 86 | 87 | function PAUSE(){ 88 | echo "" 89 | echo "DONE!!" 90 | read -p "Press any key to continue . . ." 91 | echo "" 92 | } 93 | 94 | function SET_EMAIL(){ 95 | read -p "Enter the Email you want to use for Results: " EMAIL 96 | echo "$EMAIL" > email.txt 97 | CHECK_EMAIL; 98 | } 99 | 100 | # Find all PCAP files 101 | function FIND_PCAPS() { 102 | local pcap_files=() 103 | 104 | if [ "$RECURSIVE_MODE" = true ]; then 105 | # Find PCAP files recursively 106 | echo "Searching for PCAP files in $CURR_DIR and subdirectories..." 107 | if command_exists find; then 108 | while IFS= read -r file; do 109 | pcap_files+=("$file") 110 | done < <(find "$CURR_DIR" -type f -name "*.pcap" 2>/dev/null) 111 | else 112 | # Fallback if find is not available 113 | pcap_files=($(ls -R 2>/dev/null | grep -i "\.pcap$")) 114 | fi 115 | else 116 | # Find PCAP files in current directory only 117 | for file in *.pcap; do 118 | # Skip if no matches found 119 | [[ -e "$file" ]] || continue 120 | pcap_files+=("$file") 121 | done 122 | fi 123 | 124 | echo "${pcap_files[@]}" 125 | } 126 | 127 | function SEND(){ 128 | local curl_opts="" 129 | # Check if any .pcap files exist before iterating 130 | local pcap_files=($(FIND_PCAPS)) 131 | 132 | if [ ${#pcap_files[@]} -gt 0 ]; then 133 | # Set curl options for progress display 134 | if [ "$SHOW_PROGRESS" = true ]; then 135 | curl_opts="-#" 136 | else 137 | curl_opts="-s" 138 | fi 139 | 140 | echo "Found ${#pcap_files[@]} PCAP files to process." 141 | 142 | for i in "${pcap_files[@]}"; do 143 | echo "Processing: $i" 144 | 145 | # Verify PCAP file if option enabled 146 | if [ "$VERIFY_PCAP" = true ]; then 147 | if ! is_valid_pcap "$i"; then 148 | echo "Warning: $i does not appear to be a valid PCAP file. Skipping." 149 | continue 150 | fi 151 | fi 152 | 153 | # Use macOS compatible path resolution 154 | UPLOAD_FILE_PATH=$(greadlink -f "$i" 2>/dev/null || realpath "$i" 2>/dev/null || echo "$PWD/$i") 155 | echo "Uploading: $i" 156 | 157 | # Execute the curl command with progress options 158 | curl $curl_opts -X POST -F "email=$EMAIL" -F "file=@$UPLOAD_FILE_PATH" https://api.onlinehashcrack.com 159 | 160 | # Create sent directory if it doesn't exist 161 | if [ ! -d "$SENT_DIR" ]; then 162 | mkdir -p "$SENT_DIR" 163 | fi 164 | 165 | # Create subdirectories in sent directory if recursive mode 166 | if [ "$RECURSIVE_MODE" = true ] && [[ "$i" == */* ]]; then 167 | rel_dir=$(dirname "$i") 168 | mkdir -p "$SENT_DIR/$rel_dir" 169 | mv "$i" "$SENT_DIR/$i" 170 | else 171 | mv "$i" "$SENT_DIR/$(basename "$i")" 172 | fi 173 | 174 | # Log the upload 175 | echo "$(date '+%Y-%m-%d %H:%M:%S') - Uploaded: $i - Email: $EMAIL" >> "$LOG_FILE" 176 | 177 | echo "Done processing: $i" 178 | echo "---------------------------------" 179 | done 180 | echo "All PCAP files have been processed." 181 | else 182 | echo "NO PCAP FILES FOUND!" 183 | echo "" 184 | fi 185 | } 186 | 187 | function CHECK_PCAPS(){ 188 | SEND; 189 | } 190 | 191 | function CHECK_EMAIL(){ 192 | # More compatible email validation for macOS 193 | if [[ "$EMAIL" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then 194 | CHECK_PCAPS; 195 | else 196 | echo "$EMAIL is NOT a Valid Email! Please try another Email." 197 | SET_EMAIL; 198 | fi 199 | } 200 | 201 | function SHOW_HELP() { 202 | echo "Usage: $0 [OPTIONS]" 203 | echo 204 | echo "Options:" 205 | echo " -h, --help Show this help message" 206 | echo " -r, --recursive Search for PCAP files in subdirectories" 207 | echo " -v, --verify Verify files are valid PCAP files before upload" 208 | echo " -n, --no-verify Skip PCAP file verification (default behavior)" 209 | echo " -s, --silent Hide progress indicators" 210 | echo " -e EMAIL Specify email address for results" 211 | echo 212 | echo "Example: $0 -r -e your@email.com" 213 | } 214 | 215 | # Parse command line arguments 216 | POSITIONAL=() 217 | while [[ $# -gt 0 ]]; do 218 | key="$1" 219 | case $key in 220 | -r|--recursive) 221 | RECURSIVE_MODE=true 222 | shift 223 | ;; 224 | -v|--verify) 225 | VERIFY_PCAP=true 226 | shift 227 | ;; 228 | -n|--no-verify) 229 | VERIFY_PCAP=false 230 | shift 231 | ;; 232 | -s|--silent) 233 | SHOW_PROGRESS=false 234 | shift 235 | ;; 236 | -e) 237 | EMAIL="$2" 238 | shift 239 | shift 240 | ;; 241 | -h|--help) 242 | SHOW_HELP 243 | exit 0 244 | ;; 245 | *) # unknown option 246 | POSITIONAL+=("$1") 247 | shift 248 | ;; 249 | esac 250 | done 251 | set -- "${POSITIONAL[@]}" # restore positional parameters 252 | 253 | function HEADER(){ 254 | echo "" 255 | echo "" 256 | echo " ::::::::: :::::::::: ::::::::: ::::::::: ::: :::::::: " 257 | echo " :+: :+: :+: :+: :+: :+: :+: :+ :+: :+: " 258 | echo " +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ " 259 | echo " +#++:++#: +#++:++# +#+ +:+ +#+ +:+ +#++:++#++ " 260 | echo " +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ " 261 | echo " #+# #+# #+# #+# #+# #+# #+# #+# #+# " 262 | echo " ### ### ########## ######### ######### ######## " 263 | echo " REDD's PCAP OHC UPLOADER" 264 | echo " ( Version 2.1 - macOS )" 265 | echo "" 266 | if [ "$RECURSIVE_MODE" = true ]; then echo "RECURSIVE MODE: ENABLED"; fi 267 | if [ "$VERIFY_PCAP" = true ]; then echo "PCAP VERIFICATION: ENABLED"; fi 268 | echo "" 269 | echo "" 270 | echo "Email: $EMAIL"; 271 | echo "" 272 | CHECK_EMAIL; 273 | } 274 | 275 | # If help was requested, show it. Otherwise, run the main program 276 | if [[ "$1" == "-h" || "$1" == "--help" ]]; then 277 | SHOW_HELP 278 | else 279 | HEADER; 280 | PAUSE; 281 | fi 282 | -------------------------------------------------------------------------------- /upload-unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Credits: REDD 3 | # TARGET OS: Unix - BASH/Shell Script 4 | # Version: 2.1 - Unified UNIX/Linux Version 5 | 6 | # SET YOUR EMAIL BELOW OR SET IT IN THE SCRIPT! 7 | 8 | 9 | EMAIL="" 10 | 11 | # CONFIGURATION OPTIONS 12 | RECURSIVE_MODE=false # Set to true to scan subdirectories 13 | VERIFY_PCAP=false # Set to false to skip PCAP file verification (original behavior) 14 | SHOW_PROGRESS=true # Set to true to show curl progress meter 15 | 16 | 17 | CURR_DIR="$PWD" 18 | SENT_DIR="$CURR_DIR/sent" 19 | LOG_FILE="$CURR_DIR/upload_history.log" 20 | 21 | # Check for dependencies 22 | check_dependencies() { 23 | local missing_deps=() 24 | 25 | # Check for curl - required 26 | if ! command -v curl &> /dev/null; then 27 | missing_deps+=("curl") 28 | fi 29 | 30 | # Check for file - useful for PCAP verification but not required 31 | if ! command -v file &> /dev/null; then 32 | if [ "$VERIFY_PCAP" = true ]; then 33 | echo "Note: 'file' command not found. Basic PCAP verification will be used." 34 | fi 35 | fi 36 | 37 | # Check for readlink or realpath - at least one is needed for path resolution 38 | if ! command -v readlink &> /dev/null && ! command -v realpath &> /dev/null; then 39 | echo "Warning: Neither 'readlink' nor 'realpath' found. Basic path resolution will be used." 40 | fi 41 | 42 | # If curl is missing, we need to report it 43 | if [ ${#missing_deps[@]} -gt 0 ]; then 44 | echo "Error: Required dependencies missing: ${missing_deps[*]}" 45 | echo "Please install the missing dependencies and try again." 46 | echo "On Debian/Ubuntu: sudo apt-get install ${missing_deps[*]}" 47 | echo "On Fedora/RHEL: sudo dnf install ${missing_deps[*]}" 48 | echo "On Arch Linux: sudo pacman -S ${missing_deps[*]}" 49 | exit 1 50 | fi 51 | } 52 | 53 | # Run dependency check 54 | check_dependencies 55 | 56 | if [ -f "email.txt" ]; then 57 | if [ "$EMAIL" == "" ]; then 58 | EMAIL_FROM_FILE=$(cat email.txt) 59 | EMAIL="$EMAIL_FROM_FILE" 60 | fi 61 | fi 62 | clear; 63 | 64 | # Check if a command exists 65 | command_exists() { 66 | command -v "$1" >/dev/null 2>&1 67 | } 68 | 69 | # Check if file is a valid PCAP 70 | is_valid_pcap() { 71 | local file="$1" 72 | if command_exists file; then 73 | # Check with file command if available 74 | file -b "$file" | grep -qi "pcap\|libpcap\|tcpdump\|capture" && return 0 75 | else 76 | # Simple header check if file command not available 77 | # Check for pcap magic numbers: d4c3b2a1 or a1b2c3d4 78 | # PCAPNG: 0a0d0d0a 79 | local magic=$(hexdump -n 4 -e '1/4 "%08x"' "$file" 2>/dev/null) 80 | if [[ "$magic" == "d4c3b2a1" || "$magic" == "a1b2c3d4" || "$magic" == "0a0d0d0a" ]]; then 81 | return 0 82 | fi 83 | fi 84 | return 1 85 | } 86 | 87 | function PAUSE(){ 88 | echo "" 89 | echo "DONE!!" 90 | read -p "Press any key to continue . . ." 91 | echo "" 92 | } 93 | 94 | function SET_EMAIL(){ 95 | read -p "Enter the Email you want to use for Results: " EMAIL 96 | echo "$EMAIL" > email.txt 97 | CHECK_EMAIL; 98 | } 99 | 100 | # Find all PCAP files 101 | function FIND_PCAPS() { 102 | local pcap_files=() 103 | 104 | if [ "$RECURSIVE_MODE" = true ]; then 105 | # Find PCAP files recursively 106 | echo "Searching for PCAP files in $CURR_DIR and subdirectories..." 107 | if command_exists find; then 108 | while IFS= read -r file; do 109 | pcap_files+=("$file") 110 | done < <(find "$CURR_DIR" -type f -name "*.pcap" 2>/dev/null) 111 | else 112 | # Fallback if find is not available 113 | pcap_files=($(ls -R 2>/dev/null | grep -i "\.pcap$")) 114 | fi 115 | else 116 | # Find PCAP files in current directory only 117 | for file in *.pcap; do 118 | # Skip if no matches found 119 | [[ -e "$file" ]] || continue 120 | pcap_files+=("$file") 121 | done 122 | fi 123 | 124 | echo "${pcap_files[@]}" 125 | } 126 | 127 | function SEND(){ 128 | local curl_opts="" 129 | # Check if any .pcap files exist before iterating 130 | local pcap_files=($(FIND_PCAPS)) 131 | 132 | if [ ${#pcap_files[@]} -gt 0 ]; then 133 | # Set curl options for progress display 134 | if [ "$SHOW_PROGRESS" = true ]; then 135 | curl_opts="-#" 136 | else 137 | curl_opts="-s" 138 | fi 139 | 140 | echo "Found ${#pcap_files[@]} PCAP files to process." 141 | 142 | for i in "${pcap_files[@]}"; do 143 | echo "Processing: $i" 144 | 145 | # Verify PCAP file if option enabled 146 | if [ "$VERIFY_PCAP" = true ]; then 147 | if ! is_valid_pcap "$i"; then 148 | echo "Warning: $i does not appear to be a valid PCAP file. Skipping." 149 | continue 150 | fi 151 | fi 152 | 153 | # Use readlink -m for Linux, fall back to other methods if needed 154 | UPLOAD_FILE_PATH=$(readlink -m "$i" 2>/dev/null || readlink -f "$i" 2>/dev/null || realpath "$i" 2>/dev/null || echo "$PWD/$i") 155 | echo "Uploading: $i" 156 | 157 | # Execute the curl command with progress options 158 | curl $curl_opts -X POST -F "email=$EMAIL" -F "file=@$UPLOAD_FILE_PATH" https://api.onlinehashcrack.com 159 | 160 | # Create sent directory if it doesn't exist 161 | if [ ! -d "$SENT_DIR" ]; then 162 | mkdir -p "$SENT_DIR" 163 | fi 164 | 165 | # Create subdirectories in sent directory if recursive mode 166 | if [ "$RECURSIVE_MODE" = true ] && [[ "$i" == */* ]]; then 167 | rel_dir=$(dirname "$i") 168 | mkdir -p "$SENT_DIR/$rel_dir" 169 | mv "$i" "$SENT_DIR/$i" 170 | else 171 | mv "$i" "$SENT_DIR/$(basename "$i")" 172 | fi 173 | 174 | # Log the upload 175 | echo "$(date '+%Y-%m-%d %H:%M:%S') - Uploaded: $i - Email: $EMAIL" >> "$LOG_FILE" 176 | 177 | echo "Done processing: $i" 178 | echo "---------------------------------" 179 | done 180 | echo "All PCAP files have been processed." 181 | else 182 | echo "NO PCAP FILES FOUND!" 183 | echo "" 184 | fi 185 | } 186 | 187 | function CHECK_PCAPS(){ 188 | SEND; 189 | } 190 | 191 | function CHECK_EMAIL(){ 192 | # More compatible email validation 193 | if [[ "$EMAIL" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then 194 | CHECK_PCAPS; 195 | else 196 | echo "$EMAIL is NOT a Valid Email! Please try another Email." 197 | SET_EMAIL; 198 | fi 199 | } 200 | 201 | function SHOW_HELP() { 202 | echo "Usage: $0 [OPTIONS]" 203 | echo 204 | echo "Options:" 205 | echo " -h, --help Show this help message" 206 | echo " -r, --recursive Search for PCAP files in subdirectories" 207 | echo " -v, --verify Verify files are valid PCAP files before upload" 208 | echo " -n, --no-verify Skip PCAP file verification (default behavior)" 209 | echo " -s, --silent Hide progress indicators" 210 | echo " -e EMAIL Specify email address for results" 211 | echo 212 | echo "Example: $0 -r -e your@email.com" 213 | } 214 | 215 | # Parse command line arguments 216 | POSITIONAL=() 217 | while [[ $# -gt 0 ]]; do 218 | key="$1" 219 | case $key in 220 | -r|--recursive) 221 | RECURSIVE_MODE=true 222 | shift 223 | ;; 224 | -v|--verify) 225 | VERIFY_PCAP=true 226 | shift 227 | ;; 228 | -n|--no-verify) 229 | VERIFY_PCAP=false 230 | shift 231 | ;; 232 | -s|--silent) 233 | SHOW_PROGRESS=false 234 | shift 235 | ;; 236 | -e) 237 | EMAIL="$2" 238 | shift 239 | shift 240 | ;; 241 | -h|--help) 242 | SHOW_HELP 243 | exit 0 244 | ;; 245 | *) # unknown option 246 | POSITIONAL+=("$1") 247 | shift 248 | ;; 249 | esac 250 | done 251 | set -- "${POSITIONAL[@]}" # restore positional parameters 252 | 253 | function HEADER(){ 254 | echo "" 255 | echo "" 256 | echo " ::::::::: :::::::::: ::::::::: ::::::::: ::: :::::::: " 257 | echo " :+: :+: :+: :+: :+: :+: :+: :+ :+: :+: " 258 | echo " +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ " 259 | echo " +#++:++#: +#++:++# +#+ +:+ +#+ +:+ +#++:++#++ " 260 | echo " +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ " 261 | echo " #+# #+# #+# #+# #+# #+# #+# #+# #+# " 262 | echo " ### ### ########## ######### ######### ######## " 263 | echo " REDD's PCAP OHC UPLOADER" 264 | echo " ( Version 2.1 - UNIX )" 265 | echo "" 266 | if [ "$RECURSIVE_MODE" = true ]; then echo "RECURSIVE MODE: ENABLED"; fi 267 | if [ "$VERIFY_PCAP" = true ]; then echo "PCAP VERIFICATION: ENABLED"; fi 268 | echo "" 269 | echo "" 270 | echo "Email: $EMAIL"; 271 | echo "" 272 | CHECK_EMAIL; 273 | } 274 | 275 | # If help was requested, show it. Otherwise, run the main program 276 | if [[ "$1" == "-h" || "$1" == "--help" ]]; then 277 | SHOW_HELP 278 | else 279 | HEADER; 280 | PAUSE; 281 | fi 282 | -------------------------------------------------------------------------------- /upload-win.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | REM Credits: REDD 3 | REM TARGET OS: Windows 10+ 4 | REM Version: 2.1 - Unified Windows Version 5 | 6 | SETLOCAL ENABLEDELAYEDEXPANSION 7 | 8 | REM SET YOUR EMAIL BELOW OR SET IT IN THE SCRIPT! 9 | 10 | SET "EMAIL=" 11 | 12 | REM CONFIGURATION OPTIONS 13 | SET "RECURSIVE_MODE=false" 14 | SET "VERIFY_PCAP=false" 15 | SET "SHOW_PROGRESS=true" 16 | 17 | REM Parse command line arguments 18 | SET "SHOW_HELP=false" 19 | SET "ARGS_PROCESSED=false" 20 | 21 | IF "%~1"=="" GOTO ARGS_DONE 22 | 23 | :PARSE_ARGS 24 | IF "%~1"=="" GOTO ARGS_DONE 25 | IF /I "%~1"=="-r" SET "RECURSIVE_MODE=true" & SHIFT & GOTO PARSE_ARGS 26 | IF /I "%~1"=="--recursive" SET "RECURSIVE_MODE=true" & SHIFT & GOTO PARSE_ARGS 27 | IF /I "%~1"=="-v" SET "VERIFY_PCAP=true" & SHIFT & GOTO PARSE_ARGS 28 | IF /I "%~1"=="--verify" SET "VERIFY_PCAP=true" & SHIFT & GOTO PARSE_ARGS 29 | IF /I "%~1"=="-n" SET "VERIFY_PCAP=false" & SHIFT & GOTO PARSE_ARGS 30 | IF /I "%~1"=="--no-verify" SET "VERIFY_PCAP=false" & SHIFT & GOTO PARSE_ARGS 31 | IF /I "%~1"=="-s" SET "SHOW_PROGRESS=false" & SHIFT & GOTO PARSE_ARGS 32 | IF /I "%~1"=="--silent" SET "SHOW_PROGRESS=false" & SHIFT & GOTO PARSE_ARGS 33 | IF /I "%~1"=="-e" ( 34 | IF NOT "%~2"=="" ( 35 | SET "EMAIL=%~2" 36 | SHIFT 37 | SHIFT 38 | GOTO PARSE_ARGS 39 | ) 40 | ) 41 | IF /I "%~1"=="-h" SET "SHOW_HELP=true" & SHIFT & GOTO ARGS_DONE 42 | IF /I "%~1"=="--help" SET "SHOW_HELP=true" & SHIFT & GOTO ARGS_DONE 43 | SHIFT 44 | GOTO PARSE_ARGS 45 | 46 | :ARGS_DONE 47 | SET "ARGS_PROCESSED=true" 48 | 49 | IF "%SHOW_HELP%"=="true" GOTO SHOW_HELP 50 | GOTO MENU 51 | 52 | :SHOW_HELP 53 | ECHO Usage: %~nx0 [OPTIONS] 54 | ECHO. 55 | ECHO Options: 56 | ECHO -h, --help Show this help message 57 | ECHO -r, --recursive Search for PCAP files in subdirectories 58 | ECHO -v, --verify Verify files are valid PCAP files before upload 59 | ECHO -n, --no-verify Skip PCAP file verification (default behavior) 60 | ECHO -s, --silent Hide progress indicators 61 | ECHO -e EMAIL Specify email address for results 62 | ECHO. 63 | ECHO Example: %~nx0 -r -e your@email.com 64 | EXIT /B 0 65 | 66 | :VARIABLES 67 | SET "DIR=%~dp0" 68 | PUSHD "%DIR%" 69 | cd /D "%DIR%" 70 | SET "SENT_DIR=%DIR%\sent" 71 | IF NOT EXIST "%SENT_DIR%" mkdir %SENT_DIR% 72 | SET "EMAIL_FILE=email.txt" 73 | SET "LOG_FILE=%DIR%\upload_history.log" 74 | GOTO CHECK_EMAIL_FILE 75 | 76 | :CHECK_VALID_EMAIL 77 | ( 78 | ECHO If IsValidEmail("%~1"^) = True Then 79 | ECHO Wscript.Quit(0^) 80 | ECHO Else 81 | ECHO Wscript.Quit(1^) 82 | ECHO End If 83 | ECHO Function IsValidEmail(strEAddress^) 84 | ECHO Dim objRegExpr 85 | ECHO Set objRegExpr = New RegExp 86 | ECHO objRegExpr.Pattern = "^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[\w-\.]*[a-zA-Z0-9]\.[a-zA-Z]{2,7}$" 87 | ECHO objRegExpr.Global = True 88 | ECHO objRegExpr.IgnoreCase = False 89 | ECHO IsValidEmail = objRegExpr.Test(strEAddress^) 90 | ECHO Set objRegExpr = Nothing 91 | ECHO End Function 92 | )>"%~n0.vbs" 93 | CSCRIPT /nologo "%~n0.vbs" 94 | EXIT /b 95 | 96 | :CHECK_VALID_PCAP 97 | SET "IS_VALID_PCAP=0" 98 | SET "FILE_PATH=%~1" 99 | 100 | REM Check file extension 101 | IF /I "%~x1"==".pcap" SET "IS_VALID_PCAP=1" 102 | IF /I "%~x1"==".pcapng" SET "IS_VALID_PCAP=1" 103 | 104 | REM If we have the file command, we could add more sophisticated checks here 105 | REM For now, we'll just trust the extension 106 | 107 | ECHO %IS_VALID_PCAP% 108 | EXIT /B 109 | 110 | :CHECK_EMAIL_FILE 111 | IF EXIST "%EMAIL_FILE%" ( 112 | SET /P EMAIL= %EMAIL_FILE% 119 | GOTO CHECK_EMAIL 120 | 121 | :SET_EMAIL 122 | IF NOT EXIST "%EMAIL_FILE%" ( 123 | SET /P "EMAIL=Enter the Email you want to use for Results: " 124 | echo !EMAIL!> !EMAIL_FILE! 125 | GOTO CHECK_EMAIL 126 | ) 127 | 128 | :CHECK_EMAIL 129 | SET P_FILES=0 130 | cd /D "%DIR%" 131 | 132 | REM Find PCAP files based on recursive mode 133 | IF "%RECURSIVE_MODE%"=="true" ( 134 | ECHO Searching for PCAP files in %DIR% and subdirectories... 135 | FOR /R "%DIR%" %%a in (*.pcap) DO SET /a P_FILES+=1 136 | ) ELSE ( 137 | FOR %%a in ("%DIR%*.pcap") DO SET /a P_FILES+=1 138 | ) 139 | 140 | SET EMAIL_PASS=0 141 | CALL :CHECK_VALID_EMAIL "%EMAIL%" 142 | IF "%ERRORLEVEL%" EQU "0" SET EMAIL_PASS=1 143 | 144 | :SEND 145 | ECHO Email: %EMAIL% 146 | ECHO. 147 | IF "%EMAIL_PASS%" NEQ "0" ( 148 | IF "%P_FILES%" == "0" ( 149 | ECHO NO PCAP FILES FOUND^^! 150 | ) ELSE ( 151 | ECHO Found %P_FILES% PCAP files to process. 152 | 153 | REM Process files based on recursive mode 154 | IF "%RECURSIVE_MODE%"=="true" ( 155 | FOR /R "%DIR%" %%i in (*.pcap) DO ( 156 | ECHO Processing: %%i 157 | 158 | IF "%VERIFY_PCAP%"=="true" ( 159 | CALL :CHECK_VALID_PCAP "%%i" 160 | IF "!ERRORLEVEL!" NEQ "1" ( 161 | ECHO Warning: %%i does not appear to be a valid PCAP file. Skipping. 162 | GOTO :SKIP_FILE 163 | ) 164 | ) 165 | 166 | ECHO Uploading: %%i 167 | 168 | IF "%SHOW_PROGRESS%"=="true" ( 169 | CURL -# -X POST -F "email=%EMAIL%" -F "file=@%%i" https://api.onlinehashcrack.com 170 | ) ELSE ( 171 | CURL -s -X POST -F "email=%EMAIL%" -F "file=@%%i" https://api.onlinehashcrack.com 172 | ) 173 | 174 | REM Create target directory structure 175 | SET "REL_PATH=%%~pi" 176 | SET "REL_PATH=!REL_PATH:%DIR%=!" 177 | IF NOT "!REL_PATH!"=="" ( 178 | IF NOT EXIST "%SENT_DIR%\!REL_PATH!" MKDIR "%SENT_DIR%\!REL_PATH!" 179 | MOVE /Y "%%i" "%SENT_DIR%\!REL_PATH!%%~nxi" >NUL 180 | ) ELSE ( 181 | MOVE /Y "%%i" "%SENT_DIR%\%%~nxi" >NUL 182 | ) 183 | 184 | REM Log the upload 185 | ECHO %DATE% %TIME% - Uploaded: %%i - Email: %EMAIL% >> "%LOG_FILE%" 186 | 187 | ECHO Done processing: %%i 188 | ECHO --------------------------------- 189 | 190 | :SKIP_FILE 191 | ) 192 | ) ELSE ( 193 | FOR %%i in ("%DIR%*.pcap") DO ( 194 | ECHO Processing: %%i 195 | 196 | IF "%VERIFY_PCAP%"=="true" ( 197 | CALL :CHECK_VALID_PCAP "%%i" 198 | IF "!ERRORLEVEL!" NEQ "1" ( 199 | ECHO Warning: %%i does not appear to be a valid PCAP file. Skipping. 200 | GOTO :SKIP_FILE2 201 | ) 202 | ) 203 | 204 | ECHO Uploading: %%i 205 | 206 | IF "%SHOW_PROGRESS%"=="true" ( 207 | CURL -# -X POST -F "email=%EMAIL%" -F "file=@%%i" https://api.onlinehashcrack.com 208 | ) ELSE ( 209 | CURL -s -X POST -F "email=%EMAIL%" -F "file=@%%i" https://api.onlinehashcrack.com 210 | ) 211 | 212 | MOVE /Y "%%i" "%SENT_DIR%\%%~ni.pcap" >NUL 213 | 214 | REM Log the upload 215 | ECHO %DATE% %TIME% - Uploaded: %%i - Email: %EMAIL% >> "%LOG_FILE%" 216 | 217 | ECHO Done processing: %%i 218 | ECHO --------------------------------- 219 | 220 | :SKIP_FILE2 221 | ) 222 | ) 223 | ECHO All PCAP files have been processed. 224 | ) 225 | ) ELSE ( 226 | ECHO %EMAIL% is NOT a Valid Email^^! Please try another Email. 227 | GOTO FORCE_SET_EMAIL 228 | ) 229 | ECHO. 230 | ECHO. 231 | ECHO DONE^^!^^! 232 | DEL /F "%~n0.vbs" >NUL 233 | PAUSE & EXIT 234 | 235 | :MENU 236 | CLS 237 | ECHO. 238 | ECHO. 239 | ECHO ::::::::: :::::::::: ::::::::: ::::::::: ::: :::::::: 240 | ECHO :+: :+: :+: :+: :+: :+: :+: :+ :+: :+: 241 | ECHO +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ 242 | ECHO +#++:++#: +#++:++# +#+ +:+ +#+ +:+ +#++:++#++ 243 | ECHO +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ 244 | ECHO #+# #+# #+# #+# #+# #+# #+# #+# #+# 245 | ECHO ### ### ########## ######### ######### ######## 246 | ECHO REDD's PCAP OHC UPLOADER 247 | ECHO ( Version 2.1 - WIN ) 248 | ECHO. 249 | IF "%RECURSIVE_MODE%"=="true" ECHO RECURSIVE MODE: ENABLED 250 | IF "%VERIFY_PCAP%"=="true" ECHO PCAP VERIFICATION: ENABLED 251 | ECHO. 252 | ECHO. 253 | GOTO VARIABLES 254 | --------------------------------------------------------------------------------