Skip to content

Commit 590b5ab

Browse files
authored
Merge pull request #1120 from eve-mem/linux_sockscan
Add linux sockscan plugin
2 parents a7f96b4 + 94f989b commit 590b5ab

File tree

2 files changed

+508
-0
lines changed

2 files changed

+508
-0
lines changed

test/plugins/linux/linux.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,3 +618,37 @@ def test_linux_specific_pscallstack(self, volatility, python):
618618
rb"1\s+init\s+39\s+0x88001f999a40.*?0xffff81109039\s+do_select\s+T\s+kernel",
619619
out,
620620
)
621+
622+
623+
class TestLinuxSockscan:
624+
def test_linux_sockscan(self, volatility, python):
625+
# designed for linux-sample-1.dmp SHA1:1C3A4627EDCA94A7ADE3414592BEF0E62D7D3BB6
626+
image = LinuxSamples.LINUX_GENERIC.value.path
627+
rc, out, err = test_volatility.runvol_plugin(
628+
"linux.sockscan.Sockscan", image, volatility, python
629+
)
630+
631+
# ensure that multiple unix paths for sockets have been found
632+
assert (
633+
len(
634+
re.findall(
635+
rb"(/[ -~]+?){1,8}",
636+
out,
637+
)
638+
)
639+
>= 10
640+
)
641+
642+
# ensure that multiple IPv4 addresses have been found
643+
assert (
644+
len(
645+
re.findall(
646+
rb"((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}",
647+
out,
648+
)
649+
)
650+
>= 10
651+
)
652+
653+
assert out.count(b"\n") >= 50
654+
assert rc == 0

0 commit comments

Comments
 (0)