Created
December 23, 2019 21:55
-
-
Save ioribrn/d40a0b5633eb9e2485cdd82fb32457c8 to your computer and use it in GitHub Desktop.
Timing_attack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import socket | |
import time | |
def getFlag(): | |
TCP_IP= '3.19.111.121' | |
TCP_PORT= 1337 | |
print "[+]- Connecting To %s:%d\n" % (TCP_IP,TCP_PORT) | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((TCP_IP, TCP_PORT)) | |
data = s.recv(1024) | |
print(data) | |
time_test=0 | |
chars="0123456789abcdefghijklqmnoprstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&()*+$" | |
key='00000000000' | |
for c in chars: | |
start_time = time.time() | |
s.send(c+key+'\n') | |
data= s.recv(1024).strip() | |
elapse_time = time.time() - start_time | |
print 'char:',c,'time:',elapse_time,'\n' | |
s.close() | |
def main(): | |
getFlag() | |
if __name__ == '__main__': | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment