Jump to content

Need help with a Powershell script

roastduck

So I'm trying to scan a client computer for a zeroaccess rootkit virus. A buddy of mine came up with a script that would scan the C:\ drive against a .csv containing the list of startups from bleepingcomputer.com. Here is the script:

$data = import.csv E:\rootkitstartups.csvforeach ($i in $data){Get-Childitem C:\ -recurse -Include $i.Fname | %{write-Host $_.Fullname}

My question is how do I modify the script to output matching files to a text or log file?
Link to comment
Share on other sites

Link to post
Share on other sites

 

So I'm trying to scan a client computer for a zeroaccess rootkit virus. A buddy of mine came up with a script that would scan the C:\ drive against a .csv containing the list of startups from bleepingcomputer.com. Here is the script:

 

$data = import.csv E:\rootkitstartups.csvforeach ($i in $data){Get-Childitem C:\ -recurse -Include $i.Fname | %{write-Host $_.Fullname}
My question is how do I modify the script to output matching files to a text or log file?

 

 

http://usa.kaspersky.com/downloads/TDSSKiller

--Neil Hanlon

Operations Engineer

Link to comment
Share on other sites

Link to post
Share on other sites

 

So I'm trying to scan a client computer for a zeroaccess rootkit virus. A buddy of mine came up with a script that would scan the C:\ drive against a .csv containing the list of startups from bleepingcomputer.com. Here is the script:

 

$data = import.csv E:\rootkitstartups.csvforeach ($i in $data){Get-Childitem C:\ -recurse -Include $i.Fname | %{write-Host $_.Fullname}
My question is how do I modify the script to output matching files to a text or log file?

 

Try:

$data = import.csv E:\rootkitstartups.csvforeach ($i in $data){Get-Childitem C:\ -recurse -Include $i.Fname | Out-File C:\yourtextdocument.txt

or if not:

$data = import.csv E:\rootkitstartups.csvforeach ($i in $data){C:\Get-Childitem C:\ -recurse -Include $i.Fname | %{write-Host $_.Fullname} >> C:\textdoc.txt

I have VERY little experience with Powershell so my bad if I got it wrong.

CPU: i5 4670k @ 3.4GHz + Corsair H100i      GPU: Gigabyte GTX 680 SOC (+215 Core|+162 Mem)     SSD: Kingston V300 240GB (OS)      Headset: Logitech G930 

Case: Cosair Vengance C70 (white)                RAM: 16GB TeamGroup Elite Black DDR3 1600MHz       HDD: 1TB WD Blue                              Mouse: Logitech G602

OS: Windows 7 Home Premium                       PSUXFX Core Edition 750w                                                Motherboard: MSI Z97-G45               Keyboard: Logitech G510

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×