Powershell - pwpush.com - 提交按钮
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Powershell - pwpush.com - 提交按钮相关的知识,希望对你有一定的参考价值。
我一直在尝试使用Powershell将密码推送到网站并检索链接,但我不知道如何使其单击按钮。
到目前为止我的代码看起来像:
#The idea is to use powershell to interact andgenerate passwords links
$IE = New-Object -ComObject "InternetExplorer.Application"
$RequestURI = "https://pwpush.com"
$Password = "password_payload";
$SubmitButton = "submit";
$IE.Visible = $true
$IE.Silent = $true
$IE.Navigate($RequestURI)
While ($IE.Busy) {
Start-Sleep -Milliseconds 100
}
$Doc = $IE.Document
$Doc.getElementsByTagName("input") | ForEach-Object {
if ($_.id -ne $null){
if ($_.id.contains($SubmitButton)) {$SubmitButton = $_}
if ($_.id.contains($Password)) {$Password = $_}
}
}
$Password.value = "1234"
$SubmitButton.click()
Invoke-WebRequest https://pwpush.com/assets/application-cdd96c030d1ee817dae58ac877bd0213c8ea2859b1395e7bd83ceb37dadf5bb5.js
答案
弄清楚:)代码在那里:
https://github.com/kprocyszyn/tools/blob/master/push-pwpush.ps1
<#
.SYNOPSIS
Pushes the password to pwpush.com and retrieves the link.
.DESCRIPTION
The idea behind the https://pwpush.com is to create links with password which will expire after specific time - therefore password are not left in clear text in email forever.
The Push-PWPush will generate the link with the password provided, or will generate random number as the password, if no password is provided.
.NOTES
Password requires Internet Explorer to work. Things which are going to be added:
- Custom link expriration
- More sophisticate random password
- Customised settings for random password
#>
[string]$Password = Read-Host "Type password or leave blank for random"
If (!$Password) {$Password = (Get-Random)}
Write-Host "Using password: $Password"
$IE = New-Object -ComObject "InternetExplorer.Application"
$RequestURI = "https://pwpush.com"
$IE.Visible = $false
$IE.Silent = $true
$IE.Navigate($RequestURI)
While ($IE.Busy) {Start-Sleep -Seconds 1}
$Payload = "password_payload";
$Doc = $IE.Document
$Doc.getElementsByTagName("input") | ForEach-Object {
if ($_.id -ne $null){
if ($_.id.contains($Payload)) {$Payload = $_}
}
if ($_.name -ne $null){
if ($_.name.contains($commit)) {$SubmitButton = $_}
}
}
$Payload.value = $Password
Start-sleep -Seconds 1
$SubmitButton.click()
While ($IE.Busy) {Start-Sleep -Seconds 1}
$URL = "url"
$Doc.getElementsByTagName("input") | ForEach-Object {
if ($_.id -ne $null){
if ($_.id.contains($URL)) {$URL = $_}
}
}
$URL.value
以上是关于Powershell - pwpush.com - 提交按钮的主要内容,如果未能解决你的问题,请参考以下文章
powershell PowerShell:启动PowerShell作为其他用户提升
powershell [提示输入powershell] #powershell #input #prompt