Post: packet injection........
05-31-2008, 11:38 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); ok guys seen as though this got removed from ngb here goes......







#define SRC_ETHER_ADDR "aa:aa:aa:aa:aa:aa"
#define DST_ETHER_ADDR "bb:bb:bb:bb:bb:bb"
#define SRC_IP "192.168.0.10"
#define DST_IP "192.168.0.11"

typedef struct EthernetHeader{

unsigned char destination[6];
unsigned char source[6];
unsigned short protocol;

}EthernetHeader;

typedef struct ArpHeader{

unsigned short hardware_type;
unsigned short protocol_type;
unsigned char hard_addr_len;
unsigned char prot_addr_len;
unsigned short opcode;
unsigned char source_hardware[6];
unsigned char source_ip[4];
unsigned char dest_hardware[6];
unsigned char dest_ip[4];
}ArpHeader;


int CreateRawSocket(int protocol_to_sniff)
{
int rawsock;

if((rawsock = socket(PF_PACKET, SOCK_RAW, htons(protocol_to_sniff)))== -1)
{
perror("Error creating raw socket: ");
exit(-1);
}

return rawsock;
}

int BindRawSocketToInterface(char *device, int rawsock, int protocol)
{

struct sockaddr_ll sll;
struct ifreq ifr;

bzero(&sll, sizeof(sll));
bzero(&ifr, sizeof(ifr));

/* First Get the Interface Index */


strncpy((char *)ifr.ifr_name, device, IFNAMSIZ);
if((ioctl(rawsock, SIOCGIFINDEX, &ifr)) == -1)
{
printf("Error getting Interface index !\n");
exit(-1);
}

/* Bind our raw socket to this interface */

sll.sll_family = AF_PACKET;
sll.sll_ifindex = ifr.ifr_ifindex;
sll.sll_protocol = htons(protocol);


if((bind(rawsock, (struct sockaddr *)&sll, sizeof(sll)))== -1)
{
perror("Error binding raw socket to interface\n");
exit(-1);
}

return 1;

}


int SendRawPacket(int rawsock, unsigned char *pkt, int pkt_len)
{
int sent= 0;

/* A simple write on the socket ..thats all it takes ! */

if((sent = write(rawsock, pkt, pkt_len)) != pkt_len)
{
/* Error */
printf("Could only send %d bytes of packet of length %d\n", sent, pkt_len);
return 0;
}

return 1;


}

EthernetHeader* CreateEthernetHeader(char *src_mac, char *dst_mac, int protocol)
{
EthernetHeader *ethernet_header;


ethernet_header = (EthernetHeader *)malloc(sizeof(EthernetHeader));

/* copy the Src mac addr */

memcpy(ethernet_header->source, (void *)ether_aton(src_mac), 6);

/* copy the Dst mac addr */

memcpy(ethernet_header->destination, (void *)ether_aton(dst_mac), 6);

/* copy the protocol */

ethernet_header->protocol = htons(protocol);

/* done ...send the header back */

return (ethernet_header);
}

ArpHeader *CreateArpHeader(void)
{
ArpHeader *arp_header;
in_addr_t temp;

arp_header = (ArpHeader *)malloc(sizeof(struct ArpHeader));

/* Fill the ARP header */
arp_header->hardware_type = htons(ARPHRD_ETHER);
arp_header->protocol_type = htons(ETHERTYPE_IP);
arp_header->hard_addr_len = 6;
arp_header->prot_addr_len = 4;
arp_header->opcode = htons(ARPOP_REPLY);
memcpy(arp_header->source_hardware, (void *)ether_aton(SRC_ETHER_ADDR) , 6);
temp = inet_addr(SRC_IP);
memcpy(&(arp_header->source_ip), &temp, 4);
memcpy(arp_header->dest_hardware, (void *) ether_aton(DST_ETHER_ADDR) , 6);
temp = inet_addr(DST_IP);
memcpy(&(arp_header->dest_ip), &temp, 4);

return arp_header;
}



/* argv[1] is the device e.g. eth0 */

main(int argc, char **argv)
{

int raw;
unsigned char *packet;
EthernetHeader *ethernet_header;
ArpHeader *arp_header;
int pkt_len;

/* Create the raw socket */

raw = CreateRawSocket(ETH_P_ALL);

/* Bind raw socket to interface */

BindRawSocketToInterface(argv[1], raw, ETH_P_ALL);

/* create Ethernet header */

ethernet_header = CreateEthernetHeader(SRC_ETHER_ADDR, DST_ETHER_ADDR, ETHERTYPE_ARP);

/* Create ARP header */

arp_header = CreateArpHeader();

/* Find packet length */

pkt_len = sizeof(EthernetHeader) + sizeof(ArpHeader);

/* Allocate memory to packet */

packet = (unsigned char *)malloc(pkt_len);

/* Copy the Ethernet header first */

memcpy(packet, ethernet_header, sizeof(EthernetHeader));

/* Copy the ARP header - but after the ethernet header */

memcpy((packet + sizeof(EthernetHeader)), arp_header, sizeof(ArpHeader));

/* Send the packet out ! */

if(!SendRawPacket(raw, packet, pkt_len))
{
perror("Error sending packet");
}
else
printf("Packet sent successfully\n");

/* Free the memory back to the heavenly heap */

free(ethernet_header);
free(arp_header);
free(packet);

close(raw);

return 0;
}
(adsbygoogle = window.adsbygoogle || []).push({});
06-16-2008, 05:57 AM #20
Kirizmaxx
Don't Fear the Repear
Originally posted by imstraightiswear View Post
im really fine with learning how to use it myself. then i have something everyone else doesn't. 90% of people on this side dont know C++ when they see it let alone compile it.


it's funny how everytime including back at ngb some guy would say fiqure it out yourself never giving us a clue besides go take programming classes even though half the people on here including me are only 13-17 years old then someone like me would try to do what he said or do a trial and error process like for instance compiling those codes posted already have 5 questions from that, what program do you use, does it cost money, have you tried this and does it work, how and when do i inject the codes in the game, and finally what do the codes do in the first place?????? Note: i will probably just google most of the things i said and search and test for 3hours and give up on it......
06-16-2008, 08:03 PM #21
its raw socket for packet injection,edit the time the proto and everyting that is there. The code is just a easier way on how to packet inject.For example if you wanted to be able to sprint really fast you woud have to create your own packet, if you wanted radar then capture the packet edit the time and send it,each packet has a time stamp.
06-17-2008, 12:09 AM #22
URC
Haxor!
this is sick.
06-17-2008, 11:22 AM #23
Default Avatar
Moy
Guest
Can someone please put this into "simple" terms so i can understand.
06-17-2008, 06:32 PM #24
Originally posted by Moy View Post
Can someone please put this into "simple" terms so i can understand.


Hey Moy,

It's hard to simplify this because it's actually advanced networking involved. I will try to help you understand what this code actually does but it will be difficult to use even after you understand.

Basically, your PS3 sends information about the games you play to an online server. So let's say you start a game and you throw a grenade. Your system would then send that information to the online server. The online server would then calculate information and send that grenade to the PS3s of those you were playing with.

With this code (packet injection) you could basically mess with the packets so that for example when you throw a grenade in the game your PS3 would send the information out but this code would transform the information and add something like the "Sonic Boom" perk to the grenade even though you do not have it equipped. Your system would just send out a regular grenade but everyone in your game would receive that grenade as if it had the "Sonic Boom" perk on which makes it deadlier.

I know that it might not seem like much to simply add "Sonic Boom" to your grenades without having the perk equipped but imagine if you alter the packets so that you can achieve all perks at the same time. You might be able to get shot and drop grenades from "Martyrdom" plus stay alive with "Last Stand". I don't know if it's possible but I'm just giving you the ideas to help you understand better.

I hope this helps you understand.

Has anyone come across a list of the packets and what they do in the game?
06-17-2008, 09:36 PM #25
Kirizmaxx
Don't Fear the Repear
some1 probably has but they'll keep it secret and what protocol or however u spell it, is the ps3 sending packets in? There's a couple different ones and also when i shot in a regular game i don't get a packet ( already set it up so that my ps3 would send them to the comp. then the router )

Which part of a packet the time stamp/?/?
06-18-2008, 06:41 AM #26
gops10
Climbing up the ladder
well when u shoot, u dont get a packet, u get the packet when the clip is finshed !
06-18-2008, 08:06 AM #27
Wow next time you post a thread you might want to make sure that the people reading the post will actually understand what you are giving them. You should explain what to do with the codes that you put up. If it requires a program, give a link. Explain how and when to use/inject this set of codes or whatever you have to do with them. You can just expect to post a thread Titled "packet injection........" and post some codes and just expect even a few people to know what you are talking about or what you do with it. You probably don't have a solid idea of what you do with these codes and if they actually work or not.
06-18-2008, 04:09 PM #28
gops10
Climbing up the ladder
well if uu dont understand what is written then maybe u shud do some research!

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo