Hello,
I'm relatively new to powershell. I'm a security analyst that has to go through a lot of data, and am trying to automate a script in powershell to give me reputation checks on an IP address.
If I run for instance the first part, where it asks you the IP, it'll pull up internet explorer and enter in the IP, and automatically click the link to get the reputation check. The problem is, it won't do it for the other tabs, although if I run the websites individually it will get the data. Any advice would be appreciated.
Still learning through CBT nuggets, and books.....thinking I bit off more than I can chew with this one.
Here is what I have so far.
$name = Read-Host 'Which IP do you want to scan?'
$ie = New-Object -com InternetExplorer.Application
$ie.visible=$true
#this above command prompts you to enter in the IP that you want to get reputation checks for
<#$ie.navigate("http://www.trustedsource.org/")
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("q").value= $name
start-sleep 1
$ie.document.getElementById("dummy").Click()
#>
#trusted source works
$ie.navigate("http://urlquery.net",0x1000)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("url").value= "$name"
start-sleep 1
$ie.document.getElementById("url-submit").Click()
$ie.navigate("http://whois.domaintools.com",0x1000)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("landing-whois").value= "$name"
start-sleep 1
$ie.document.getElementById("whois-search").Click()
#whois website works
<#
$ie.navigate2("http://www.ipvoid.com",0x1000)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("ip_address").value= "$name"
start-sleep 1
$submit = $ie.Document.getElementsByTagName('button') | where-object {$_.type -eq "submit"}
$submit.Click()
#ipvoid works and the submit button is clicked in a different way than others
$ie.navigate2("http://www.dnsbl.info/",0x1000)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$submit = $ie.Document.getElementsByTagName('input') | where-object {$_.type -eq "submit"}.value= "$name"
start-sleep 1
#still need to figure out how to submit our requested rep check into the search box
#also need to figure out how to click the submt button on the above website
$ie.navigate2("https://www.virustotal.com/",0x1000)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
start-sleep 1
#virus total will be hard, need to find out how to click the URL button,
#then input the name/IP of our reputation check, and finally click the submit button
#>
$ie.navigate("www.borderware.com",0x1000)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("").value= "$name"
start-sleep 1
$ie.document.getElementById("").Click()
$ie.navigate("https://ers.trendmicro.com/reputations",0x1000)
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("").value= "$name"
start-sleep 1
$ie.document.getElementById("").Click()