Guest User

Untitled

a guest
Apr 17th, 2023
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.54 KB | None | 0 0
  1.  
  2. In a normal cmd.exe console, console is not privileged
  3.  
  4. C:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  5. C:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  6. C:\>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  7. All 3 fail to The token '&&' is not a valid statement separator in this version. https://i.imgur.com/5sUHPeB.png
  8. C:\>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  9. Fails with The system cannot find the path specified. https://i.imgur.com/5sUHPeB.png
  10.  
  11. C:\Users\shodan>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  12. C:\Users\shodan>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  13. C:\Users\shodan>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  14. C:\Users\shodan>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  15. All 4 work https://i.imgur.com/DVGpJFI.png
  16.  
  17. d:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  18. d:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  19. d:\>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  20. all 3 don't work, "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/60NHWLh.png
  21. d:\>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  22. does not work The system cannot find the path specified.
  23.  
  24. Later attempt ??? Not the same result ? d:\ vs D:\ ?!?
  25. D:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  26. D:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  27. D:\>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  28. D:\>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  29. All four fail with "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/c9WcxCp.png
  30.  
  31. d:\share>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  32. d:\share>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  33. d:\share>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  34. all 3 work https://i.imgur.com/0be7DkQ.png
  35. d:\share>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  36. The system cannot find the path specified.
  37.  
  38. Later attempt, not the same results ?!?! again d:\ vs D:\ ?!?
  39. D:\share>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  40. D:\share>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  41. D:\share>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  42. D:\share>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  43. All four work and elevated properly ! https://i.imgur.com/EtfvRyb.png
  44.  
  45. I:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  46. I:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  47. I:\>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  48. I:\>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  49. all don't work, same error, "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/HiJggQ4.png
  50. This result tried twice, second time same result
  51.  
  52. I:\scripts>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  53. I:\scripts>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  54. I:\scripts>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  55. All 3 work
  56. I:\scripts>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  57. does not work The system cannot find the path specified.
  58. This result tried twice, second time same result
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. Double click on I:\Test privilege escalation powershell with arguments.bat
  66. Does not work, console flashes briefly and disappear too fast to see what the error message was
  67. It should pause, but doesn't !
  68.  
  69. Double clicking on I:\scripts\Test privilege escalation powershell with arguments.bat
  70. works https://i.imgur.com/lFMD2MI.png
  71.  
  72. Drag and dropping a bunch of files onto I:\scripts\Test privilege escalation powershell with arguments.bat
  73. works, dropped files are arguments https://i.imgur.com/nUXgWbA.png https://i.imgur.com/PtMT91d.png
  74.  
  75. Drag and dropping files onto
  76. https://i.imgur.com/AMMPXzf.png
  77. Does not work, console flashes briefly and disappear too fast to see what the error message was
  78. It should pause, but doesn't !
  79.  
  80. In a PRIVILEGE console
  81.  
  82. C:\Windows\system32>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  83. C:\Windows\system32>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  84. C:\Windows\system32>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  85. C:\Windows\system32>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  86. All 4 work https://i.imgur.com/60owFpJ.png
  87.  
  88. C:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  89. C:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  90. C:\>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  91. C:\>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  92. All 4 work https://i.imgur.com/sgT3EUx.png
  93.  
  94. D:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  95. D:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  96. D:\>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  97. D:\>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  98. All 4 work https://i.imgur.com/TJyNGy4.png
  99.  
  100. I:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  101. I:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  102. I:\>"i:\scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  103. I:\>"i:scripts\Test privilege escalation powershell with arguments.bat" 1 2 3
  104. All 4 work https://i.imgur.com/S1mxGsF.png
  105.  
  106.  
  107.  
  108.  
  109.  
  110. Earlier attempts, less systematic
  111.  
  112. d:\share>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  113. works https://i.imgur.com/ABFyegP.png
  114.  
  115. d:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  116. does not work "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/f2DURU2.png
  117.  
  118. I:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  119. does not work "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/QjgGtn7.png
  120.  
  121. I:\scripts>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  122. does not work, "not recognized as a command"
  123.  
  124. I:\scripts>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  125. works https://i.imgur.com/gpQSMte.png
  126.  
  127. I:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  128. does not work "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/NSdOOcb.png
  129.  
  130. d:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  131. does not work "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/9lrP4e8.png
  132.  
  133. d:\share>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  134. works https://i.imgur.com/tya1pCl.png
  135.  
  136. C:\>"i:\Test privilege escalation powershell with arguments.bat" 1 2 3
  137. does not work "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/CKrAoxl.png
  138.  
  139. C:\>"i:Test privilege escalation powershell with arguments.bat" 1 2 3
  140. does not work "The token '&&' is not a valid statement separator in this version." https://i.imgur.com/DegmN35.png
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147. full error text
  148. At line:1 char:82
  149. + ... Verb RunAs -FilePath cmd -ArgumentList "/c "" cd /d ""d:\" && ""I:\Te ...
  150. + ~~
  151. The token '&&' is not a valid statement separator in this version.
  152. At line:1 char:85
  153. + ... b RunAs -FilePath cmd -ArgumentList "/c "" cd /d ""d:\" && ""I:\Test ...
  154. + ~~
  155. Expressions are only allowed as the first element of a pipeline.
  156. At line:1 char:87
  157. + ... -FilePath cmd -ArgumentList "/c "" cd /d ""d:\" && ""I:\Test privile ...
  158. + ~~~~~~~
  159. Unexpected token 'I:\Test' in expression or statement.
  160. At line:1 char:157
  161. + ... \Test privilege escalation powershell with arguments.bat"" 1 2 3 "" "
  162. + ~
  163. The string is missing the terminator: ".
  164. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
  165. + FullyQualifiedErrorId : InvalidEndOfLine
Advertisement
Add Comment
Please, Sign In to add comment