IOT Security: Pentesting on IP Cameras
Summary
This is a documentation on pentesting performed on TP-link Kasa Cam Smart Home Camera KC120, Ezviz CS-C1C and Abus PPIC32020.
Requirements
Operating System
- Kali Linux 2022.2
Hardware
- TP-link Kasa Cam Smart Home Camera KC120
- Encryption: 128-Bit-AES, WPA/WPA2-PSK
- Storage: Amazon Web Services (AWS) Cloud
- Ezviz CS-C1C
- Encryption: 64/128-bit WEP, WPA/WPA2, WPA-PSK/WPA2-PSK
- Storage: EZVIZ cloud and/or MicroSD
- Abus PPIC32020
- Encryption: AES 128bit, WPA/WPA2-PSK
- Storage: MicroSD
Apps
- Kasa Smartphone application (IOS or Android)
- Ezviz Smartphone application (IOS or Android)
- ABUS App2Cam Plus Smartphone application (IOS or Android)
Description
A penetration test can be divided into several stages:
- Pre-Engagement Interactions
Working with a client to absolutely outline and report evaluation objectives, scope, and policies of engagement. There are three ways to run the test. In our case, the tester is doing a black-box test, which means the tester doesn't know anything about the system to be tested, i.e. he/she has to act as a hacker. The pentester needs to create a contract with the client on when, how, and what to test. In addition, there should be a privilege explanation and a non-disclosure agreement between the pentester and the client.
- Gathering Information
Collecting and examing key data approximately the software and its infrastructure. We recommend creating an architectural sketch (deployment diagram). It should include at least the subnets, firewalls, gateways, services/servers, and, above all, the system's communication relationships.
- Threat Modeling
Threat modeling is an established technique of figuring out and prioritizing ability threats to a system and figuring out the value that ability mitigations might have in decreasing or neutralizing one's threats.
- Vulnerability Analysis
Find current vulnerabilities and identify any potential security weaknesses that could allow an outside attacker to gain access to the environment.
- Exploitation
The pentester tries to establish a connection with the target and exploit the vulnerabilities found in the previous phase. Exploitation can be software, shellcode, certain command, code injection, remote exploit without any prior access, and local exploit with prior access to the system.
- Post Exploitation
After successful exploitation, it's far crucial to report all steps and tools - so that you can demonstrate the impact and possible consequences of the vulnerabilities to the client.
- Reporting
Providing a complete report with deep evaluation and suggestions on the way to mitigate the found vulnerabilities. It consists of two parts: An executive summary and a technical report. The executive summary provides a background overview, test overview, risk profile, general findings, an overview of the tasks required to mitigate the problem, and short-term and long-term goals to improve security increase. It is important to document how easy it was to find this vulnerability and what the countermeasures are. The risk analysis is the most important part because the pentester needs to consider how high the risk of the detected vulnerabilities is and how these vulnerabilities could affect the company. These results are used to make company decisions that can have a significant impact on the company. The technical report details the intelligence collection and vulnerability testing results, and the client's internet footprint.
- Resolution & Re-Testing
The client follows the recommendations and after completing patching the vulnerabilities a re-test is run.
Set-up
You need to set up the camera together with your phone app and allow it to connect with the identical WiFi that your smartphone uses. To find out the IP Address of the camera you need to install scanning tools, that can gain access to devices in your subnet. We recommend that you create a virtual machine and after that, you need to install Kali Linux on your VM. With this operating system, many tools are already pre-installed and ready to use.
Scanning Tools
Nmap
Nmap Scans will give you important information about the target system.
Target specification:
$sudo nmap <target IP> Scan a single IP
| OS | Kernel | Test |
|---|---|---|
![]() |
Arch Linux | Test
}
$sudo namp -sL <target IP> Force reverse DNS resolution: $sudo nmap -R <target IP> Perform an aggressive scan and service version detection: $sudo nmap -sV -A <target IP> Scan TCP/UDP ports: $sudo nmap <target IP> -sT TCP connect port scan (Default without root privilege) $sudo nmap <target IP> -sU UDP port scan Host discovery and port scan: $sudo nmap <target IP> -sn Disable port scanning. Host discovery only $sudo nmap <target IP> -Pn Disable host discovery. Port scan only (If the host is down) Port pecification: $sudo nmap -p <port> <target IP> Scan Specific Ports $sudo nmap <target IP> -p- Scan all ports OS Detection: $sudo nmap <target IP> -O Remote OS detection using TCP/IP FIN-scan: $sudo nmap <target IP> -sF Scanner sends FIN segments Stealth scans: $sudo nmap <target IP> Xmas-Tree-Scan -sX Scanner sends segments where FIN, URG, PSH and flags are set Firewall Evasion Technique: $sudo nmap -f <target IP> augment packets Use a set of scripts from the /usr/share/nmap/scripts/ directory: $sudo nmap -sV --script $SCRIPT <target IP> Spiderfoot $spiderfoot -l <target IP>:<target Port> Dmitry $dimitry -p -l <target IP> The Harvester $theHarvester -d <target IP> -l 1000 -b google HackerEnv $git clone https://github.com/abdulr7mann/hackerEnv.git $cd hackerEnv $chmod +x hackerEnv $bash hackerEnv -t <target IP> Legion Nessus $sudo dpkg -i <Nessus deb file> $/bin/systemctl start nessusd.service go to https://kali:8834/ to configure the scanner Exploitation ToolsMetasploit msf6 > search <open port protocol> Search for exploits of open ports Searchsploit $searchsploit <open port protocol> Search for exploits of open ports Hydra and Patator $cd /usr/share/wordlists $hydra <Target_IP> ssh -l <username> -P <password_file> -s 22 -vV to brute-force SSH username and password $hydra -L <username_file> -P <password_file> ftp://<Target_IP> to brute-force FTP username and password $hydra -l <username> -p <password> telnet://<Target_IP> to brute-force Telnet username and password $patator rdp_login host=<target IP> user=FILE0 0=<username_file> password=FILE1 1=<password_file> -x ignore:code=131 ReportUsed HardwareReferences |
