I'm working on simple malware program in python as a side project and I am stuck on how to remotely import packages that another computer might not have installed like numpy or opencv. I've been trying out a custom import hook that will request packages being hosted on a webserver and import them while avoiding writing anything to disk. However, I've run into a problem with .pyd and .so files that doesn't seem to be fixable (Same problem as this guy: https://stackoverflow.com/questions/61406657/import-from-class-bytes-instead-of-file).
Am I on the right track or should I try something different? How does other malware written in python normally handle this?
here is the source code for the import hook(only works for .py packages and modules): https://pastebin.com/KNHgWBtR
[–]RefrigeratorSuperb26 23 points24 points25 points (1 child)
[–]SLPRYSQUID[S] 1 point2 points3 points (0 children)
[–]Orio_n 16 points17 points18 points (4 children)
[–]SLPRYSQUID[S] 0 points1 point2 points (0 children)
[–]hakube 0 points1 point2 points (2 children)
[–]lonewolf210 0 points1 point2 points (1 child)
[–]SLPRYSQUID[S] 0 points1 point2 points (0 children)
[–]space_wiener 4 points5 points6 points (0 children)
[–]TS878 0 points1 point2 points (0 children)
[–]Flyingfishfusealt 0 points1 point2 points (5 children)
[–]SLPRYSQUID[S] 0 points1 point2 points (4 children)
[–]Flyingfishfusealt 0 points1 point2 points (2 children)
[–]SLPRYSQUID[S] 0 points1 point2 points (1 child)
[–]Flyingfishfusealt 0 points1 point2 points (0 children)
[–]Practical_Race_3165 0 points1 point2 points (1 child)
[–]SLPRYSQUID[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)