tcp, udp, process, thread count: for view ddcc attack , then send warning :return:
()
| 152 | return NET_IN, NET_OUT |
| 153 | |
| 154 | def tupd(): |
| 155 | ''' |
| 156 | tcp, udp, process, thread count: for view ddcc attack , then send warning |
| 157 | :return: |
| 158 | ''' |
| 159 | s = subprocess.check_output("ss -t|wc -l", shell=True) |
| 160 | t = int(s[:-1])-1 |
| 161 | s = subprocess.check_output("ss -u|wc -l", shell=True) |
| 162 | u = int(s[:-1])-1 |
| 163 | s = subprocess.check_output("ps -ef|wc -l", shell=True) |
| 164 | p = int(s[:-1])-2 |
| 165 | s = subprocess.check_output("ps -eLf|wc -l", shell=True) |
| 166 | d = int(s[:-1])-2 |
| 167 | return t,u,p,d |
| 168 | |
| 169 | def get_network(ip_version): |
| 170 | if(ip_version == 4): |