Raw sockets in Python
Results 1 to 3 of 3

Thread: Raw sockets in Python

  1. #1
    Junior Member
    Join Date
    Jul 2005
    Posts
    2

    Raw sockets in Python

    I would like to create a raw TCP packet.
    The socket is created like this:

    socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)

    But then? I can't seem to figure out how to send my packet to a host.

    When I use IPPROTO_RAW I can send the packet with socket.sendto(...), but I don't want to create the whole IP-header. Its an option which I wouldn't want to use.

    Does anyone know of a tutorial on this subject (not in C).

    Thanks!

  2. #2
    Super Moderator
    Know-it-All Master Beaver

    Join Date
    Jan 2003
    Posts
    3,914
    Hey Hey,

    You might want to check out these two tutorials that I've done using sockets in python.. They may be of use to you. They don't cover the RawSocket call, but they give a good breakdown (IMO) of the general usage of sockets.

    http://www.antionline.com/showthread...hreadid=257106
    http://www.antionline.com/showthread...hreadid=249001

    Peace,
    HT
    IT Blog: .:Computer Defense:.
    PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".

  3. #3
    Junior Member
    Join Date
    Jul 2005
    Posts
    2
    Sorry. It wasn't what I was after.
    Thanks anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides