Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: transmit udp packets

by VinsWorldcom (Prior)
on Jun 25, 2015 at 14:53 UTC ( [id://1131972]=note: print w/replies, xml ) Need Help??


in reply to transmit udp packets

To hack your MAC address, depending on platform, you may need to use Net::Pcap and the send methods. I'm thinking something similar to Python's scapy (http://www.secdev.org/projects/scapy/).

Fortunately, I wrote something based on the Net::Frame modules. You can find it here:

EDIT (20170918): fixed old links, now point to GitHub

https://github.com/vinsworldcom/PPC

UPDATE:

Simple as:

VinsWorldcomC:\Users\VinsWorldcom\tmp\ppc> ppc -i "Wireless Network Co +nnection" Welcome to Perl Packet Crafter (PPC) Version: 1.02 Wireless Network Connection ppc> $r = srp (packet (ETHER(dst=>'00:11:22:33:44:55'), IPv4, UDP)); Sent => [Receive Timeout] ppc>

Receive timeout due to there being no 00:11:22:33:44:55 MAC address on my network.

Replies are listed 'Best First'.
Re^2: transmit udp packets
by axr0284 (Initiate) on Jun 25, 2015 at 18:03 UTC
    I never installed anything using cpan or even knew it existed.

    Obviously trying to install Net::Frame did not go smoothly :(

    Does anybody know what's wrong

    Test Summary Report ------------------- t/01-use.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/04-eth.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/05-arp.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/06-ipv4.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/07-raw.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/08-sll.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/09-tcp.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/10-null.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/11-udp.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/12-ppp.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0. t/13-gethostsubs.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 6 tests but ran 0. Files=13, Tests=2, 1 wallclock secs ( 0.08 usr + 0.05 sys = 0.13 CP +U) Result: FAIL Failed 11/13 test programs. 0/2 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic' GOMOR/Net-Frame-1.15.tar.gz C:\Perl64\site\bin\dmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, + try: reports GOMOR/Net-Frame-1.15.tar.gz Failed during this command: GOMOR/Net-Frame-1.15.tar.gz : make_test NO

      Seems as if your tests are failing and by the errors, appears you're using ActiveState Perl on Windows.

      I'm using Strawberry Perl (5.18.1 64-bit) on Windows 7 x64. I've never had an issue installing Net::Frame. I think you could probably force it with '-f'.

      The bigger issue is installing Net::Pcap. You'll find information on that here:

      Full write-up: Net::Pcap installation help (and not with the library)
      Specifically: Re: Net::Pcap installation help (and not with the library)

      UPDATE:

      VinsWorldcom@C:\Users\VinsWorldcom\Downloads\Net-Frame-1.15> perl Make +file.PL Checking if your kit is complete... Looks good Writing Makefile for Net::Frame Writing MYMETA.yml and MYMETA.json VinsWorldcom@C:\Users\VinsWorldcom\Downloads\Net-Frame-1.15> dmake tes +t cp lib/Net/Frame/Layer/ARP.pm blib\lib\Net\Frame\Layer\ARP.pm cp lib/Net/Frame/Layer/RAW.pm blib\lib\Net\Frame\Layer\RAW.pm cp lib/Net/Frame/Layer/PPP.pm blib\lib\Net\Frame\Layer\PPP.pm cp lib/Net/Frame/Layer/SLL.pm blib\lib\Net\Frame\Layer\SLL.pm cp lib/Net/Frame/Layer.pm blib\lib\Net\Frame\Layer.pm cp lib/Net/Frame.pm blib\lib\Net\Frame.pm cp lib/Net/Frame/Layer/TCP.pm blib\lib\Net\Frame\Layer\TCP.pm cp lib/Net/Frame/Layer/ETH.pm blib\lib\Net\Frame\Layer\ETH.pm cp lib/Net/Frame/Layer/IPv4.pm blib\lib\Net\Frame\Layer\IPv4.pm cp lib/Net/Frame/Layer/UDP.pm blib\lib\Net\Frame\Layer\UDP.pm cp lib/Net/Frame/Layer/NULL.pm blib\lib\Net\Frame\Layer\NULL.pm C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib\lib', 'blib\arch')" t/*.t t/01-use.t ........... ok t/02-pod-coverage.t .. ok t/03-test-pod.t ...... ok t/04-eth.t ........... ok t/05-arp.t ........... ok t/06-ipv4.t .......... ok t/07-raw.t ........... ok t/08-sll.t ........... ok t/09-tcp.t ........... ok t/10-null.t .......... ok t/11-udp.t ........... ok t/12-ppp.t ........... ok t/13-gethostsubs.t ... ok All tests successful. Files=13, Tests=37, 5 wallclock secs ( 0.16 usr + 0.05 sys = 0.20 C +PU) Result: PASS
        This is proving to be a little more time consuming than I would like. I am short on time so I might look for a ready made solution at this point. If I can't find any, I'll try again. Thanks for the help, Amish

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1131972]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found