Forum Thread: Writing Python Script

Writing Python Script

Hello null-byte!
This is my first post and i need some help.

The thing is followed these steps in the given link succeeded in finding location. Now I'm planning to write a script which does the whole process when we execute the script. First i made a .sh script with following commands:

cd /root/pygeoip-0.1.3
./ (This is the script i made after)

In, the following commands are there:
x=raw_input('Insert the IP address:')
import pygeoip
for key,val in rec.items():
print "%s: %s" %(key,val

The results are not coming. But when i manually execute the commands in, there is no error.
This is how the error looks like:

Insert the IP address:
Traceback (most recent call last):
File "./", line 5, in <module>
File "/root/NH3/pygeoip-0.3.2/pygeoip/", line 546, in recordbyaddr
ipnum = util.ip2long(addr)
File "/root/NH3/pygeoip-0.3.2/pygeoip/", line 39, in ip2long
return int(binascii.hexlify(socket.inetpton(socket.AFINET6, ip)), 16)
socket.error: illegal IP address string passed to inet_pton

Any help would be appreciated!

1 Response

Nevermind....i found the fix.
There is no need of apostrophe('x').

Share Your Thoughts

  • Hot
  • Active