socx 2.2__tar.gz → 2.4.0__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.
- {socx-2.2 → socx-2.4.0}/PKG-INFO +29 -8
- {socx-2.2 → socx-2.4.0}/README.md +12 -7
- socx-2.4.0/pyproject.toml +42 -0
- {socx-2.2 → socx-2.4.0}/src/socx/socx.py +57 -13
- {socx-2.2 → socx-2.4.0}/src/socx.egg-info/PKG-INFO +29 -8
- {socx-2.2 → socx-2.4.0}/src/socx.egg-info/SOURCES.txt +1 -0
- socx-2.4.0/src/socx.egg-info/requires.txt +3 -0
- socx-2.2/pyproject.toml +0 -19
- {socx-2.2 → socx-2.4.0}/setup.cfg +0 -0
- {socx-2.2 → socx-2.4.0}/src/socx/__init__.py +0 -0
- {socx-2.2 → socx-2.4.0}/src/socx/util.py +0 -0
- {socx-2.2 → socx-2.4.0}/src/socx.egg-info/dependency_links.txt +0 -0
- {socx-2.2 → socx-2.4.0}/src/socx.egg-info/entry_points.txt +0 -0
- {socx-2.2 → socx-2.4.0}/src/socx.egg-info/top_level.txt +0 -0
- {socx-2.2 → socx-2.4.0}/tests/tests.py +0 -0
{socx-2.2 → socx-2.4.0}/PKG-INFO
RENAMED
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socx
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: A set of useful tools for a security operations center
|
|
5
5
|
Author-email: Enlace <enlace.aman@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yourusername/socx
|
|
8
|
+
Project-URL: Repository, https://github.com/yourusername/socx
|
|
9
|
+
Project-URL: Issues, https://github.com/yourusername/socx/issues
|
|
10
|
+
Keywords: soc,security,operations,automation
|
|
6
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
18
|
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Intended Audience :: Information Technology
|
|
20
|
+
Classifier: Topic :: Security
|
|
8
21
|
Requires-Python: >=3.8
|
|
9
22
|
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: keyring>=25.6.0
|
|
24
|
+
Requires-Dist: pandas>=2.3.3
|
|
25
|
+
Requires-Dist: requests>=2.32.5
|
|
10
26
|
|
|
11
|
-
#
|
|
27
|
+
# SOCX
|
|
12
28
|
A collection of helpful tools for a SOC analyst. Easily search for IPs, domains, and find files on the system.
|
|
13
29
|
|
|
14
30
|
## Installing
|
|
@@ -30,21 +46,26 @@ or
|
|
|
30
46
|
python socx.py [universal options] [function] [arguments]
|
|
31
47
|
|
|
32
48
|
Examples:
|
|
49
|
+
|
|
33
50
|
socx --help
|
|
34
51
|
|
|
35
52
|
socx info -h
|
|
36
|
-
|
|
53
|
+
|
|
37
54
|
socx info -ip 1.2.3.4
|
|
38
|
-
|
|
55
|
+
|
|
39
56
|
socx -v 3 info -d google.com
|
|
40
|
-
|
|
57
|
+
|
|
41
58
|
socx find -f filename.txt -i
|
|
42
|
-
|
|
59
|
+
|
|
43
60
|
socx find -f fold.*name -r
|
|
44
|
-
|
|
61
|
+
|
|
45
62
|
socx unwrap --url "https://urldefense.com/v3/__https:/..."
|
|
46
|
-
|
|
63
|
+
|
|
47
64
|
socx combine --csvs 5
|
|
65
|
+
|
|
66
|
+
socx awake --minutes 90
|
|
67
|
+
|
|
68
|
+
socx awake --restart
|
|
48
69
|
|
|
49
70
|
## Other Information
|
|
50
71
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SOCX
|
|
2
2
|
A collection of helpful tools for a SOC analyst. Easily search for IPs, domains, and find files on the system.
|
|
3
3
|
|
|
4
4
|
## Installing
|
|
@@ -20,21 +20,26 @@ or
|
|
|
20
20
|
python socx.py [universal options] [function] [arguments]
|
|
21
21
|
|
|
22
22
|
Examples:
|
|
23
|
+
|
|
23
24
|
socx --help
|
|
24
25
|
|
|
25
26
|
socx info -h
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
socx info -ip 1.2.3.4
|
|
28
|
-
|
|
29
|
+
|
|
29
30
|
socx -v 3 info -d google.com
|
|
30
|
-
|
|
31
|
+
|
|
31
32
|
socx find -f filename.txt -i
|
|
32
|
-
|
|
33
|
+
|
|
33
34
|
socx find -f fold.*name -r
|
|
34
|
-
|
|
35
|
+
|
|
35
36
|
socx unwrap --url "https://urldefense.com/v3/__https:/..."
|
|
36
|
-
|
|
37
|
+
|
|
37
38
|
socx combine --csvs 5
|
|
39
|
+
|
|
40
|
+
socx awake --minutes 90
|
|
41
|
+
|
|
42
|
+
socx awake --restart
|
|
38
43
|
|
|
39
44
|
## Other Information
|
|
40
45
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "socx"
|
|
7
|
+
version = "2.4.0" # ← Added .0 for PEP 440 compliance
|
|
8
|
+
description = "A set of useful tools for a security operations center"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [
|
|
11
|
+
{ name = "Enlace", email = "enlace.aman@gmail.com" }
|
|
12
|
+
]
|
|
13
|
+
requires-python = ">=3.8"
|
|
14
|
+
license = { text = "MIT" } # ← Recommended: add license
|
|
15
|
+
keywords = ["soc", "security", "operations", "automation"] # ← Helps discoverability
|
|
16
|
+
|
|
17
|
+
dependencies = [
|
|
18
|
+
"keyring>=25.6.0",
|
|
19
|
+
"pandas>=2.3.3",
|
|
20
|
+
"requests>=2.32.5",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Programming Language :: Python :: 3.8",
|
|
26
|
+
"Programming Language :: Python :: 3.9",
|
|
27
|
+
"Programming Language :: Python :: 3.10",
|
|
28
|
+
"Programming Language :: Python :: 3.11",
|
|
29
|
+
"Programming Language :: Python :: 3.12",
|
|
30
|
+
"License :: OSI Approved :: MIT License",
|
|
31
|
+
"Operating System :: OS Independent",
|
|
32
|
+
"Intended Audience :: Information Technology",
|
|
33
|
+
"Topic :: Security",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
Homepage = "https://github.com/yourusername/socx" # ← Optional but recommended
|
|
38
|
+
Repository = "https://github.com/yourusername/socx"
|
|
39
|
+
Issues = "https://github.com/yourusername/socx/issues"
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
socx = "socx:main" # ← CLI entry point
|
|
@@ -66,6 +66,8 @@ Examples:
|
|
|
66
66
|
{PROGRAM_NAME} find -f fold.*name -r
|
|
67
67
|
{PROGRAM_NAME} unwrap --url "https://urldefense.com/v3/__https:/..."
|
|
68
68
|
{PROGRAM_NAME} combine --csvs 5
|
|
69
|
+
{PROGRAM_NAME} awake --minutes 90
|
|
70
|
+
{PROGRAM_NAME} awake --restart
|
|
69
71
|
"""
|
|
70
72
|
verbosity = 1
|
|
71
73
|
environmental_variables = {
|
|
@@ -87,7 +89,9 @@ def p(*args_, v=1, end="\n", sep=" ", file=None):
|
|
|
87
89
|
def unwrap_url(url):
|
|
88
90
|
pp_decoder = util.URLDefenseDecoder()
|
|
89
91
|
if "safelinks" in url:
|
|
90
|
-
url =
|
|
92
|
+
url = [t for t in re.split(r"&|\?", url) if t.startswith("url=")][0]
|
|
93
|
+
url = url.split("=")[1]
|
|
94
|
+
url = unquote(url)
|
|
91
95
|
url = pp_decoder.decode(url)
|
|
92
96
|
return url
|
|
93
97
|
|
|
@@ -444,18 +448,23 @@ def do_browser_history(user="~"):
|
|
|
444
448
|
p(f"Error with {name} - {e}", v=3)
|
|
445
449
|
|
|
446
450
|
|
|
447
|
-
def do_combine_csvs(
|
|
451
|
+
def do_combine_csvs(
|
|
452
|
+
csvs=0, skip_og_filename_column=False, directory=os.getcwd(), remove_dupes=False
|
|
453
|
+
):
|
|
448
454
|
p("Starting combine CSVs", v=5)
|
|
449
455
|
p("The current directory will be used to find the CSVs.", v=1)
|
|
450
456
|
paths = sorted(Path(directory).iterdir(), key=os.path.getmtime)
|
|
451
457
|
paths.reverse()
|
|
458
|
+
paths = [p for p in paths if str(p).endswith(".csv")]
|
|
459
|
+
if len(paths) == 0:
|
|
460
|
+
p("There are no csvs in this directory", v=1)
|
|
461
|
+
return
|
|
452
462
|
if csvs < 2:
|
|
453
463
|
accum = 1
|
|
454
464
|
p("File Paths", v=3)
|
|
455
465
|
for path in paths:
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
accum += 1
|
|
466
|
+
p(f"{accum} - {path}")
|
|
467
|
+
accum += 1
|
|
459
468
|
csvs = int(input("Enter the index of the last CSV to include:"))
|
|
460
469
|
file_paths = []
|
|
461
470
|
for path in paths:
|
|
@@ -472,6 +481,11 @@ def do_combine_csvs(csvs=0, skip_og_filename_column=False, directory=os.getcwd()
|
|
|
472
481
|
df["Original CSV Filename"] = os.path.basename(path)
|
|
473
482
|
dfs.append(df)
|
|
474
483
|
df = pd.concat(dfs)
|
|
484
|
+
if remove_dupes:
|
|
485
|
+
# Remove dupes by all but df['Original CSV Filename']
|
|
486
|
+
df = df.drop_duplicates(
|
|
487
|
+
subset=[col for col in df.columns if col != "Original CSV Filename"]
|
|
488
|
+
)
|
|
475
489
|
df.to_csv("COMBINED_FILE.csv", index=False)
|
|
476
490
|
p("Outputed to COMBINED_FILE.csv", v=3)
|
|
477
491
|
|
|
@@ -490,7 +504,7 @@ def do_command_history(user="~"):
|
|
|
490
504
|
p("Command history gathered", v=3)
|
|
491
505
|
|
|
492
506
|
|
|
493
|
-
def awake(minutes=60):
|
|
507
|
+
def awake(minutes=60, restart=False):
|
|
494
508
|
interval = 10 # seconds
|
|
495
509
|
iterations = (minutes * 60) / interval
|
|
496
510
|
|
|
@@ -509,6 +523,13 @@ def awake(minutes=60):
|
|
|
509
523
|
for line in proc.stdout:
|
|
510
524
|
print(line, end="")
|
|
511
525
|
|
|
526
|
+
if restart:
|
|
527
|
+
p("Restarting device...")
|
|
528
|
+
cmd = ["shutdown", "/r", "/t", "0"]
|
|
529
|
+
proc = subprocess.Popen(
|
|
530
|
+
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True
|
|
531
|
+
)
|
|
532
|
+
|
|
512
533
|
|
|
513
534
|
#############
|
|
514
535
|
# Arguments #
|
|
@@ -522,13 +543,6 @@ FUNCTIONS = [
|
|
|
522
543
|
"function": lambda: do_config(),
|
|
523
544
|
"arguments": [],
|
|
524
545
|
},
|
|
525
|
-
{
|
|
526
|
-
"name": "Interactive mode",
|
|
527
|
-
"command": "interactive",
|
|
528
|
-
"help": "",
|
|
529
|
-
"function": lambda: interactive_mode(),
|
|
530
|
-
"arguments": [],
|
|
531
|
-
},
|
|
532
546
|
{
|
|
533
547
|
"name": "Stay Awake",
|
|
534
548
|
"command": "awake",
|
|
@@ -545,6 +559,16 @@ FUNCTIONS = [
|
|
|
545
559
|
"required": False,
|
|
546
560
|
"help": "Keeps device awake for this many minutes",
|
|
547
561
|
},
|
|
562
|
+
{
|
|
563
|
+
"name": "restart",
|
|
564
|
+
"flag": "--restart",
|
|
565
|
+
"short_flag": "-r",
|
|
566
|
+
"type": bool,
|
|
567
|
+
"action": "store_true",
|
|
568
|
+
"default": False,
|
|
569
|
+
"required": False,
|
|
570
|
+
"help": "Restart computer once done keeping device awake",
|
|
571
|
+
},
|
|
548
572
|
],
|
|
549
573
|
},
|
|
550
574
|
{
|
|
@@ -576,11 +600,22 @@ FUNCTIONS = [
|
|
|
576
600
|
"name": "skip_og_filename_column",
|
|
577
601
|
"flag": "--skip_og_filename_column",
|
|
578
602
|
"short_flag": "-sname",
|
|
603
|
+
"action": "store_true",
|
|
579
604
|
"type": bool,
|
|
580
605
|
"default": False,
|
|
581
606
|
"required": False,
|
|
582
607
|
"help": "Include a column with the OG file name",
|
|
583
608
|
},
|
|
609
|
+
{
|
|
610
|
+
"name": "remove_dupes",
|
|
611
|
+
"flag": "--deduplicate",
|
|
612
|
+
"short_flag": "-dedupe",
|
|
613
|
+
"action": "store_true",
|
|
614
|
+
"type": bool,
|
|
615
|
+
"default": False,
|
|
616
|
+
"required": False,
|
|
617
|
+
"help": "Remove duplicate rows (excludes OG file name column)",
|
|
618
|
+
},
|
|
584
619
|
],
|
|
585
620
|
},
|
|
586
621
|
{
|
|
@@ -701,6 +736,7 @@ FUNCTIONS = [
|
|
|
701
736
|
"short_flag": "-ss",
|
|
702
737
|
"type": bool,
|
|
703
738
|
"default": False,
|
|
739
|
+
"action": "store_true",
|
|
704
740
|
"required": False,
|
|
705
741
|
"help": "Do smart search (try directory then user folder then C: then D:)",
|
|
706
742
|
},
|
|
@@ -742,6 +778,14 @@ FUNCTIONS = [
|
|
|
742
778
|
}
|
|
743
779
|
],
|
|
744
780
|
},
|
|
781
|
+
# INTERACTIVE MODE MUST BE LAST OR INDEX IS OFF!
|
|
782
|
+
{
|
|
783
|
+
"name": "Interactive mode",
|
|
784
|
+
"command": "interactive",
|
|
785
|
+
"help": "",
|
|
786
|
+
"function": lambda: interactive_mode(),
|
|
787
|
+
"arguments": [],
|
|
788
|
+
},
|
|
745
789
|
]
|
|
746
790
|
|
|
747
791
|
####################
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socx
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: A set of useful tools for a security operations center
|
|
5
5
|
Author-email: Enlace <enlace.aman@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yourusername/socx
|
|
8
|
+
Project-URL: Repository, https://github.com/yourusername/socx
|
|
9
|
+
Project-URL: Issues, https://github.com/yourusername/socx/issues
|
|
10
|
+
Keywords: soc,security,operations,automation
|
|
6
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
18
|
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Intended Audience :: Information Technology
|
|
20
|
+
Classifier: Topic :: Security
|
|
8
21
|
Requires-Python: >=3.8
|
|
9
22
|
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: keyring>=25.6.0
|
|
24
|
+
Requires-Dist: pandas>=2.3.3
|
|
25
|
+
Requires-Dist: requests>=2.32.5
|
|
10
26
|
|
|
11
|
-
#
|
|
27
|
+
# SOCX
|
|
12
28
|
A collection of helpful tools for a SOC analyst. Easily search for IPs, domains, and find files on the system.
|
|
13
29
|
|
|
14
30
|
## Installing
|
|
@@ -30,21 +46,26 @@ or
|
|
|
30
46
|
python socx.py [universal options] [function] [arguments]
|
|
31
47
|
|
|
32
48
|
Examples:
|
|
49
|
+
|
|
33
50
|
socx --help
|
|
34
51
|
|
|
35
52
|
socx info -h
|
|
36
|
-
|
|
53
|
+
|
|
37
54
|
socx info -ip 1.2.3.4
|
|
38
|
-
|
|
55
|
+
|
|
39
56
|
socx -v 3 info -d google.com
|
|
40
|
-
|
|
57
|
+
|
|
41
58
|
socx find -f filename.txt -i
|
|
42
|
-
|
|
59
|
+
|
|
43
60
|
socx find -f fold.*name -r
|
|
44
|
-
|
|
61
|
+
|
|
45
62
|
socx unwrap --url "https://urldefense.com/v3/__https:/..."
|
|
46
|
-
|
|
63
|
+
|
|
47
64
|
socx combine --csvs 5
|
|
65
|
+
|
|
66
|
+
socx awake --minutes 90
|
|
67
|
+
|
|
68
|
+
socx awake --restart
|
|
48
69
|
|
|
49
70
|
## Other Information
|
|
50
71
|
|
socx-2.2/pyproject.toml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=42"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "socx"
|
|
7
|
-
version = "2.2"
|
|
8
|
-
authors = [
|
|
9
|
-
{ name="Enlace", email="enlace.aman@gmail.com" },
|
|
10
|
-
]
|
|
11
|
-
description = "A set of useful tools for a security operations center"
|
|
12
|
-
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.8"
|
|
14
|
-
classifiers = [
|
|
15
|
-
"Programming Language :: Python :: 3",
|
|
16
|
-
"Operating System :: OS Independent",
|
|
17
|
-
]
|
|
18
|
-
[project.scripts]
|
|
19
|
-
socx = "socx:main"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|