darkoperator / Posh-Shodan

PowerShell Module to interact with the Shodan service
BSD 3-Clause "New" or "Revised" License
134 stars 54 forks source link

Add some sample scripts #2

Open ahhh opened 8 years ago

ahhh commented 8 years ago

Add some sample scripts / templates for programmatically using the wrapper

ahhh commented 8 years ago

Any update on merging this branch @darkoperator ?

darkoperator commented 8 years ago

Can you make them follow https://github.com/PoshCode/PowerShellPracticeAndStyle the use of echo is just ugly in a PS script, also make sure it follows the same indentation, brace and other styles of the module it self. Thanks you for the effort and work. looking forward to merging it once they are modified.

On Feb 16, 2016, at 9:13 PM, ahhh notifications@github.com wrote:

Any update on merging this branch @darkoperator https://github.com/darkoperator ?

— Reply to this email directly or view it on GitHub https://github.com/darkoperator/Posh-Shodan/pull/2#issuecomment-184960347.

ahhh commented 8 years ago

@darkoperator Thank you for the feedback, please see edits

ahhh commented 8 years ago

Any update?

darkoperator commented 8 years ago

I have not taken a look, will do today.

On Mar 29, 2016, at 12:51 PM, ahhh notifications@github.com wrote:

Any update?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/darkoperator/Posh-Shodan/pull/2#issuecomment-202994994

darkoperator commented 8 years ago

One more set of recommendations, instead of write-host each property

-        Write-Output "IP: $($result.ip_str)"
-        Write-Output "Port: $($result.port)"
-        Write-Output "Domain: $($result.domains)"  
-        Write-Output "Organization: $($result.org)"
-        Write-Output "Location $($result.location)"
-        Write-Output "Time: $($result.timestamp)"
-        Write-Output "Product $($result.product)"
-        Write-Output "Protocol $($result.transport)"
-        Write-Output "Shodan Method Used: $($result._shodan)"
-        Write-Output "Data: $($result.data)"
-        Write-Output ""
-    }

better to output and object, since it is PSv3 and above you can create an ordered hash table ([ordered]@{}) out each property as a member of the hash table and then do new-object -typename psobject -properties that way you return an object. that can then be manipulated.

on the relative path better to use $psscriptroot\file than .\file