Exemplo n.º 1
0
def test():
	port = 1111
	command = ["/bin/uname", "-i", "-o"]
	sc = shellcode.connect("127.0.0.1", port)
	sc += shellcode.helloworld()
	testing.run_tcp_expect_recv_data(sc, "Hello World!\n", port)
	sc = shellcode.connect("127.0.0.1", port)
	sc += shellcode.execve_sh()
	expect = subprocess.check_output(command)
	testing.run_tcp_expect_recv_data_using_send_data(sc, expect, port, "uname -i -o\nexit\n")
Exemplo n.º 2
0
def test():
	port = 1112
	sockfd = 20
	command = ["/bin/uname", "-i", "-o"]
	sc = shellcode.reusefd(sockfd)
	sc += shellcode.helloworld()
	testing.run_tcp_client_expect_recv_data(sc, "127.0.0.1", port, sockfd, "Hello World!\n")
	expect = subprocess.check_output(command)
	sc = shellcode.reusefd(sockfd)
	sc += shellcode.execve_sh()
	testing.run_tcp_client_expect_recv_data_using_send_data(sc, "127.0.0.1", port, sockfd, expect, "uname -i -o\nexit\n")
	sc = shellcode.reusefd(sockfd)
	sc += shellcode.execve(["/bin/sh"])
	testing.run_tcp_client_expect_recv_data_using_send_data(sc, "127.0.0.1", port, sockfd, expect, "uname -i -o\nexit\n")
Exemplo n.º 3
0
def test():
	sc = shellcode.helloworld()
	testing.run_expecting_output(sc, "Hello World!\n")	
Exemplo n.º 4
0
def test():
	sc = shellcode.helloworld()
	testing.verify_no_nulls(sc)
	testing.run_expecting_output(sc, "Hello World!\n")