Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the network port scanning support / 네트워크 포트 스캐닝 지원 #24

Merged
merged 5 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions plugins/portscan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/python3
#
# portscan.py
# NMAP port scanning wrapper for Caterpillar Proxy
#
# Caterpillar Proxy - The simple web debugging proxy (formerly, php-httpproxy)
# Namyheon Go (Catswords Research) <[email protected]>
# https://github.com/gnh1201/caterpillar
# Created at: 2022-01-26 (github.com/gnh1201/welsonjs)
# Updated at: 2024-07-04
#
import sys
import nmap
import json

from base import Extension

class PortScanner(Extension):
def __init__(self):
self.type = "rpcmethod"
self.method = "discover_ports_by_hosts"
self.exported_methods = []

def dispatch(self, type, id, params, conn):
hosts = params['hosts']
binpath = params['binpath']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binpath는 불필요한 것 같습니다.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nmap 도구에 의존하므로 바이너리 경로를 알려줄 필요가 있어 추가되었습니다. 향후 더 좋은 방법이 있는지 고민해보겠습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 소스코드 상으로는 binpath 변수를 사용하지 않는 것 같은데요, 혹시 다른곳에서 사용중인걸까요?


#result = nm.scan(hosts=hosts, arguments='-T5 -sV -p21-25,80,139,443,445,1883,2179,2323,3389,7547,8080,8443,8883')
result = nm.scan(hosts=hosts, arguments='-T5 -sV -p0-65535 --max-retries 0')

return result;

if __name__ == "__main__":
main(sys.argv)