{"id":3314,"date":"2020-06-24T18:41:14","date_gmt":"2020-06-24T09:41:14","guid":{"rendered":"\/blog\/?p=3314"},"modified":"2023-09-21T09:26:41","modified_gmt":"2023-09-21T00:26:41","slug":"fortify-ssc-token-%ec%83%9d%ec%84%b1%ec%82%ad%ec%a0%9c-%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8-%ec%9c%88%eb%8f%84%ec%9a%b0-%eb%b0%b0%ec%b9%98","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=3314","title":{"rendered":"[Fortify] SSC Token \uc0dd\uc131&#038;\uc0ad\uc81c \uc2a4\ud06c\ub9bd\ud2b8 (\uc708\ub3c4\uc6b0 \ubc30\uce58)"},"content":{"rendered":"\n<div class=\"wp-block-file\"><a href=\"\/blog\/wp-content\/uploads\/2020\/06\/get_ssc_token.bat\">get_ssc_token<\/a><a href=\"\/blog\/wp-content\/uploads\/2020\/06\/get_ssc_token.bat\" class=\"wp-block-file__button\" download>\ub2e4\uc6b4\ub85c\ub4dc<\/a><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@ECHO OFF\nREM #######################################################\nREM #\nREM # Fortify SSC\uc5d0\uc11c \ud1a0\ud070\uc744 \uc0dd\uc131 \ub610\ub294 \uc0ad\uc81c\ud55c\ub2e4.\nREM # \uc0dd\uc131\ub41c \ud1a0\ud070\uc740 \"$TOKEN_DIR\/\ud1a0\ud070\uba85\"\uc73c\ub85c \uc800\uc7a5\ub41c\ub2e4.\nREM #\nREM #######################################################\nREM CODEPAGE\ub97c UTF-8\ub85c \ubcc0\uacbd\nCHCP 65001\n\nSET \"FORTIFY_CLIENT=fortifyclient\"\nSET \"SSC_URL=http:\/\/10.10.10.31:8083\/ssc\"\nSET \"SSC_USER=admin\"\nSET \"SSC_PW=MyPasswd12\"\nSET \"TOKEN_DIR=D:\\ssc_tokens\"\nSET \"TMP_FILE1=ssc_token.tmp\"\n\nREM #######################################################\nREM # main\nREM #######################################################\nCALL :MAKE_DIR %TOKEN_DIR%\nCALL :FUNC_REMOVETOKEN %SSC_USER%\nCALL :FUNC_GETTOKEN \"AnalysisUploadToken\" 90\nCALL :FUNC_GETTOKEN \"ScanCentralCtrlToken\" 90\nCALL :READ_TEST \"AnalysisUploadToken\"\nCALL :READ_TEST \"ScanCentralCtrlToken\"\n\nEXIT \/B %ERRORLEVEL%\n\nREM #######################################################\nREM # \ud568\uc218: \ubc1c\uae09\ubc1b\uc740 \ud1a0\ud070\uc5d0 \ub300\ud55c \uc77d\uae30 \ud14c\uc2a4\ud2b8\nREM # ex) CALL :READ_TEST \"AnalysisUploadToken\"\nREM #######################################################\n:READ_TEST\nSET \/P TEST_STR=&lt; %TOKEN_DIR%\\%1\nECHO Read Test: %FORTIFY_CLIENT% token -gettoken \"%TEST_STR%\" -daysToLive 90\nEXIT \/B \/0\n\nREM #######################################################\nREM # \ud568\uc218: \ub514\ub809\ud1a0\ub9ac\ub97c \ub9cc\ub4e0\ub2e4.\nREM # ex) CALL :MAKE_DIR %TOKEN_DIR%\nREM #######################################################\n:MAKE_DIR\nIF NOT EXIST %1 MKDIR %1\nEXIT \/B \/0\n\nREM #######################################################\nREM # \ud568\uc218: \ud1a0\ud070\uc744 \uc0ad\uc81c\ud55c\ub2e4.\nREM # ex) CALL :FUNC_REMOVETOKEN %SSC_USER%\nREM #######################################################\n:FUNC_REMOVETOKEN\nCALL %FORTIFY_CLIENT% -url %SSC_URL% -user %SSC_USER% -password %SSC_PW% invalidatetoken -invalidateForUser %1\nEXIT \/B \/0\n\nREM #######################################################\nREM # \ud568\uc218: \ud1a0\ud070\uc744 \uc5bb\uc5b4 \uc628\ub2e4.\nREM # ex) CALL :FUNC_GETTOKEN \"AnalysisUploadToken\" 90\nREM #######################################################\n:FUNC_GETTOKEN\nCALL %FORTIFY_CLIENT% -url %SSC_URL% -user %SSC_USER% -password %SSC_PW% token -gettoken %1 -daysToLive %2 | FINDSTR \"Authorization Token: \" 1> %TMP_FILE1%\nFOR \/F \"DELIMS=\" %%X IN (%TMP_FILE1%) DO SET TOKEN_STR=%%X\nECHO %TOKEN_STR%\nSET TOKEN_STR=%TOKEN_STR:~21,36%\nECHO %TOKEN_STR%>%TOKEN_DIR%\\%1\nDEL \/F \/Q %TMP_FILE1%\nEXIT \/B \/0<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[66],"tags":[],"class_list":["post-3314","post","type-post","status-publish","format-standard","hentry","category-computing_fortify"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3314"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3314\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}