bhp-pro 1.1.7__tar.gz → 1.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bhp_pro
3
- Version: 1.1.7
3
+ Version: 1.1.8
4
4
  Summary: Web Enumeration Tool
5
5
  Author: ssskingsss12
6
6
  Author-email: smalls3000i@gmail.com
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bhp_pro
3
- Version: 1.1.7
3
+ Version: 1.1.8
4
4
  Summary: Web Enumeration Tool
5
5
  Author: ssskingsss12
6
6
  Author-email: smalls3000i@gmail.com
@@ -14006,7 +14006,6 @@ def Android_App_Security_Analyzer():
14006
14006
 
14007
14007
  #================== IPTV SCANNER ===================#
14008
14008
  def iptvscan():
14009
-
14010
14009
  import requests
14011
14010
  import random
14012
14011
  import time
@@ -14039,6 +14038,63 @@ def iptvscan():
14039
14038
  self.max_panel_threads = 3 # concurrent panels
14040
14039
  self.scanned_lock = threading.Lock() # Add lock for thread safety
14041
14040
  self.current_panel = "None" # Track current panel being scanned
14041
+ self.valid_panels = [] # Store valid panels for scanning
14042
+
14043
+ # ---------------- URL Validation Function ---------------- #
14044
+ def validate_url(self, url, timeout=5):
14045
+ """
14046
+ Validate a URL by checking its HTTP status code
14047
+ Returns: (is_valid, status_code, final_url)
14048
+ """
14049
+ try:
14050
+ if not url.startswith('http'):
14051
+ url = 'http://' + url
14052
+
14053
+ response = self.session.head(url, timeout=timeout, allow_redirects=True)
14054
+ status_code = response.status_code
14055
+
14056
+ # Consider 200-309 as valid, 400+ as invalid
14057
+ if 200 <= status_code <= 309:
14058
+ return True, status_code, response.url
14059
+ else:
14060
+ return False, status_code, response.url
14061
+
14062
+ except requests.exceptions.RequestException as e:
14063
+ return False, "Error", url
14064
+ except Exception as e:
14065
+ return False, "Exception", url
14066
+
14067
+ # ---------------- Validate All URLs ---------------- #
14068
+ def validate_all_urls(self, urls):
14069
+ """
14070
+ Validate all URLs and show statistics
14071
+ Returns: List of valid URLs
14072
+ """
14073
+ print("\n\033[96mValidating URLs...\033[0m")
14074
+ valid_urls = []
14075
+ invalid_urls = []
14076
+
14077
+ for i, url in enumerate(urls, 1):
14078
+ is_valid, status_code, final_url = self.validate_url(url)
14079
+
14080
+ if is_valid:
14081
+ print(f"\033[92m[{i}] VALID: {url} → Status: {status_code}\033[0m")
14082
+ valid_urls.append(url)
14083
+ else:
14084
+ print(f"\033[91m[{i}] INVALID: {url} → Status: {status_code}\033[0m")
14085
+ invalid_urls.append((url, status_code))
14086
+
14087
+ # Show statistics
14088
+ print(f"\n\033[95mValidation Results:\033[0m")
14089
+ print(f"\033[92mValid URLs: {len(valid_urls)}\033[0m")
14090
+ print(f"\033[91mInvalid URLs: {len(invalid_urls)}\033[0m")
14091
+
14092
+ if invalid_urls:
14093
+ print("\n\033[93mInvalid URLs (will be skipped):\033[0m")
14094
+ for url, status in invalid_urls:
14095
+ print(f" {url} → Status: {status}")
14096
+
14097
+ return valid_urls
14042
14098
 
14043
14099
  # ---------------- MAC / Serial / Device functions ---------------- #
14044
14100
  def validate_mac(self, mac):
@@ -14070,8 +14126,8 @@ def iptvscan():
14070
14126
 
14071
14127
  # ---------------- Choose MAC mode ---------------- #
14072
14128
  def choose_mac_mode(self):
14073
- choice = input("Do you want to test a specific MAC or auto-generate? (specific/auto) [auto]: ").strip().lower() or "auto"
14074
- if choice == 'specific':
14129
+ choice = input("Do you want to test a specific MAC or auto-generate? (single(s)/auto) [auto]: ").strip().lower() or "auto"
14130
+ if choice == 'single' or choice == 's':
14075
14131
  specific_mac = input("Enter MAC to test: ").strip()
14076
14132
  mac_case = input("MAC case (upper/lower) [upper]: ").strip().lower() or "upper"
14077
14133
  return choice, specific_mac, mac_case, 1
@@ -14353,7 +14409,7 @@ def iptvscan():
14353
14409
 
14354
14410
  # Update status display - reduced verbosity
14355
14411
  if self.scanned_count % 1 == 0 or self.scanned_count == 1:
14356
- sys.stdout.write(f"\rScanned: {self.scanned_count} | Hits: {self.found_hits} | Panel: {self.current_panel[:50]}")
14412
+ sys.stdout.write(f"\rScanned: {self.scanned_count} | Mac: {mac} | Hits: {self.found_hits} | Panel: {self.current_panel[:50]} | Threads: {self.active_threads} | Mode: {mode} | Time: {datetime.now().strftime('%H:%M:%S')} ")
14357
14413
  sys.stdout.flush()
14358
14414
 
14359
14415
  # Check if we've reached the limit
@@ -14369,10 +14425,10 @@ def iptvscan():
14369
14425
  def panel_runner(self, panel_url, mode, mac_case, prefix_index, creds_min, creds_max, mac_count):
14370
14426
  # Adjust thread count based on requested MAC count
14371
14427
  if mac_count > 0:
14372
- thread_count = min(5, max(1, mac_count // 10)) # Scale threads with count
14428
+ thread_count = min(18, max(1, mac_count // 10)) # Scale threads with count
14373
14429
  else:
14374
- thread_count = 10
14375
-
14430
+ thread_count = 100
14431
+
14376
14432
  threads = []
14377
14433
  for _ in range(thread_count):
14378
14434
  t = threading.Thread(target=self.worker, args=(panel_url, mode, mac_case, prefix_index, creds_min, creds_max, mac_count))
@@ -14381,13 +14437,15 @@ def iptvscan():
14381
14437
  threads.append(t)
14382
14438
 
14383
14439
  try:
14384
- while any(t.is_alive() for t in threads):
14385
- time.sleep(0.5)
14440
+ # Properly wait for all threads to finish
14441
+ for t in threads:
14442
+ t.join() # <-- join each thread, blocking until all threads finish
14386
14443
  except KeyboardInterrupt:
14387
14444
  self.running = False
14388
14445
  for t in threads:
14389
14446
  t.join(timeout=1)
14390
14447
 
14448
+
14391
14449
  # ---------------- Main scanner function ---------------- #
14392
14450
  def run_scanner(self):
14393
14451
  """Main scanner function that handles the scanning process"""
@@ -14413,6 +14471,19 @@ def iptvscan():
14413
14471
  panels = [user_input]
14414
14472
  print(f"Testing single panel: {user_input}")
14415
14473
 
14474
+ # Validate all URLs before proceeding
14475
+ valid_panels = self.validate_all_urls(panels)
14476
+
14477
+ if not valid_panels:
14478
+ print("\n\033[91mNo valid URLs to scan. Exiting.\033[0m")
14479
+ return
14480
+
14481
+ # Ask if user wants to continue with only valid URLs
14482
+ continue_scan = "y"
14483
+ if continue_scan != "y":
14484
+ print("Scan cancelled.")
14485
+ return
14486
+
14416
14487
  mode = input("Mode (mac/creds) [mac]: ").strip().lower() or 'mac'
14417
14488
 
14418
14489
  # MAC choice / count
@@ -14430,11 +14501,11 @@ def iptvscan():
14430
14501
  print("Invalid input, using defaults (5-15)")
14431
14502
  creds_min, creds_max = 5, 15
14432
14503
 
14433
- print(f"\nStarting scan with {len(panels)} panel(s)...")
14504
+ print(f"\nStarting scan with {len(valid_panels)} valid panel(s)...")
14434
14505
  print("Press Ctrl+C to stop\n")
14435
14506
 
14436
- # Process all panels in the list
14437
- for panel in panels:
14507
+ # Process all valid panels
14508
+ for panel in valid_panels:
14438
14509
  if not self.running:
14439
14510
  break
14440
14511
 
@@ -14452,7 +14523,7 @@ def iptvscan():
14452
14523
 
14453
14524
  print(f"\nAll panels processed! Total hits found: {self.found_hits}")
14454
14525
 
14455
- def mainjam():
14526
+ def main():
14456
14527
  """Main function that handles the application flow"""
14457
14528
  try:
14458
14529
  # Create scanner instance
@@ -14474,9 +14545,8 @@ def iptvscan():
14474
14545
  print("\nThank you for using IPTV Panel Scanner!")
14475
14546
  print("Results are saved in the 'hits' folder.")
14476
14547
 
14477
-
14478
- mainjam()
14479
-
14548
+ if __name__ == "__main__":
14549
+ main()
14480
14550
  def ipcam():
14481
14551
  import requests
14482
14552
  import re
@@ -2,7 +2,7 @@ from setuptools import setup
2
2
 
3
3
  setup(
4
4
  name='bhp_pro', # Lowercase, unique on PyPI
5
- version='1.1.7',
5
+ version='1.1.8',
6
6
  py_modules=['bhp_pro'], # Matches your filename
7
7
  entry_points={
8
8
  'console_scripts': [
File without changes
File without changes