# of the application # dropping unnecessary priviliges umit.umpa.utils.security.drop_priviliges() # create new IP object ip = IP() # setting some fields ip.src = "127.0.0.1" ip.dst = "67.205.14.183" # the same for TCP tcp = TCP() # setting some fields tcp.srcport = 2958 tcp.dstport = 0 # also, SYN flag will be set up. here SYN tcp.set_flags('flags', syn=True) # create payload object and set the data while calling constructor payload = Payload(data="something here") # create a new packet and include one protocol (ip) packet = umit.umpa.Packet(ip) # packing another protocol into our packet packet.include(tcp, payload) # creating new socket connection # NOTE: we need to raise our priviliges. # we can call super_priviliges() function and pass function which need these
from umit.umpa.protocols import Payload from umit.umpa import Packet from umit.umpa import Socket from umit.umpa._sockets import INET from umit.umpa.utils.security import super_priviliges ip = IP(src='127.0.0.1', dst='127.0.0.1') #print "Value Of fielf key for Ipv6 is Here" #print(ip) #print(list(ip.get_fields_keys())) #print ICMP(type=8) tcp = TCP() tcp.srcport = 295 tcp.dstport = 255 tcp.set_flags('flags', syn=True) #payload = Payload() #payload.data = "this is umpa!" first_packet = Packet(ip, tcp) #first_packet.include(payload) #print "Structure Of Ipv4 Packet" #print first_packet #print "_____________________" sock = super_priviliges(INET) sock.send(first_packet) #print tcp._checksum ####################################################################### #udp = UDP(srcport=25, dstport=362) #ip.ttl = "windows"
from umit.umpa.protocols import ICMP from umit.umpa.protocols import Payload from umit.umpa import Packet from umit.umpa import Socket from umit.umpa._sockets import INET from umit.umpa.utils.security import super_priviliges ip = IP(src='127.0.0.1', dst='127.0.0.1') #print "Value Of fielf key for Ipv6 is Here" #print(ip) #print(list(ip.get_fields_keys())) #print ICMP(type=8) tcp = TCP() tcp.srcport = 295 tcp.dstport = 255 tcp.set_flags('flags', syn=True) #payload = Payload() #payload.data = "this is umpa!" first_packet = Packet(ip, tcp) #first_packet.include(payload) #print "Structure Of Ipv4 Packet" #print first_packet #print "_____________________" sock = super_priviliges(INET) sock.send(first_packet) #print tcp._checksum ####################################################################### #udp = UDP(srcport=25, dstport=362) #ip.ttl = "windows"
# of the application # dropping unnecessary priviliges umit.umpa.utils.security.drop_priviliges() # create new IP object ip = IP() # setting some fields ip.src = "127.0.0.1" ip.dst = "67.205.14.183" # the same for TCP tcp = TCP() # setting some fields tcp.srcport= 2958 tcp.dstport = 0 # also, flags will be set up. here SYN + ACK tcp.set_flags('flags', syn=True, ack=True) # create new packet with strict=False # we can build compleate insane packets now packet = umit.umpa.Packet(strict=False) # packing protocols into our packet # NOTE: the order of the protocols are abnormal # you will get the warning. # you can switch off warnings if needed: packet.warn = False packet.include(tcp, ip) # creating new socket connection