Converting a str to an int
<p>My Problem is that the type <code>'ip'</code> is str, but i need integer.</p>

<p>So i did the convert <code>int(ip)</code>. Then i got error </p>

<blockquote>
  <p>invalid literal for int() with base 10:</p>
</blockquote>

<p>So i did a little bit of research and found that i had to put int <code>int(float(ip))</code>. </p>

<p>Now i get "could not convert string to float".    </p>

<pre><code>import socket
def retrieveBanner(ip, port):
    s = socket.socket()
    s.connect((int(float(ip)),port))
    banner = s.recv(1024).decode()
    print("Bitte geben Sie eine IP und ein Port ein")

ip = input("IP? ")
port = input("Port? ")
retrieveBanner(ip, port)
if ("NASFTPD" in banner):
    print("Vulnerable")
</code></pre>

<p>To convert a dotted notation IP address in a string to an integer you need:</p>

<pre><code>i_ip = socket.inet_aton(ip)
</code></pre>

<p>"aton" is short for "ASCII to number".  This is for IPv4 addresses.</p>

python