{"id":26833514,"url":"https://github.com/mr-won/pc_wall","last_synced_at":"2025-03-30T15:29:15.059Z","repository":{"id":281279780,"uuid":"944798018","full_name":"mr-won/PC_WALL","owner":"mr-won","description":"PC 방화벽 프로그램 개발","archived":false,"fork":false,"pushed_at":"2025-03-08T01:43:36.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T02:27:12.357Z","etag":null,"topics":["firewall","igloocorporation","python-auto","scapy","sniff"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mr-won.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T01:38:41.000Z","updated_at":"2025-03-08T01:44:27.000Z","dependencies_parsed_at":"2025-03-08T02:25:04.919Z","dependency_job_id":"0389d51e-fc9f-482e-98ac-31062279aba8","html_url":"https://github.com/mr-won/PC_WALL","commit_stats":null,"previous_names":["chihyeonwon/pc_wall","mr-won/pc_wall"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FPC_WALL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FPC_WALL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FPC_WALL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FPC_WALL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mr-won","download_url":"https://codeload.github.com/mr-won/PC_WALL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246338023,"owners_count":20761307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firewall","igloocorporation","python-auto","scapy","sniff"],"created_at":"2025-03-30T15:29:14.476Z","updated_at":"2025-03-30T15:29:15.027Z","avatar_url":"https://github.com/mr-won.png","language":null,"readme":"# PC_WALL\nPC 방화벽 프로그램 개발\n\n25.03~\n\n## DEMO CODE\n```python\nfrom scapy.all import sniff\nimport os\n\n# 차단할 IP 목록\nBLOCKED_IPS = [\"192.168.1.100\", \"10.0.0.5\"]\n\n# 차단할 포트 목록\nBLOCKED_PORTS = [22, 80]  # SSH, HTTP 차단 예시\n\ndef packet_callback(packet):\n    \"\"\"패킷을 감시하고 특정 조건에 따라 차단하는 함수\"\"\"\n    if packet.haslayer(\"IP\"):\n        src_ip = packet[\"IP\"].src\n        dst_ip = packet[\"IP\"].dst\n\n        # 차단된 IP 주소 감지\n        if src_ip in BLOCKED_IPS or dst_ip in BLOCKED_IPS:\n            print(f\"[BLOCKED] 패킷 차단: {src_ip} → {dst_ip}\")\n            return\n\n    if packet.haslayer(\"TCP\"):\n        dst_port = packet[\"TCP\"].dport\n        if dst_port in BLOCKED_PORTS:\n            print(f\"[BLOCKED] 포트 차단: {dst_port}\")\n            return\n\n    print(f\"[ALLOWED] 패킷 허용: {packet.summary()}\")\n\n# 네트워크 인터페이스 지정 (윈도우의 경우 'Ethernet', 리눅스는 'eth0' 또는 'wlan0' 등)\nINTERFACE = \"Ethernet\"  \n\nprint(\"방화벽 실행 중... 패킷 감시 시작\")\nsniff(prn=packet_callback, iface=INTERFACE, store=0)\n```\n\n변수 Rule Set 를 뭘로 할지 고민\n```\n출발지 ip\n출발지 포트\n\n목적지 ip\n목적지 포트\n\n지속시간\n\n건수\n\n탐지 시간\n\n탐지명\n\n분석룰셋\n```\n| 한글 변수명  | 영어 변수명         |\n|------------|------------------|\n| 출발지 IP   | `src_ip`        |\n| 출발지 포트 | `src_port`      |\n| 목적지 IP   | `dst_ip`        |\n| 목적지 포트 | `dst_port`      |\n| 지속시간   | `duration`      |\n| 탐지시간   | `detection_time` |\n| 메소드명   | `method_name`    |\n| 분석 룰셋명 | `analysis_ruleset` |\n| 상태 코드   | `status_code`   |\n| 프로파일   | `profile`       |\n\n\n차단할 ip 목록을 엑셀 파일로 전달\n포트를 엑셀파일로 전달\n\n조건에 따라 차단\n\n방화벽 로그 데이터를 저장하거나 분석하는 코드\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-won%2Fpc_wall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-won%2Fpc_wall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-won%2Fpc_wall/lists"}