Share Files
Setup Shared folder
There might come times when I’ll need to transfer some files to the REMnux machine. For that, I’ll share a local folder of my host to be accessible from my REMnux machine.
To set up the shared folder:
- Go to VM settings
- Options tab > Shared folders > Set to always enabled
- Set the host path for the shared folder
Now on the REMnux machine, I can see the shared folder under /mnt/hgfs.
remnux@remnux:~$ ls /mnt/hgfsmalware-analysis-remnux-shareTransfer Files to victims
To transfer files to a machine such as FlareVM where I’ll run malware samples, I can serve the file using two ways.
Using INetSim
To use INetSim to serve the specific file to the victim:
From the default inetsim.conf file, I can set the http_fakefile values as instructed.
########################################## http_fakefile## Fake files returned in fake mode based on the file extension# in the HTTP request.# The fake files must be placed in <data-dir>/http/fakefiles## Syntax: http_fakefile <extension> <filename> <mime-type>## Default: none#http_fakefile txt sample.txt text/plainhttp_fakefile htm sample.html text/htmlhttp_fakefile html sample.html text/htmlhttp_fakefile php sample.html text/htmlhttp_fakefile gif sample.gif image/gifhttp_fakefile jpg sample.jpg image/jpeghttp_fakefile jpeg sample.jpg image/jpeghttp_fakefile png sample.png image/pnghttp_fakefile bmp sample.bmp image/x-ms-bmphttp_fakefile ico favicon.ico image/x-iconhttp_fakefile exe sample_gui.exe x-msdos-programhttp_fakefile com sample_gui.exe x-msdos-programThe files should be placed under data/http/fakefiles for INetSim to be able to access it each time I run the service.
Using netcat
On linux machines, netcat can be utilized to communicate a file.
On the receiving machine:
nc -lvp SERVING_PORT > file.exeOn the sending machine:
cat FILE_TO_TRANSFER.exe | nc RECEIVING_MACHINE_IP SERVING_PORT