1594
1595
1596
1597
@@ -860,7 +846,28 @@
1704
1705
1706
-1707 def make_event (
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
def make_event (
data,
event_type = None ,
parent = None ,
@@ -972,6 +979,13 @@
if event_type == "USERNAME" and validators . soft_validate(data, "email" ):
event_type = "EMAIL_ADDRESS"
tags . add( "affiliate" )
+ # Convert single-host IP_RANGE to IP_ADDRESS
+ if event_type == "IP_RANGE" :
+ with suppress( Exception ):
+ net = ipaddress . ip_network(data, strict = False )
+ if net . prefixlen == net . max_prefixlen:
+ event_type = "IP_ADDRESS"
+ data = net . network_address
event_class = globals() . get(event_type, DefaultEvent)
@@ -1041,28 +1055,7 @@
Source code in bbot/core/event/base.py
-1710
-1711
-1712
-1713
-1714
-1715
-1716
-1717
-1718
-1719
-1720
-1721
-1722
-1723
-1724
-1725
-1726
-1727
-1728
-1729
-1730
-1731
+1731
1732
1733
1734
@@ -1097,7 +1090,28 @@
1763
1764
1765
-1766 def event_from_json (j, siem_friendly = False ):
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
def event_from_json (j, siem_friendly = False ):
"""
Creates an event object from a JSON dictionary.
@@ -2267,7 +2281,22 @@
936
937
938
-939
class BaseEvent :
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
class BaseEvent :
"""
Represents a piece of data discovered during a BBOT scan.
@@ -2563,6 +2592,21 @@
return self . host
return self . _host_original
+ @property
+ def host_filterable (self):
+ """
+ A string version of the event that's used for regex-based blacklisting.
+
+ For example, the user can specify "REGEX:.*.evilcorp.com" in their blacklist, and this regex
+ will be applied against this property.
+ """
+ parsed_url = getattr(self, "parsed_url" , None )
+ if parsed_url is not None :
+ return parsed_url . geturl()
+ if self . host is not None :
+ return str(self . host)
+ return ""
+
@property
def port (self):
self . host
@@ -3604,22 +3648,7 @@
Source code in bbot/core/event/base.py
-743
-744
-745
-746
-747
-748
-749
-750
-751
-752
-753
-754
-755
-756
-757
-758
+758
759
760
761
@@ -3682,7 +3711,22 @@
818
819
820
-821 def json (self, mode = "json" , siem_friendly = False ):
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
def json (self, mode = "json" , siem_friendly = False ):
"""
Serializes the event object to a JSON-compatible dictionary.
@@ -3799,20 +3843,20 @@
Source code in bbot/core/event/base.py
-823
-824
-825
-826
-827
-828
-829
-830
-831
-832
-833
-834
-835
-836 @staticmethod
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851 @staticmethod
def from_json (j):
"""
Convenience shortcut to create an Event object from a JSON-compatible dictionary.
diff --git a/Dev/dev/helpers/command/index.html b/Dev/dev/helpers/command/index.html
index 54b816eb7..3839ff87d 100644
--- a/Dev/dev/helpers/command/index.html
+++ b/Dev/dev/helpers/command/index.html
@@ -20,7 +20,7 @@
-
+
diff --git a/Dev/dev/helpers/dns/index.html b/Dev/dev/helpers/dns/index.html
index db038225e..e40e34ec0 100644
--- a/Dev/dev/helpers/dns/index.html
+++ b/Dev/dev/helpers/dns/index.html
@@ -20,7 +20,7 @@
-
+
diff --git a/Dev/dev/helpers/index.html b/Dev/dev/helpers/index.html
index 916dd2820..631c237f4 100644
--- a/Dev/dev/helpers/index.html
+++ b/Dev/dev/helpers/index.html
@@ -20,7 +20,7 @@
-
+
diff --git a/Dev/dev/helpers/interactsh/index.html b/Dev/dev/helpers/interactsh/index.html
index 78cdb5df6..952f3fb46 100644
--- a/Dev/dev/helpers/interactsh/index.html
+++ b/Dev/dev/helpers/interactsh/index.html
@@ -20,7 +20,7 @@
-
+
diff --git a/Dev/dev/helpers/misc/index.html b/Dev/dev/helpers/misc/index.html
index 50fc6e690..a3c2c2919 100644
--- a/Dev/dev/helpers/misc/index.html
+++ b/Dev/dev/helpers/misc/index.html
@@ -20,7 +20,7 @@
-
+
@@ -716,13 +716,7 @@
Source code in bbot/core/helpers/misc.py
-2577
-2578
-2579
-2580
-2581
-2582
-2583
+2583
2584
2585
2586
@@ -739,7 +733,13 @@
2597
2598
2599
-2600 async def as_completed (coros):
+2600
+2601
+2602
+2603
+2604
+2605
+2606
async def as_completed (coros):
"""
Async generator that yields completed Tasks as they are completed.
@@ -816,13 +816,7 @@
Source code in bbot/core/helpers/misc.py
-1551
-1552
-1553
-1554
-1555
-1556
-1557
+1557
1558
1559
1560
@@ -848,7 +842,13 @@
1580
1581
1582
-1583 def backup_file (filename, max_backups = 10 ):
+1583
+1584
+1585
+1586
+1587
+1588
+1589
def backup_file (filename, max_backups = 10 ):
"""
Renames a file by appending an iteration number as a backup. Recursively renames
files up to a specified maximum number of backups.
@@ -1058,13 +1058,7 @@
Source code in bbot/core/helpers/misc.py
-1940
-1941
-1942
-1943
-1944
-1945
-1946
+1946
1947
1948
1949
@@ -1087,7 +1081,13 @@
1966
1967
1968
-1969 def bytes_to_human (_bytes):
+1969
+1970
+1971
+1972
+1973
+1974
+1975
def bytes_to_human (_bytes):
"""Convert a bytes size to a human-readable string.
This function converts a numeric bytes value into a human-readable string format, complete
@@ -1146,13 +1146,7 @@
Source code in bbot/core/helpers/misc.py
-1798
-1799
-1800
-1801
-1802
-1803
-1804
+1804
1805
1806
1807
@@ -1167,7 +1161,13 @@ 1816
1817
1818
-1819 def can_sudo_without_password ():
+1819
+1820
+1821
+1822
+1823
+1824
+1825
def can_sudo_without_password ():
"""Check if the current user has passwordless sudo access.
This function checks whether the current user can use sudo without entering a password.
@@ -1239,13 +1239,7 @@
Source code in bbot/core/helpers/misc.py
-2425
-2426
-2427
-2428
-2429
-2430
-2431
+2431
2432
2433
2434
@@ -1271,7 +1265,13 @@
2454
2455
2456
-2457 async def cancel_tasks (tasks, ignore_errors = True ):
+2457
+2458
+2459
+2460
+2461
+2462
+2463
async def cancel_tasks (tasks, ignore_errors = True ):
"""
Asynchronously cancels a list of asyncio tasks.
@@ -1339,13 +1339,7 @@
Source code in bbot/core/helpers/misc.py
-2460
-2461
-2462
-2463
-2464
-2465
-2466
+2466
2467
2468
2469
@@ -1359,7 +1353,13 @@
2477
2478
2479
-2480 def cancel_tasks_sync (tasks):
+2480
+2481
+2482
+2483
+2484
+2485
+2486
def cancel_tasks_sync (tasks):
"""
Synchronously cancels a list of asyncio tasks.
@@ -1484,13 +1484,7 @@
Source code in bbot/core/helpers/misc.py
-1107
-1108
-1109
-1110
-1111
-1112
-1113
+1113
1114
1115
1116
@@ -1542,7 +1536,13 @@
1162
1163
1164
-1165 def chain_lists (
+1165
+1166
+1167
+1168
+1169
+1170
+1171
def chain_lists (
l,
try_files = False ,
msg = None ,
@@ -1799,13 +1799,7 @@
Source code in bbot/core/helpers/misc.py
-2744
-2745
-2746
-2747
-2748
-2749
-2750
+2750
2751
2752
2753
@@ -1827,7 +1821,13 @@
2769
2770
2771
-2772 def clean_dict (d, * key_names, fuzzy = False , exclude_keys = None , _prev_key = None ):
+2772
+2773
+2774
+2775
+2776
+2777
+2778
def clean_dict (d, * key_names, fuzzy = False , exclude_keys = None , _prev_key = None ):
"""
Recursively clean unwanted keys from a dictionary.
Useful for removing secrets from a config.
@@ -1901,13 +1901,7 @@
Source code in bbot/core/helpers/misc.py
-2603
-2604
-2605
-2606
-2607
-2608
-2609
+2609
2610
2611
2612
@@ -1925,7 +1919,13 @@
2624
2625
2626
-2627 def clean_dns_record (record):
+2627
+2628
+2629
+2630
+2631
+2632
+2633
def clean_dns_record (record):
"""
Cleans and formats a given DNS record for further processing.
@@ -2032,13 +2032,7 @@
Source code in bbot/core/helpers/misc.py
-1650
-1651
-1652
-1653
-1654
-1655
-1656
+1656
1657
1658
1659
@@ -2064,7 +2058,13 @@
1679
1680
1681
-1682 def clean_old (d, keep = 10 , filter = lambda x: True , key = latest_mtime, reverse = True , raise_error = False ):
+1682
+1683
+1684
+1685
+1686
+1687
+1688
def clean_old (d, keep = 10 , filter = lambda x: True , key = latest_mtime, reverse = True , raise_error = False ):
"""Clean up old files and directories within a given directory based on various filtering and sorting options.
This function removes the oldest files and directories in the provided directory 'd' that exceed a specified
@@ -2167,13 +2167,7 @@
Source code in bbot/core/helpers/misc.py
- 994
- 995
- 996
- 997
- 998
- 999
-1000
+1000
1001
1002
1003
@@ -2195,7 +2189,13 @@
1019
1020
1021
-1022 def closest_match (s, choices, n = 1 , cutoff = 0.0 ):
+1022
+1023
+1024
+1025
+1026
+1027
+1028
def closest_match (s, choices, n = 1 , cutoff = 0.0 ):
"""Finds the closest matching strings from a list of choices based on a given string.
This function uses the difflib library to find the closest matches to a given string `s` from a list of `choices`.
@@ -2262,13 +2262,7 @@
Source code in bbot/core/helpers/misc.py
-2279
-2280
-2281
-2282
-2283
-2284
-2285
+2285
2286
2287
2288
@@ -2278,7 +2272,13 @@
2292
2293
2294
-2295 def cloudcheck (ip):
+2295
+2296
+2297
+2298
+2299
+2300
+2301
def cloudcheck (ip):
"""
Check whether an IP address belongs to a cloud provider and returns the provider name, type, and subnet.
@@ -2324,13 +2324,7 @@
Source code in bbot/core/helpers/misc.py
-2059
-2060
-2061
-2062
-2063
-2064
-2065
+2065
2066
2067
2068
@@ -2345,7 +2339,13 @@
2077
2078
2079
-2080 def cpu_architecture ():
+2080
+2081
+2082
+2083
+2084
+2085
+2086
def cpu_architecture ():
"""Return the CPU architecture of the current system.
This function fetches and returns the architecture type of the CPU where the code is being executed.
@@ -2399,20 +2399,20 @@
Source code in bbot/core/helpers/misc.py
-1206
-1207
-1208
-1209
-1210
-1211
-1212
+1212
1213
1214
1215
1216
1217
1218
-1219 def delete_file (path):
+1219
+1220
+1221
+1222
+1223
+1224
+1225
def delete_file (path):
"""Deletes a file at the given path.
Args:
@@ -2691,13 +2691,7 @@
Source code in bbot/core/helpers/misc.py
-2319
-2320
-2321
-2322
-2323
-2324
-2325
+2325
2326
2327
2328
@@ -2718,7 +2712,13 @@
2343
2344
2345
-2346 async def execute_sync_or_async (callback, * args, ** kwargs):
+2346
+2347
+2348
+2349
+2350
+2351
+2352
async def execute_sync_or_async (callback, * args, ** kwargs):
"""
Execute a function or coroutine, handling either synchronous or asynchronous invocation.
@@ -2787,13 +2787,7 @@
Source code in bbot/core/helpers/misc.py
-1685
-1686
-1687
-1688
-1689
-1690
-1691
+