Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

Commit

Permalink
#21 Unauthenticated remote root code execution
Browse files Browse the repository at this point in the history
Changed from os.system to subprocess that escapes username automatically
  • Loading branch information
wesselOC committed Jan 14, 2018
1 parent 8ecb42f commit 9b78051
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vuedj/configtitania/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .models import BoxDetails, RegisteredServices
from .serializers import BoxDetailsSerializer, RegisteredServicesSerializer

import common, sqlite3, subprocess, NetworkManager, os, crypt, pwd, getpass, spwd
import common, sqlite3, subprocess, NetworkManager, crypt, pwd, getpass, spwd

# fetch network AP details
nm = NetworkManager.NetworkManager
Expand Down Expand Up @@ -61,7 +61,8 @@ def get_allAPs():

def add_user(username, password):
encPass = crypt.crypt(password,"22")
os.system("useradd -G docker,wheel -p "+encPass+" "+username)
#subprocess escapes the username stopping code injection
subprocess.call(['useradd','-G','docker,wheel','-p',encPass,username])

def add_newWifiConn(wifiname, wifipass):
print(wlans)
Expand Down

0 comments on commit 9b78051

Please sign in to comment.