This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* USAGE: npx ts-node xor.ts | |
*/ | |
// Cipher Text #1 | |
const ct1 = 'fd034c32294bfa6ab44a28892e75c4f24d8e71b41cfb9a81a634b90e6238443a813a3d34'; | |
// Cipher Text #2 | |
const ct2 = '6b65813f4fe991efe2042f79988a3b2f2559d358e55f2fa373e53b1965b5bb2b175cf039'; | |
// Cipher Text Key | |
const key = 'de328f76159108f7653a5883decb8dec06b0fd9bc8d0dd7dade1f04836b8a07da20bfe70'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net from 'net'; | |
import async from 'async'; | |
const { VMIP = '127.0.0.1', PORTS = '1-65535' } = process.env; | |
const MAX_SCANS = 4096; | |
const SCAN_HOST = VMIP; | |
const TIMEOUT = 2000; | |
const report: { [port: number]: string } = {}; | |
const ports: number[] = []; | |
const groups: string[] = PORTS.split(','); |