User Controls
Posts by The Self Taught Man
-
2015-09-23 at 11:02 PM UTC in BlackmassJohnny Depp puts the swish in swashbuckling.
-
2015-09-23 at 10:58 PM UTC in What's wrong with my class.
Oh top kek, typos ruining my life.
We all do it :) Is it working now? -
2015-09-23 at 10:52 PM UTC in What's wrong with my class.Also, is your subnet not supposed to have a period after 192?
subnet = "192168.0.0/24" -
2015-09-23 at 10:51 PM UTC in What's wrong with my class.
I was about to but then is aw i already have that piece of code there, here's the entire script for reference.
import socket
import os
import struct
from ctypes import *
import threading
import time
from netaddr import IPNetwork, IPAddress
# Host to listen on
host = "192.168.0.011"
# Subnet to target
subnet = "192168.0.0/24"
# Magic string we'll check ICMP responses for
magic_message = "NIGGERS!"
# This sprays out the UDP datagrams
def udp_sender(subnet,magic_message):
time.sleep(5)
sender = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
for ip in IPNetwork(subnet):
try:
sender.sendto(magic_message,("%s" % ip,65212))
except:
pass
# Start sending packets
t = threading.Thread(target=udp_sender,args=(subnet,magic_message))
t.start
# Our IP header.
class IP(Structure):
_fields_=[
("ihl", c_ubyte, 4),
("version", c_ubyte, 4),
("tos", c_ubyte),
("len", c_ushort),
("id", c_ushort),
("offset", c_ushort),
("ttl", c_ubyte),
("protocol_num",c_ubyte),
("sum", c_ushort),
("src", [COLOR=#000000][FONT=Consolas]c_uint32[/FONT][/COLOR]),
("dst",[COLOR=#000000][FONT=Consolas]c_uint32[/FONT][/COLOR])
]
def _new_(self, socket_buffer=None):
return self.from_buffer_copy(socket_buffer)
def _init_(self, socket_buffer=None):
# Map protocol constants to their names
self.protocol_map = {1:"ICMP", 6:"TCP", 17:"UDP"}
# Human readable IP addresses
self.src_address = socketinet_ntoa(struct.pack("<L",self.src))
self.dst_address = socket.inet_ntoa(struct.pack("<L",self.dst))
# Human readable protocol
try:
self.protocol = self.protocol_map[self.protocol_num]
except:
self.protocol = str(self.protocol_num)
if os.name == "nt":
socket_protocol = socket.IPPROTO_IP
else:
socket_protocol = socket.IPPROTO_ICMP
sniffer = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket_protocol)
sniffer.bind((host, 0))
sniffer.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1)
if os.name == "nt":
sniffer.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON)
try:
while True:
# Read in a packet
[COLOR=#000000]raw_buffer [/COLOR][COLOR=#000000]=[/COLOR][COLOR=#000000] sniffer[/COLOR][COLOR=#000000].[/COLOR][COLOR=#000000]recvfrom[/COLOR][COLOR=#000000]([/COLOR][COLOR=#800000]65535[/COLOR][COLOR=#000000])[[/COLOR][COLOR=#800000]0[/COLOR][COLOR=#000000]][/COLOR] # print raw_buffer
# Create an IP header from the first 20 bytes of the buffer
ip_header = IP(raw_buffer[0:20])
# Print out the protocol that was detected and the hosts
print "Protocol: %s %s -> %s" % (ip_header.protocol, ip_header.src_address, ip_header.dst_address)
print "ICMP -> Type: %d Code: %d" % (icmp_header.type, icmp_header.code)
# Now check for type 3 and code
if icmp_header.code == 3 and icmp_header.type == 3:
# Make sure host is in target subnet
if IPAddress(ip_header.src_address) in IPNetwork(subnet):
# Make sure it has our magic message
if raw_buffer[len(raw_buffer)-len(magic_message):] == magic_message:
print "Host up: %s" % ip_header.src_address
# Handle CTRL+C
except KeyboardInterrupt:
# If we're using Windows turn off promisuous mode
if os.name == "nt":
sniffer.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)
class ICMP(Structure):
_fields_= [
("type", c_ubyte),
("code", c_ubyte),
("checksum", c_ushort),
("unused", c_ushort),
("next_hop_mtu",c_ushort)
]
def _new_(self, socket_buffer):
return self.from_buffer_copy(socket_buffer)
def _init_(self, socket_buffer):
pass
print "Protocol: %s %s -> %s (ip_header.protocol, ip_header.src_adress, ip_header.dst_address)"
# If it's ICMP we want items
if ip_header.protocol == "ICMP":
# Calculate where our ICMP packet startswith
offset = ip_header.ihl * 4
buf = raw_buffer[offset:offset + sizeof(ICMP)]
# Create ICMP structure
icmp_header = ICMP(buf)
print "ICMP -> Type: %d Code %d" % (icmp_header.type, icmp_header.code)
Try that code in the quote :) -
2015-09-23 at 9:08 PM UTC in What's wrong with my class.
Lol it's ok, don't have a beautifier though. Just copypasta in code tags?
add this to the top above sniffer =
[FONT=Consolas][FONT=inherit][SIZE=12px]if[/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px] os.name [/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px]==[/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px]"nt"[/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px]:
socket_protocol [/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px]=[/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px] socket.IPPROTO_IP
else:
socket_protocol [/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px]=[/SIZE][/FONT][/FONT][FONT=Consolas][FONT=inherit][SIZE=12px] socket.IPPROTO_ICMP[/SIZE][/FONT][/FONT] -
2015-09-23 at 8:32 PM UTC in Motherfucking faggot FUCKS!!!11!1!2
FBI does collaborative work with international police to bring down deepweb CP sites, so you see my problem there.
Yeah cept you troll the whole pedo thing. -
2015-09-23 at 8:01 PM UTC in What's wrong with my class.formatting's gone to fuck, sorry. use a beautifier and test it.
-
2015-09-23 at 8 PM UTC in What's wrong with my class.
I only need the first 20 bytes though that's what the [0:20] is for. And if the response is not an integer when i receive the first 20 bytes it's not going to be an integer if i receive all of them either, i'd think.[/QUOTE
[FONT=Consolas][SIZE=12px]if[/SIZE][/FONT][FONT=Consolas][SIZE=12px] os.name [/SIZE][/FONT][FONT=Consolas][SIZE=12px]==[/SIZE][/FONT][FONT=Consolas][SIZE=12px] [/SIZE][/FONT][FONT=Consolas][SIZE=12px]"nt"[/SIZE][/FONT][FONT=Consolas][SIZE=12px]: socket_protocol [/SIZE][/FONT][FONT=Consolas][SIZE=12px]=[/SIZE][/FONT][FONT=Consolas][SIZE=12px] socket.IPPROTO_IP else: socket_protocol [/SIZE][/FONT][FONT=Consolas][SIZE=12px]=[/SIZE][/FONT][FONT=Consolas][SIZE=12px] socket.IPPROTO_ICMP [/SIZE][/FONT] sniffer = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket_protocol) sniffer.bind((host, 0)) sniffer.setsockopt(socket.IPPROTO_IP, socket.IP_HDRINCL, 1) if os.name == "nt": sniffer.ioctl(socket.SIO_RCVALL, socket.RCVALL_ON) try: while True: # Read in a packet raw_buffer = sniffer.recvfrom(65565)[0] print raw_buffer # Create an IP header from the first 20 bytes of the buffer ip_header = IP(raw_buffer[0:20]) # Print out the protocol that was detected and the hosts print "Protocol: %s %s -> %s" % (ip_header.protocol, ip_header.src_address, ip_header.dst_address) print "ICMP -> Type: %d Code: %d" % (icmp_header.type, icmp_header.code) # Now check for type 3 and code if icmp_header.code == 3 and icmp_header.type == 3: # Make sure host is in target subnet if IPAddress(ip_header.src_address) in IPNetwork(subnet): # Make sure it has our magic message if raw_buffer[len(raw_buffer)-len(magic_message):] == magic_message: print "Host up: %s" % ip_header.src_address # Handle CTRL+C except KeyboardInterrupt: # If we're using Windows turn off promisuous mode if os.name == "nt": sniffer.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF) -
2015-09-23 at 7:54 PM UTC in What's wrong with my class.
I only need the first 20 bytes though that's what the [0:20] is for. And if the response is not an integer when i receive the first 20 bytes it's not going to be an integer if i receive all of them either, i'd think.
Print out the result of the raw buffer and see what it returns -
2015-09-23 at 7:14 PM UTC in Your home is so momless[FONT=verdana, geneva, lucida, lucida grande, arial, helvetica, sans-serif]she didn't even come home for dinner last night.[/FONT]
-
2015-09-23 at 7:12 PM UTC in ITT We Thank mmQHis very life force depends on nigga thanks. His nigga thanks have been mysteriously vanishing. If everyone thanks every post he makes ITT we may be able to keep him from joining mark, for now.
-
2015-09-23 at 7:07 PM UTC in Motherfucking faggot FUCKS!!!11!1!2
So? Ever heard of Interpol? I commit at least 10 cyber crimes a day.
Interpol maybe but the FBI?
Also at thelittlesnigger, i don't have a congressman, it's not how politics work in Holland. -
2015-09-23 at 7:06 PM UTC in Your mom is so homelessYour mom is so homeless I asked her if I could use the bathroom and she said "Just pick an alley".
-
2015-09-23 at 6:14 PM UTC in Motherfucking faggot FUCKS!!!11!1!2we got [Size=7]HOLLAND[/size] [Size=6]OLLANDH[/size] [Size=5]LLANDHO[/size] [Size=4]LANDHOL[/size] [Size=3]ANDHOLL[/size] [Size=4]NDHOLLA[/size] [Size=5]DHOLLAN[/size] [Size=6]HOLLAND[/size] [Size=7]NIGGERS[/size] [size=4]AMONG[/size] [size=7]US[/size]
-
2015-09-23 at 5:47 PM UTC in Motherfucking faggot FUCKS!!!11!1!2Better write a letter to your congressman. Word it strongly. Talk about freedom. Tell him you wont vote for him if things dont change. See how many fucks he gives.
-
2015-09-23 at 5:41 PM UTC in Motherfucking faggot FUCKS!!!11!1!2Um you're in Europe.
-
2015-09-23 at 4:57 PM UTC in The apocalypse starts tomorrow september 23rd
I have great foot health.
Probably from sticking them in your mouth so often. -
2015-09-23 at 4:26 PM UTC in What Games Are You Currently Playing
-
2015-09-23 at 4:07 PM UTC in The apocalypse starts tomorrow september 23rdThe end times are going to involve lots and lots of walking. Walking requires good foot health and good foot health starts with healthy foot skin. I'm prepared, are you?
-
2015-09-23 at 3:38 PM UTC in Lol guise guess who sent me an e-mail.He's really no different than Arnox.