Skip to content

Comments

Add some sample scripts#2

Open
ahhh wants to merge 13 commits intodarkoperator:masterfrom
ahhh:master
Open

Add some sample scripts#2
ahhh wants to merge 13 commits intodarkoperator:masterfrom
ahhh:master

Conversation

@ahhh
Copy link

@ahhh ahhh commented Nov 29, 2015

Add some sample scripts / templates for programmatically using the wrapper

ahhh added 6 commits November 28, 2015 18:00
some sample scripts for interacting with Posh-Shodan:
Added Test-API.ps1 which makes sure the Posh-Shodan wrapper and Shodan
API are working correctly.
Added Simple-Query.ps1, a wrapper for the Posh-Shodan library that helps
users make non-token queries and parse a simple subset of the results
upload some sample queries
sample-queries.ps1 provides new users with inspirational / sample
queries to get their feet wet with the Shodan API
save-output.ps1 provides new users with ways to save their Shodan API
queries to easily parsable file formats
modify save output and add two new queries
simple_netcam_search is a no token search for belkin netcams
simple_airlink_search is a no token search for arilink webcam servers
add new sample searches
Consolidate and fix errors in Sample-Queries.ps1
@ahhh
Copy link
Author

ahhh commented Feb 17, 2016

Any update on merging this branch @darkoperator ?

@darkoperator
Copy link
Owner

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 #2 (comment).

@ahhh
Copy link
Author

ahhh commented Feb 18, 2016

@darkoperator Thank you for the feedback, please see edits

@ahhh
Copy link
Author

ahhh commented Mar 29, 2016

Any update?

@darkoperator
Copy link
Owner

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 #2 (comment)

@darkoperator
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants