Advertisement
Guest User

Untitled

a guest
Jan 10th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. Invoke-WebRequest -uri ("https://some.thing.com/adminui/settings_support.php") -WebSession $ms -Method POST
  2.  
  3. Name Value
  4. ---- -----
  5. 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
  6. Host some.thing.com
  7. cookie kboxid=97d0e93e002f4846ef9211d013f4b261; KACE_CSRF_TOKEN=aad3f8c254d2f25bd24e35c51d654541822080da825d6353937a7fe294216089689cc68480299b657f4fb1e9be77ac711a658a96e2df50ffc5e242b94bd9baf4
  8. Accept-Encoding gzip, deflate
  9. Referer http://some.thing.com/adminui/settings_support.php
  10. accept text/html, application/xhtml+xml, image/jxr, */*
  11. Accept-Language en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3
  12.  
  13. $username ="user"
  14. $password ='pass'
  15.  
  16. $ie = new-object -ComObject "InternetExplorer.Application"
  17.  
  18. $init_url = "http://some.thing.com/adminui/welcome.php"
  19. $ie.visible = $true
  20. $ie.silent = $true
  21. $ie.navigate($init_url)
  22.  
  23. while ($ie.busy -eq $true) {start-sleep 1}
  24.  
  25. $textbox_name = $ie.Document.getElementsBytagName("INPUT")|where {$_.name -eq 'LOGIN_name'}
  26. $textbox_password = $ie.Document.getElementsBytagName("INPUT")|where {$_.name -eq 'LOGIN_PASSWORD'}
  27. $button_login = $ie.Document.getElementsBytagName("BUTTON")
  28.  
  29. $textbox_name.value = $username
  30. $textbox_password.value = $password
  31. $button_login.item().click()
  32.  
  33. $setting_url = "http://some.thing.com/adminui/settings_control_panel.php"
  34. $ie.navigate($setting_url)
  35. while ($ie.busy -eq $true) {start-sleep 1}
  36. $support_url = "http://some.thing.com/adminui/settings_support.php"
  37. $ie.navigate($support_url)
  38. while ($ie.busy -eq $true) {start-sleep 1}
  39.  
  40. $ie.document.getElementsByTagName("a")|where {$_.innertext -eq 'Retrieve appliance activity logs'}.item.click()
  41. enter code here
  42.  
  43. (Invoke-WebRequest -Uri "https://some.thing.com/adminui/settings_support.php").Forms
  44.  
  45. $headers = @{"name"="value"}
  46. $uri = "https://some.thing.com/adminui/settings_support.php"
  47. $outpath = "$PSScriptRootkbox_logs.tgz"
  48.  
  49. Invoke-WebRequest -Headers $headers -Uri $uri -Method POST -OutFile $outpath
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement