Broadcast a UDP message in LAN with fake source IP with delphi - delphi

I want to broadcast a UDP message in my LAN with fake source IP ( spoofing )
1. Do winpcap able to do this ?
2. Do this work on winxp, win7 ?
3. i'm using delphi, is there any good components available ?
Thanks.

Yes, you can do this with winpcap. It should work on Windows 7 (though you may have to get a beta version of it). This is all I could find for doing it in delphi:
http://www.magsys.co.uk/delphi/magmonsock.asp
I don't know how well that works with the latest version of winpcap though. I'd seriously consider just doing it in C or C++.

Since your goal is to allow UDP broadcast in the VPN I suggest to take a look at VPN solutions that does not drop those packets such as Hamachi or Gamer's Internet Tunnel instead of creating your own solution.

Related

Is there any straight way to establish P2P UDP connection behind NAT in delphi?

I've been trying to establish a P2P connections for a couple of weeks. After writing some code and using Indy's components, I've realized that it can not access the peer that is behind the NAT. Furthermore, I've heard about STUN services that provide a client's remote and local IPs and ports. I should say I've already had the other UDP client (server) remote and local IPs, so how can I implement my code and program to work properly? Is there any extra component in Indy's library that I should use?
There is the Ares Galaxy P2P Project I know about some years ago.
There was a recent fork by Christian at https://github.com/CWBudde/AresGalaxy which tries to port it to more modern Delphi versions.
It is a work in progress, but perhaps you may get some very good ideas in this source code, and ask Christian for help/ideas, especially about NAT transversal.

How to capture and send packets via Macbook

I want to capture and send some packets to the access point for testing purposes. I have the packet captures made via wireshark but I do not know how to proceed to be able to send these packets from my macbook.
I tried things like scapy, colasoft etc, but they do not seem to work as they require an external wifi adapter to be able to relay these packets outwards.
Two main questions:
Is it possible to send custom packets from macbook to a required access point. (Without using external network adapter).
If yes, what are some tooling/Scripting options that I can look at ? Any recommendations?
I am networking novice so please pardon me if the question is trivial. Thank you!
Your builtin Wifi adapter likely does not support Wifi injection.
You can check this by googling the Wifi chip that is within your computer (there are various methods to get that info depending on your OS) whether it supports Wifi injection or not.
So yeah, you'll likely need an external card (check the specs before buying it)

Serial communication between stm32f103 and computer using USB to ttl pl2303

I would like to know is if is possible to send data from my stm32f103 board to my laptop using usb-ttl pl2303. I have tried but even after downloading the drivers the com port is not recognized by com terminal applications.
i think i found the solution, for others who might be in need, u have to backdate or roll back the driver .you do that by downloading old driver packages .

pcap - streaming and receiving udp in the same computer

To explain what I would like to get, here's an example.
Let's say, we have a PC with one NIC. It has single IP address 172.16.0.1.
Using VLC, we start a udp stream to 172.16.0.1:1234, then launch another copy of VLC and connect to udp://#172.16.0.1:1234. Now we'll see our video streaming.
If you run sniffer, you will see packets from 172.16.0.1:some_random_port to 172.16.0.1:1234 on loopback. There's no trafic on our NIC.
What I want to do is to stream and receive udp in the same computer, like VLC does it. But the main problem is that pcap can only pcap_open() a real device, it can't work with loopback.
Is it possible to solve that problem?
P.S. I'm using Windows and WinPcap, unlike Linux version, it can send packets.
If you just want to send and receive UDP packets, I would suggest just using regular Winsock sockets, just as you'd use regular sockets on UN*X; using WinPcap requires that you re-implement IP and UDP, and won't let you send to another socket on the same machine under Windows (or on at least some versions of UN*X, either).
If you want to watch the traffic you're sending, unfortunately WinPcap won't help, as it relies on packets being sent out and received from NDIS (its driver plugs into NDIS), and that doesn't happen for packets sent from one socket on a machine to another socket on the same machine.
(Note, BTW, that libpcap can send packets on Linux and *BSD and Mac OS X and Solaris and Digital/Tru64 UNIX, for example, and has been able to do so for several years; older versions of libpcap didn't support it, but the versions available for the past few years can. However, as per my first paragraph, it would not make sense to use libpcap to send and receive regular UDP packets on those OSes, just as it makes no sense to use WinPcap for that purpose on Windows.)

Debug COM port read/write using software/virtual COM port and console/terminal on the other end

I have a Delphi application that reads/writes to a COM port connected to a large hardware device, so I don't usually have the hardware available during development. That said, the communication protocol is fairly simple, so I can generally do the development and have someone onsite test it, and it usually works. Occasionally I run into a harder problem, though. To solve this, I'd like to setup a virtual COM port where one side of the COM port is my application and the other side is a very simple COM port debug console (similar to the old modem terminal programs), where ASCII commands my app sends are logged onscreen and I can type in some ASCII command to send back to my application to simulate the hardware device. I've been unable to find any tools that provide a virtual/software COM port and a console/terminal to debug with. Does anyone have software suggestions and steps to set something like this up?
The software/virtual COM port and terminal need to support Windows 7 64-bit (or Vista 32 if necessary).
I'm doing something similar with paired virtual COM ports created by
http://com0com.sourceforge.net/
I'm using Advanced Virtual COM Port and I'm quite happy with it. Not free, but works like a charm - even with Win7-x64.
Can't you just insert a redirector at the lowest level of your application which will pop up a console instead of writing data to COM? Should not take long.
I can't vouch for it, but sounds like something like this is what you're looking for. http://www.windows7download.com/win7-free-virtual-serial-ports-emulator/yarqmowu.html
I have used Eterlogic's Virtual Serial Ports Emulator successfully for exactly this on a laptop with no serial ports. It's a bit easier to set up than Com0Com, which I have also used. It's also useful for serial port spying if you need to reverse engineer any communications
The 32-bit version is free, the 64-bit version is currently $25. Try it out on Vista32 to see if it does what you need.
I use Com0Com for this purpose, but I don't know whether it works with anything more recent than Windows XP.

Resources