commit 7ed358acfa68daecdb0d902d4decbad88ab08cc9
parent 15991897f13b0188f2fd56c8eef7d44c21694208
Author: therealFIGBERT <figbertwelner@gmail.com>
Date: Sat, 4 Jan 2020 19:12:33 -0800
Update first_flag.py for ECS189M class
Diffstat:
2 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/first_flag.py b/first_flag.py
@@ -1,23 +0,0 @@
-# A CTF exploit by Benjamin Welner
-# for the Davis Cyber Security Club server
-# at daviscybersec.ddns.net:1337
-# 29/09/2019
-from pwn import *
-
-#Connecting to the server
-connection = remote("daviscybersec.ddns.net", 1337)
-for i in range(0,50):
- #Recieving the equation
- equation = connection.recvline_contains("Question")
- #Splitting the equation into the two numbers to add
- numbers = [int(item.strip()) for item in ((equation.split(b":")[1]).strip()).split(b"+")]
- num_one = numbers[0]
- num_two = numbers[1]
- #Adding the two numbers
- num_sum = sum(numbers)
- print("Equation %d: %d + %d = %d"%(i+1, num_one, num_two, num_sum))
- connection.recv()
- #Sending the password
- connection.sendline(bytes("%d"%num_sum, "utf-8"))
-connection.recv()
-connection.interactive()
diff --git a/linux_and_misc/addition.py b/linux_and_misc/addition.py
@@ -0,0 +1,25 @@
+# A CTF exploit by FIGBERT
+# for UC Davis class ECS189M
+# twinpeaks.cs.ucdavis.net:30001
+# Category: Linux and miscellaneous
+# Challenge: addition
+# 04/01/2020
+from pwn import *
+
+#Connecting to the server
+connection = remote("twinpeaks.cs.ucdavis.edu", 30001)
+for i in range(0,50):
+ #Recieving the equation
+ equation = connection.recvline_contains("Question")
+ #Splitting the equation into the two numbers to add
+ numbers = [int(item.strip()) for item in ((equation.split(b":")[1]).strip()).split(b"+")]
+ num_one = numbers[0]
+ num_two = numbers[1]
+ #Adding the two numbers
+ num_sum = sum(numbers)
+ print("Equation %d: %d + %d = %d"%(i+1, num_one, num_two, num_sum))
+ connection.recv()
+ #Sending the password
+ connection.sendline(bytes("%d"%num_sum, "utf-8"))
+connection.recv()
+connection.interactive()