bandit/examples/binding.py
Jamie Finnigan 7150e10c9b First test targeting Str nodes (binding to all interfaces)
This is the first test to target AST nodes of type Str.  It simply warns
on the existence of any strings matching "0.0.0.0", which indicate a possible
binding to all network interfaces of a network service / listener.
2014-08-14 15:46:50 -07:00

6 lines
126 B
Python

import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('0.0.0.0', 31137))
s.bind(('192.168.0.1', 8080))