0

BTLO – Network Analysis – Web Shell

4 min read

Visits: 467

5
(5)

Scenario :

The SOC received an alert in their SIEM for ‘Local to Local Port Scanning’ where an internal private IP began scanning another internal system. Can you investigate and determine if this activity is malicious or not? You have been provided a PCAP, investigate using any tools you wish.


Sur ce challenge, nous utiliserons principalement Wireshark et tshark.

Challenge Submission :

What is the IP responsible for conducting the port scan activity?

Afin de retrouver l’ip responsable du scan de port nous pouvons par exemple vérifier les flags SYN à 1 et les ACK à 0 (TCP SYN – nmap -sS) à l’aide de ce filtre Wireshark :

tcp.flags.syn==1 and tcp.flags.ack==0

Ce qui nous donnes bien l’adresse IP source responsable :

network

What is the port range scanned by the suspicious host?


What is the type of port scan conducted?

Nous avons déjà répondu à la question plus haut, c’est donc du TCP SYN.


Two more tools were used to perform reconnaissance against open ports, what were they? 

Pour celle-ci, nous pouvons utiliser l’outil tshark afin de récupérer les différents user-agent qui ont effectué la phase de reconnaissance :

tshark -Y 'http contains "User-Agent:"' -T fields -e http.user_agent -r BTLOPortScan.pcap | sort | uniq -c | sort -nr

What is the name of the php file through which the attacker uploaded a web shell?

Afin de retrouver ce fichier, il est possible d’utiliser ce filtre wireshark permettant de récupérer les requêtes POST de la part de l’ip malveillante 10.251.96.4 :

ip.src == 10.251.96.4 && http.request.method == POST


What is the name of the web shell that the attacker uploaded? 

Pour retrouver le nom du fichier il suffit simplement d’utiliser la même requête et de regarder la partie MIME :


What is the parameter used in the web shell for executing commands?

Afin d’identifier le paramètre permettant d’exécuter les commandes nous pouvons utiliser cette commande tshark :

tshark -Y 'http contains "dbfunctions.php"' -r BTLOPortScan.pcap | s
ort | uniq -c | sort -nr

What is the first command executed by the attacker?

Afin de trier et savoir qu’elle est la première commande exécutée nous utilisons cette commande :

tshark -Y 'http contains "dbfunctions.php"' -T fields -e frame.time_delta -e http.request.uri -r BTLOPortScan.pcap | sort -n


What is the type of shell connection the attacker obtains through command execution?

Comme nous pouvons le voir à la question précédente, il s’agit d’un reverse shell :


What is the port he uses for the shell connection? 

Le port et l’ip sont présents dans le reverse shell :

Quelle note mérite cet article ?

Average rating 5 / 5. Vote count: 5

No votes so far! Be the first to rate this post.

S’abonner
Notification pour
guest
0 Commentaires
Commentaires en ligne
Afficher tous les commentaires