mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-02 06:46:07 -04:00
socket scripts added
This commit is contained in:
parent
d01824f424
commit
ac171e1195
5 changed files with 159 additions and 7 deletions
31
Network_and_802.11/socket/udp_client.py
Normal file
31
Network_and_802.11/socket/udp_client.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
__author__ = "bt3"
|
||||
|
||||
|
||||
import socket
|
||||
|
||||
# Defining constants
|
||||
HOST = '127.0.0.1'
|
||||
PORT = 80
|
||||
DATA = 'AAABBBCCC'
|
||||
|
||||
|
||||
def udp_client():
|
||||
|
||||
# Create a socket object
|
||||
# AF_INET parameter: to use standard IPv4 address
|
||||
# SOCK_DGRAM: to indicate udp client
|
||||
client = socket.socket( socket.AF_INET, socket.SOCK_DGRAM)
|
||||
|
||||
# Send data
|
||||
client.sendto(DATA, ( HOST, PORT ))
|
||||
|
||||
# Receive some data
|
||||
data, addr = client.recvfrom(4096)
|
||||
print data, addr
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
udp_client()
|
Loading…
Add table
Add a link
Reference in a new issue