Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Invoke-WebRequest -uri ("https://some.thing.com/adminui/settings_support.php") -WebSession $ms -Method POST
- Name Value
- ---- -----
- User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063
- Host some.thing.com
- cookie kboxid=97d0e93e002f4846ef9211d013f4b261; KACE_CSRF_TOKEN=aad3f8c254d2f25bd24e35c51d654541822080da825d6353937a7fe294216089689cc68480299b657f4fb1e9be77ac711a658a96e2df50ffc5e242b94bd9baf4
- Accept-Encoding gzip, deflate
- Referer http://some.thing.com/adminui/settings_support.php
- accept text/html, application/xhtml+xml, image/jxr, */*
- Accept-Language en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3
- $username ="user"
- $password ='pass'
- $ie = new-object -ComObject "InternetExplorer.Application"
- $init_url = "http://some.thing.com/adminui/welcome.php"
- $ie.visible = $true
- $ie.silent = $true
- $ie.navigate($init_url)
- while ($ie.busy -eq $true) {start-sleep 1}
- $textbox_name = $ie.Document.getElementsBytagName("INPUT")|where {$_.name -eq 'LOGIN_name'}
- $textbox_password = $ie.Document.getElementsBytagName("INPUT")|where {$_.name -eq 'LOGIN_PASSWORD'}
- $button_login = $ie.Document.getElementsBytagName("BUTTON")
- $textbox_name.value = $username
- $textbox_password.value = $password
- $button_login.item().click()
- $setting_url = "http://some.thing.com/adminui/settings_control_panel.php"
- $ie.navigate($setting_url)
- while ($ie.busy -eq $true) {start-sleep 1}
- $support_url = "http://some.thing.com/adminui/settings_support.php"
- $ie.navigate($support_url)
- while ($ie.busy -eq $true) {start-sleep 1}
- $ie.document.getElementsByTagName("a")|where {$_.innertext -eq 'Retrieve appliance activity logs'}.item.click()
- enter code here
- (Invoke-WebRequest -Uri "https://some.thing.com/adminui/settings_support.php").Forms
- $headers = @{"name"="value"}
- $uri = "https://some.thing.com/adminui/settings_support.php"
- $outpath = "$PSScriptRootkbox_logs.tgz"
- Invoke-WebRequest -Headers $headers -Uri $uri -Method POST -OutFile $outpath
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement