Today I'am going to talk about how to run an external app on the Burp suite. In fact, I've written something similar in the past, and it's finally updated to do the same thing with the Burp suite.
Run other application on ZAP
(https://www.hahwul.com/2019/07/easy-security-testing-with-applications-bridge-in-zap.html)
![]() |
드디어! Burp도 된다! |
if you use MacOS?
MacOS에선 리눅스 xterm과 같이 기본 터미널에 명령행을 전달할 수 없습니다. (파일 로드만 가능함)그래서 외부 코드를 실행해줄 수 있는 파일을 만들고 이를 호출하여 실행이 필요합니다.
MacOS is unable to forward command lines to the primary terminal, such as Linux xterm. (File load only)
So you need to create a file that can run an external code and call it to run.
echo '
on run argv
if length of argv is equal to 0
set command to ""
else
set command to item 1 of argv
end if
if length of argv is greater than 1
set profile to item 2 of argv
runWithProfile(command, profile)
else
runSimple(command)
end if
end run
on runSimple(command)
tell application "Terminal"
activate
set newTab to do script(command)
end tell
return newTab
end runSimple
on runWithProfile(command, profile)
set newTab to runSimple(command)
tell application "Terminal" to set current settings of newTab to (first settings set whose name is profile)
end runWithProfile
' | osascript - "$@" > /dev/null
실행이 필요하기 때문에 권한을 부여해줍니다.
Grants permission because it requires execution.
$ chmod 755 thisscript.sh
Install Custom send to
BApp 스토어에 보면 Custom Send To 라는 앱이 있습니다. Pro 버전 전용도 아니니 CE 유저분들도 설치해서 사용할 수 있습니다.If you look at the BApp store, there is an app called Custom Send To. It's not only for Pro version, so CE users can install it and use it.
Setting application information
설치를 완료하면 탭이 생기게 됩니다. 해당 탭에서 어떤 명령을 실행할지, 어떤 터미널에서 실행할지 지정해줄 수 있습니다.When you complete the installation, you will have tabs. You can specify which commands to run on that tab and which terminals to run.
리눅스의 경우 기본 터미널인 xterm을 유지해도 되지만, MacOS의 경우 문제가 있어서 아까 만들어둔 스크립트로 경로를 변경해줍니다. 이 때 %C는 위에 지정한 명령이 들어가는 자리입니다.
For Linux, you can keep the default terminal xterm, but for MacOS, there is a problem, so you change the path to the script you created. At this point, %C is the place where the command specified above is placed.
< Entires >
%S : Seleted data(string)
%F : Seleted data(save file)
< Miscellaneous >
%C : Command
Send to Other Application
Request tab
=> Copy All data
=> Context menu(right click)
=> Send to your app
여기서 재미있는점은 Send to 로 요청 시 request 탭에서 선택한 부분이 파일로 저장되어 파일 인자값으로 사용됩니다. XSpear의 경우 --raw 옵션을 통해 파일을 읽을 수 있어서 아까 설정에서 그렇게 지정해줬습니다.
The interesting point here is that when you request Send to , the selected portion of the request tab is saved to a file and used as a file argument. For XSpear, you can read the file through the --raw option, so that's what the upper this post.
Conclusion
예전 ZAP글에도 써놨듯이, 외부 툴 연동은 정말 유용한 기능입니다. 꼭 세팅해두고 쓰시길 바래요!
![]() |
HAHWULSecurity engineer, Gopher and H4cker! |
windows 10환경에서도 사용하려면 MacOS와 같이 외부에서 실행가능하도록 설정을 바꿔줘야 할까요??
ReplyDelete윈도우환경에서는 "내부 또는 외부 명령 ... 오류"가 발생하여 실행할 외부 app을 환경변수에도 적용해보았으나 동일한 오류가 발생하였습니다.
Delete그래서 외부에서 사용할 app의 절대경로를 context menu entries의 command line에 모두 적어주니 정상 실행되는 것을 확인하였습니다! 혹시 정정할 부분이 있다면 알려주세요~!!:-)
넵, 말씀주신대로 절대경로로 직접 넘겨주는게 제일 좋긴합니다~ 제가 알기론 cmd.exe도 외부 코드 전달이 가능한걸로 알고 있어서, 별도로 스크립팅 없이 명령 전달해주셔도 될듯합니다.
Delete