mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-02 14:56:10 -04:00
802.11 README
This commit is contained in:
parent
34a558b572
commit
9ced30960f
8 changed files with 82 additions and 36 deletions
31
Network_and_802.11/socket/netcat.py
Normal file
31
Network_and_802.11/socket/netcat.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
|
||||
__author__ = "bt3gl"
|
||||
|
||||
|
||||
import socket
|
||||
|
||||
|
||||
def netcat(hostname, port, content):
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((hostname, port))
|
||||
s.sendall(content)
|
||||
s.shutdown(socket.SHUT_WR)
|
||||
adata = []
|
||||
while 1:
|
||||
data = s.recv(1024)
|
||||
if data == "":
|
||||
break
|
||||
adata.append(data)
|
||||
s.close()
|
||||
return adata
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
PORT = 12345
|
||||
HOSTNAME = '54.209.5.48'
|
||||
message = netcat(HOSTNAME, PORT, '')[1]
|
||||
print message
|
Loading…
Add table
Add a link
Reference in a new issue