ARP Spoofing이 안되는 경우 ( 정책 상 Blocking 되는 경우)
iptables를 이용하면 됩니다.
iptables -t nat -A OUTPUT -p tcp -o wlan0 -j DNAT --to ip:port
주의 할 것은, 모든 tcp 통신을 포워딩 하기 때문에
DNS 쿼리도 이곳으로 날리게 됩니다.
따라서 먼저 한번 접속해서 도메인 이름을 알도록 하거나
--dports 80,443 등 옵션을 추가해 주는 것이 좋습니다.
SecureKim
오전 10:16
MITM, Network, proxy, Security
No comments

@echo off title %1 :start color set t=%time:~-5% set pingIP=%1 set cnt=0 :re set /a cnt+=1 cls echo -^> %pingIP% if %cnt% EQU 1 echo State : / if %cnt% EQU 2 echo State : ― if %cnt% EQU 3 echo State : \ if %cnt% EQU 4 ( echo State : | set cnt=0 ) ping %pingIP% -n 1 >nul if %errorlevel% EQU 0 ( color 03 ) else ( color 04 ) ENDLOCAL goto re---------------------------------------------------------------
@echo off set a=1 echo 스캔을 원하는 아이피 대역 set /p ip= :start ping %ip%.%a% -n 1 | find "의 응답" >> scan.txt echo ping to %ip%.%a% set /A a+=1 if %a% NEQ 255 goto start :end
SecureKim
오전 10:35
APK to java, apk파일을 java소스로, Batch, windows
No comments
@echo off
set Title_BY=ver1.1_by_B.Y.
title %Title_BY%
echo 7zip, dex2jar-2.0, jd-cli-0.9.1 이 모두 있어야 합니다.
7z >NUL
if %ERRORLEVEL% EQU 0 (
goto GO_execute
) ELSE (
echo 7zip을 설치하고, 환경변수로 지정해주세요.
pause
goto GO_END
)
:GO_execute
set pth=%cd%
set new=Src_%date:~5%_%time:~0,2%_%time:~3,2%_%time:~6,2%
set /P pt^=APK (with path):
mkdir %pth%\%new%
rem APK to JAR
7z x %pt% -y -o%pth%\%new%
IF EXIST %pth%\dex2jar-2.0\classes-dex2jar.jar (
del /S /Q %pth%\dex2jar-2.0\classes-dex2jar.jar
)
setlocal enabledelayedexpansion
cd dex2jar-2.0
set LIB=lib
set CP=
for %%X in ("%LIB%"\*.jar) do (
set CP=!CP!%%X;
)
::에러가 나면 여기를 수정해보세요.
::java -Xms512m -Xmx1024m -cp "%CP%" com.googlecode.dex2jar.tools.Dex2jarCmd %pth%\%new%\classes.dex
java -Xms512m -Xmx1024m -cp "%CP%" com.googlecode.dex2jar.tools.Dex2jarCmd %pth%\%new%\classes.dex
pause
cd ..
cd %pth%
mkdir %pth%\%new%\javaSrc
java -jar jd-cli-0.9.1\jd-cli.jar -od %pth%\%new%\javaSrc %pth%\dex2jar-2.0\classes-dex2jar.jar
cp %pth%\dex2jar-2.0\classes-dex2jar.jar %pth%\javaSrc.jar
start "" %pth%\%new%\javaSrc
::cd %pth%\%new%\javaSrc
IF EXIST %pth%\dex2jar-2.0\classes-dex2jar.jar ( del /S /Q %pth%\dex2jar-2.0\classes-dex2jar.jar )
cls
:_Find
if EXIST findInJavaSrc.bat (
findInJavaSrc.bat %pth%\%new%\javaSrc %Title_BY%
)
:GO_END
----------------------------------findInJavaSrc.bat------------------------------------
@echo off
set Title_BY=%2
if DEFINED Title_BY (
title %Title_BY%
) else (
title findInJavaSrc by B.Y.Kim
)
cls
color 03
set pth=%cd%
set rpth=%1
if NOT DEFINED rpth (
set rpth=%cd%
) ELSE (
set rpth=%1
)
IF EXIST %rpth%\finded (del /Q /S %rpth%\finded)
mkdir %rpth%\finded
cls
cd %rpth%
echo 찾는 위치 : %rpth%
echo 찾을 문자열 : %pth%\findStringList.txt
type %pth%\findStringList.txt
echo.
IF EXIST %pth%\findStringList.txt (
echo 위 문자열들을 찾는 중입니다... 잠시만 기다려 주세요.
echo.
for /f "delims= delims=: tokens=2 eol=; usebackq" %%i in ("%pth%\findStringList.txt") do call :FOR_GO %%i
echo Find END___
goto FOR_END
:FOR_GO
findstr /N /I /S /C:"%1" *.java | findstr /V \/\/ >"%rpth%\finded\%1.txt"
exit/b
) ELSE (
echo 찾을 문자열이 없습니다.
echo "" >> "%pth%\findStringList.txt"
start "" "%pth%\findStringList.txt"
)
:FOR_END
color
start "" %rpth%\finded
:end
----------------------------------------------------------------------
SecureKim
오후 10:08
디렉토리 찾기, 윈도우 커맨드, 파일 찾기, Batch, command line, windows
No comments
@echo off title byfind by B.Y. set p1=%1 if NOT DEFINED p1 goto _help set p2=%2 set p3=%3 set p1=%p1:~1% if DEFINED p3 ( set p2=%3 set dir=%2 ) else ( set dir=%cd% ) if %p1% EQU d ( goto _directory ) else ( if %p1% EQU f goto _file goto _help ) :_directory dir /s /b /a:d %dir%\*%p2%* goto _exit :_file dir /s /b %dir% | find "%p2%" goto _exit :_help echo usage : %0 [/d] [/f] [directory] "name" echo. echo /d : directory echo /f : file echo. goto _exit :_exit ::exit
SecureKim
오후 3:37
가짜 인증서, 검증, 인증서, Node.js, Security
No comments
var http=require('http'),
https = require('https'),
express = require('express'),
fs = require('fs');
var options = {
key: fs.readFileSync('my.key'),
cert: fs.readFileSync('my.crt')
};
var port1 = 80;
var port2 = 443;
var app = express();
http.createServer(app).listen(port1, function(){
console.log("Http server listening on port " + port1);
});
https.createServer(options, app).listen(port2, function(){
console.log("Https server listening on port " + port2);
});
app.get('/', function (req, res) {
res.writeHead(200, {'Content-Type' : 'text/html'});
res.write('Welcome
');
res.write('Please login');
res.end();
});
app.get('/login', function (req, res){
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('Login
');
res.write('');
res.end();
})
app.post('/login', function (req, res){
var userId = req.param("userId");
var password = req.param("password")
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(userId+', you are now logged in.');
res.write(' back home');
res.end();
});