Daemon02 - HITB Malaysia 2008 CtF
Analysis
Daemon02 is a classic example of command injection vulnerability. It is a daemon listening on five ports from 2221 to 2225 which receives input from users, parse it into command, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n execute that command on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 host system. Available commands are:
* help: print help banner
* status : print system uptime
* procs : print list of running processes
The interesting one is procs. When receiving "procs " command, daemon02 will first perform various checks for dangerous metacharacters such as ";", "|", and "&". If any of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m found, daemon02 will replace it with an empty space. Then cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 command line string is built as "proc ax | grep -v root | grep -v nobody | grep -v apache | grep -v args". Finally it calls popen(3) with cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 command line string described in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 last sentence as cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first argument. The result of popen(3) will be returned to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 user.
Vulnerability
As you can see, part of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 input string is used at cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 end of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 comman…
Daemon02 is a classic example of command injection vulnerability. It is a daemon listening on five ports from 2221 to 2225 which receives input from users, parse it into command, cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365n execute that command on cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 host system. Available commands are:
* help: print help banner
* status : print system uptime
* procs : print list of running processes
The interesting one is procs. When receiving "procs " command, daemon02 will first perform various checks for dangerous metacharacters such as ";", "|", and "&". If any of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365m found, daemon02 will replace it with an empty space. Then cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 command line string is built as "proc ax | grep -v root | grep -v nobody | grep -v apache | grep -v args". Finally it calls popen(3) with cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 command line string described in cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 last sentence as cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 first argument. The result of popen(3) will be returned to cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 user.
Vulnerability
As you can see, part of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 input string is used at cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 end of cá cược thể thao bet365_cách nạp tiền vào bet365_ đăng ký bet365 comman…