Packet Injection

Discussion in 'Call of Duty 4: Modern Warfare' started by decima7e, Aug 6, 2009 with 16 replies and 3,418 views.

  1. decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    well, recently i have gotten into packet inkection, an from what i understand you need to have your xbox connected to an ad hoc network hosted by the computer you are sniffing on. On windows vista I:
    connected via ethernet to my airport express
    created and ad hoc network on my wireless card
    bridged the conections togethter
    connected to the ad hoc on my xbox
    but when i try to test my xbox live connection, it says it cant get an ip or a dns server or something.


    what am i missing?
     
  2. sideflyingcows

    sideflyingcows Enthusiast

    Messages:
    275
    Ratings:
    87
    just connect your xbox via ethernet to your comp. turn on ics on your wireless network, and connect your comp to your airport express. no need to have an ad hoc.
     
  3. OP
    decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    oh thanks

    ok so i did that and i start the sniff and it seems to capture a bunch of packets adn says they are for xbox, i send the one i thought was me killing myself with a grenade and nothing happens. so what i did is send all of the packets that i caught and still nothing happened. am i not sending them right? is there something special i need to do with colosoft packet builder?
     
  4. k0m1kaz33

    k0m1kaz33 Enthusiast

    Messages:
    728
    Ratings:
    57
    Why use that crap. You might as well use commview. Also try it in a private game.
     
  5. OP
    decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    commview doesnt work for me, and colasoft packet builder shuold work fine. it sounds like something that anyone with expireince in this field could answer, but what am i doing wrong so that nothing happens on the xbox when i send a packet?
     
  6. sideflyingcows

    sideflyingcows Enthusiast

    Messages:
    275
    Ratings:
    87
    well for one thing they arnt timestamped. and theres no raw socket.
     
  7. OP
    decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    how do i timestamp the packet and how do i create a raw socket?
     
  8. sideflyingcows

    sideflyingcows Enthusiast

    Messages:
    275
    Ratings:
    87
    i think the timestamps are in the headers. either the data or ethernet or ip or tcp/udp header. i dont know myself. but you need to copy the header from one to another in under a milisecond then send it with it edited. you need to make a program that does this. there are two people that can do this with the ps3. cyn and stealth. they arnt releasing because it would just be bad for them if they did. if you know c++ or some language to write all this then go ahead. there was someguy that put the buttons on his controller that was connected to his pc and that when pushed he could get around the patch. that was over at nextgenupdate on the ps3. dont know about the 360 though. and if anybody is reading this and thinks i am wrong dont flame. just sayin what i think is true.
     
  9. Otaku Se7en

    Otaku Se7en The Old School Retired

    Messages:
    5,481
    Ratings:
    1,223
    Wow Packet Modding will be the end of Xbox Live...
     
  10. OP
    decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    that sounds like something thats only ps3. i still have my ears open on the raw socket though
     
  11. PureX

    PureX Enthusiast

    Messages:
    57
    Ratings:
    3
    Packet modding FTW!! lol
     
  12. OP
    decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    thanks for the useful post :tongue:
     
  13. sideflyingcows

    sideflyingcows Enthusiast

    Messages:
    275
    Ratings:
    87
    look it up on google. its a very hard process but im still wondering why there isnt any tutorials around here. but no its not just for the ps3. with something like that you could do just about anything. you could even just spoof the packet that sends to microsoft saying that you have the latest patch. that would be easy if you made the program. currently im an intermediate with c++. i understand how to do it, but i dont know how to put the parts together. like here is a c++ packet injector.

    Code:
    using namespace std; //dont like using it but its iight
    #include<sys/types.h>
    #include<sys/socket.h>
    #include<iostream>
    #include<sys/param.h>
    #include<fstream>
    #include<cstdio>
    #include<string.h> 
    #include<stdio.h> 
    #include<stdlib.h> 
    #include<sys/socket.h>
    #include<features.h> 
    #include<linux/if_packet.h> 
    #include<linux/if_ether.h>
    #include<errno.h> 
    #include<sys/ioctl.h> 
    #include<net/if.h>
    #include<linux/inet.h>
    #include<netinet/in.h>
    #define PACKET_LENGTH 1024
    
    int CreateRawSocket(int protocol_to_sniff)
    {
    ushort htons(ushort protocol_to_sniff);
    int rawsock;
    if((rawsock = socket(PF_PACKET, SOCK_RAW, htons(protocol_to_sniff)))== -1)
    {
    cout<<"Error creating raw socket:\n";
    exit(-1);
    } 
    return rawsock; 
    }
    int BindRawSocketToInterface(char *device, int rawsock, int protocol)
    {
    ushort htons(ushort protocol);
    struct sockaddr_ll sll;
    struct ifreq ifr;
    bzero(&sll, sizeof(sll));
    bzero(&ifr, sizeof(ifr));
    strncpy((char *)ifr.ifr_name, device, IFNAMSIZ);
    if((ioctl(rawsock, SIOCGIFINDEX, &ifr)) == -1)
    {
    cout<<"Error getting Interface index !\n";
    exit(-1);
    }
    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)
    {
    cout<<"Error binding raw socket to interface\n";
    exit(-1);
    }
    return 1; 
    }
    int SendRawPacket(int rawsock, unsigned char *pkt, int pkt_len)
    {
    int sent= 0;
    if((sent = write(rawsock, pkt, pkt_len)) != pkt_len)
    {
    return 0;
    }
    return 1; 
    }
    main(int argc, char **argv)
    {
    int raw; 
    unsigned char packet[PACKET_LENGTH];
    int num_of_pkts; char x; char y;
    cin >> x; 
    memset(packet, x, PACKET_LENGTH);
    while (y != EOF)
    {
    raw = CreateRawSocket(ETH_P_ALL);
    BindRawSocketToInterface(argv[1], raw, ETH_P_ALL);
    num_of_pkts = atoi(argv[2]);
    while((num_of_pkts--)>0)
    { 
    if(!SendRawPacket(raw, packet, PACKET_LENGTH))
    {
    cout<<"Error sending packet\n";
    }
    else
    {
    cout <<"Packet sent successfully\n";
    }
    }
    cin >> y;
    close(raw);
    memset(packet, y, PACKET_LENGTH);
    }
    return 0; 
    }
    
    you can see about 1/3 down there is the part about creating the raw socket.
    this isnt the whole program. its just the injector. not the sniffer or the editor. once i am able to do the whole program i will test and if deemed to powerful i will not post. but first i have to get better at c++. you can also see the packet length (buffer) is 1024 which is enough to insert an ethernet, ip, tcp/udp, and data header then send it through the raw socket. agian if im talking total bull**** than please dont get up on me sayin "WHAT A ****IN N00b", im still learning this
     
    • Like Like x 1
  14. OP
    decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    sounds like your well on your way man, but i already have a sniffer and injector so if thats where your going your wasting time. if you are talking about packet editing, well then i have no idea. thanks for the useful post anyways,
    anthony
     
  15. sideflyingcows

    sideflyingcows Enthusiast

    Messages:
    275
    Ratings:
    87
    well see the thing is, is that you have to get one that does all of it in less than a milisecond. thats the problem
     
  16. OP
    decima7e

    decima7e Contributor

    Messages:
    1,819
    Ratings:
    957
    have a really fast computer
     
  17. ThunderukX

    ThunderukX Enthusiast

    Messages:
    80
    Ratings:
    139
    Hi, I am not a expert in this area but I have done this before (All the way to almost bypassing the patch but being unsuccessful) Tbh I would use Cain and Abel instead it is a very easy tool to use, using the APR poisoning tool you can easily bridge.
     

Share This Page