Quick One Line Powershell scripts to detect for webshells, possible zips, and logs. Each of the scripts after running will ouput to a CSV located in the temp drive at the root of C:
- This will start at the path specified
- Work it's way through each folder and find the files inside of it.
- Each file that it hits it will then start checking the file for the pattern "\w*://\w/<\w*\s.<.>"
- Every match that it gets it will select the path to the file and the line in the file that it found
- After selection it will write that to the CSV located int he temp folder at the root of C:
- This will start at the path specified
- Work it's way through each folder and find the files inside of it.
- Each file that it hits it will then start checking the file for the pattern "Set-OabVirtualDirectory"
- This may pick up more than what we want -- but its the best way I have at the moment
- Every match that it gets it will select the path to the file and the line in the file that it found
- After selection it will write that to the CSV located int he temp folder at the root of C:
- Starting at the root of C:
- This will look through every directory for any thing with the file extention zip or tar or gzip or 7z or rar or dmp
- zip -- for any files that would have been zipped and pulled off the server
- tar -- for any folder that would have been tar'ed and pulled off the server
- gzip -- for any files that would have been gziped and pulled off teh server
- 7z -- for any files that would have been 7z and pulled off teh server
- rar -- for any files that would have been rar and pulled off teh server
- dmp -- any possible process dumps
- This will of course pull way more than you will ever need to lookt through
- This will be output to a CSV in the temp folder at the root of C:
- The great thing is that since its in a csv file we can sort by date
- our checks included anything that was back to septemeber of last year -- since there has been reports back to octber of last year
- The great thing is that since its in a csv file we can sort by date