Skip to content

Instantly share code, notes, and snippets.

@daddycocoaman
Created September 19, 2019 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daddycocoaman/319e09d775bdd9044e5a1cbd02f42d96 to your computer and use it in GitHub Desktop.
Save daddycocoaman/319e09d775bdd9044e5a1cbd02f42d96 to your computer and use it in GitHub Desktop.
Because netCAT exists
/* Pings all of your available networks and tells your net that you're snitching
Author: Daddycocoaman */
import System
import System.Net.NetworkInformation
import System.Net
import System.Net.Sockets
import System.Text
BUFFER = ASCIIEncoding().GetBytes("IMSNITCHINGONALLYALLCAUSEMALWARE")
def getBroadcastAddress(address as IPAddress, subnetMask as IPAddress) as IPAddress:
ipAddressBytes = address.GetAddressBytes()
subnetMaskBytes = subnetMask.GetAddressBytes()
broadcastAddress = array(byte, ipAddressBytes.Length)
for i in range(broadcastAddress.Length):
broadcastAddress[i] = (ipAddressBytes[i] | (subnetMaskBytes[i] ^ 255))
return IPAddress(broadcastAddress)
def goSnitch(addr as IPAddress):
ping = Ping()
ping.Send(addr, 1, BUFFER)
def main():
adapters = NetworkInterface.GetAllNetworkInterfaces()
ips = []
for a in adapters:
ips.Extend([[ma.Address, ma.IPv4Mask] for ma in a.GetIPProperties().UnicastAddresses if ma.Address.AddressFamily == AddressFamily.InterNetwork and not IPAddress.IsLoopback(ma.Address)])
broadAddrs = []
for ip in ips:
combo = ip cast List
goSnitch(getBroadcastAddress(combo[0], combo[1]))
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment