2020.2.25 training summary

Calculator
rigid thinking forget pushed backwards
ac
from the start to become b, if b is less than a direct subtraction on the line. Timeout and I thought the same, but b is greater than a case of my ideas will be more judgment and perform calculations, in fact, as long as a large energy divided by 2 then this step will earn until less than a b on the line

#include<bits/stdc++.h>
using namespace std;
int cnt=0;
int main(){
    ios::sync_with_stdio(false);
	int a,b;
	while(cin>>a>>b){
		cnt=0;
		if(a==b){
			cout<<0<<endl;
		}
		else{
			while(a<b){
				if(b%2==0){
					b/=2;
				}
				else{
					b++;
				}
				cnt++;
			}
			cout<<cnt+(a-b)<<endl;
		}
	}
	return 0;
} 

Timeout thinking, thinking positive, forward push the game, if a * 2 b + 2 or greater then the province will step -1, the results of this idea overtime, to go to work

#include<bits/stdc++.h>
using namespace std;
int cnt=0;
int main(){
    ios::sync_with_stdio(false);
	int a,b;
	while(cin>>a>>b){
		cnt=0;
		if(a==b){
			cout<<0<<endl;
		}
		else{
			while(a!=b){
				if(a>b){
					cnt+=a-b;
					break;
				}
				else{
					while(a<b){
						if(a*2>=b+2){ 	
							cnt++;
							a--;
							continue;
						}
						else{
							cnt++;
							a*=2;
							continue;
						}
					}
				}
			}
			cout<<cnt<<endl;
		}
	}
	return 0;
} 

Eat
structural body less fast row

#include<bits/stdc++.h>
using namespace std;
struct c{
	int id;
	int pf;
	int ss;
	int pj;
	int jl;
}C[10005];
int cmp(c a,c b){
	if(a.pf==b.pf){
		return a.id>b.id;
	}
	else return a.pf>b.pf;
}
int main(){
	int n,a,b,c;
	int p[1005],q[1005];
	while(scanf("%d %d %d %d",&n,&a,&b,&c)!=EOF){
		for(int i=0;i<n;i++){
			scanf("%d %d %d %d %d",&C[i].id,&C[i].pf,&C[i].ss,&C[i].pj,&C[i].jl);
		}
		sort(C,C+n,cmp);
		for(int i=0;i<n;i++){
			if(!a){
				if(C[i].pj<=b&&C[i].jl<=c)printf("%d %d %d %d %d\n",C[i].id,C[i].pf,C[i].ss,C[i].pj,C[i].jl);
			}
			else{
				if(C[i].ss&&(C[i].pj<=b&&C[i].jl<=c))printf("%d %d %d %d %d\n",C[i].id,C[i].pf,C[i].ss,C[i].pj,C[i].jl);
			}
		}
	}
}

Find prophet
there are two cases, people are concerned about other people or who are concerned about .hash storage array. Then run cycles. See who is not concerned about the people and all the attention

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
	int p[1005],q[1005];
	int a,b;
	while(cin>>n>>m){
		int flag=1;
		memset(p,0,sizeof(p));
		memset(q,0,sizeof(q));
		for(int i=0;i<m;i++){
			cin>>a>>b;
			p[b]++;
			q[a]++;
		}
		for(int i=1;i<=n;i++){
			if(p[i]==n-1&&q[i]==0){
				cout<<i<<endl;
				flag=0;
				break;
			}
		}
		if(flag)cout<<-1<<endl;
	}
}

Palindromic up
the number of letters to the map stored inside, and then add the line

#include<bits/stdc++.h>
using namespace std;
int cnt=0;
int main(){
    ios::sync_with_stdio(false);
	int a,b;
	while(cin>>a>>b){
		cnt=0;
		if(a==b){
			cout<<0<<endl;
		}
		else{
			while(a!=b){
				if(a>b){
					cnt+=a-b;
					break;
				}
				else{
					while(a<b){
						if(a*2>=b+2){
							cnt++;
							a--;
							continue;
						}
						else{
							cnt++;
							a*=2;
							continue;
						}
					}
				}
			}
			cout<<cnt<<endl;
		}
	}
	return 0;
} 

Summary: rigid thinking only positively push forward the same topic route that question I think only the top and the bottom number will be different than the middle, not to abandon the launch...


Malicious code analysis study:
the malware presence of malicious behavior, the behavior of the rest tomorrow learning record

Download and starters
Two common malicious code is downloaded and starters. Downloader to download other malicious code from the Internet and run on the local system, downloader usually packaged with exploits (exploit), Downloader common Windows API function URLDownloadtoFileA and WinExec, to download and run the new malicious code.
starter (also called loader) is a type of executable file that installs secretly executed immediately or in the future to run malicious code usually start it contains a malicious code to be loaded.
backdoor (backdoor)
back door (backdoor) is another type of malicious code, which allows an attacker remote access to a victim's machine. backdoor is one of the most common malicious code, they have a variety of functions, and the existence of various forms and sizes. backdoor code tends to achieve the full set of features, so when using a backdoor, the attacker usually do not need to download additional malicious code.
backdoor use of the Internet communication is diverse. However, a common approach is to use .HTTP port 80 using the HTTP protocol is the protocol most commonly used for outbound traffic, so it evil Code provides a good opportunity to be confused with other traffic.
Reverse shell
reverse shell is to initiate a connection from the infected machine, it provides the attacker's privileges shell access infected machines. Reverse shell, or as a separate malicious code exists, or later as a complex program component is present in the shell reverse, an attacker is able to command the same as run on the local system.
Windows shell reverse
used as a Windows system cmd.exe reverse shell, there Two simple malicious coding: basic method and multi-threading technology.
Based approach popular among malware writers because it is easy to write, and consistent with the effects of multi-threading technology. It involves calling CreateProcess function, and manipulate STARTUPINFO structure passed to the CreateProcess First, create a socket, and with the remote server connection is established. then, bind the socket and cmd.exe standard flow (standard input, standard output and standard error). cmd.exe program calls the CreateProcess function to create a way to hide window, hide the victims cmd. exe process.
Windows reverse shell version involves a multi-threaded socket, two pipes and create two threads (query API function calls CreateThread, CreatePipe). this method is sometimes malicious code as a strategy to tamper with or coding after a socket .CreatePipe incoming or outgoing data reader to bind the end of a conduit, such as standard input (stdin) and standard output (stdout) .CreateProcess method to bind a standard flow duct, and not tied directly to the socket calls CreateProcess method malicious code will produce two threads: a pipe used to read data from standard input, and Writing data to the socket. Also a socket for a read data from and write data to a standard output pipe. Typically these two threads data encoding data falsification.
Remote Control Tool
Remote Control Tool (RAT) is used to remotely manage one or more computers. remote control tools frequently for a specific goal, such as a bypass network to steal information or execute targeted attacks.
botnet
zombie network is infected host (also known as bots) of collection. they are controlled by a single entity, commonly referred to by one controller zombie machines as a server. objective botnet infected machines as much as possible, to build a larger network bots. propagation network so that other bots malicious code, or worm, or perform distributed denial of service (DDoS) attack. in carrying out distributed denial of service attacks, bots will visit all the same site at the same time, the botnet can make this site hang.
Different remote control tools and botnets
僵尸网络感染和控制数以百万记的主机.远程控制工具通常只控制很少数量的主机.all hosts botnets are controlled at the same time, and each victim is a remote control tool for remote control units. Because the more remote control tool requires the attacker and victim hosts between closely interact
login credentials stolen
attackers often steal login credentials, mainly in the following three types of malicious code:
等待用户登录以窃取登录凭证的程序.dump windows system stored procedure information, such as password hash value of the program to use it directly, or offline to crack.
`keyloggers.
GINA interception
in windows XP system, malicious code using Microsoft graphical interface identification and authentication (GINA) interception technology to steal login credentials .GINA is designed to let users add some code to legitimate third parties from define the login process, such as the hardware can not be radio frequency identification (RFID) token or smart card for authentication, etc. malicious code writers use to support third-party GINA to load theft device.
GINA implemented in msgina.dll, this DLL in users log into the system by the winlogon process executable file is loaded .winlogon also for third-party custom implementation process DLL Work load third-party DLL (similar middle attack) between winlogon and GINADLL .windows with the following registry storage winlogon need to load third-party DLL:
. HKLM \ SOFTWARE \ in the Microsoft \ Windows NT \ CurrentVersion \ Winlogon \ GinaDLL
password hash dump
Dump windows password hash is one way to get malicious code system login credentials of an attacker trying to crawl these password hashes for offline brute force. Or use them to perform Pass-the-Hash attack .Pass-the-Hash Attack without the need to crack passwords or decrypted hash key to get out of the secretarial, using LM or NTLM hashes to authenticate the remote host, and thus gain access.
Pwdump and pass-the-hash Toolkit is to provide a password hash dump free software packages available. most anti-virus software have their signatures, the attacker usually the case to avoid detection will compile their proprietary version.
PWDump is a collection of programs that from a security account manager (SAM) output local user accounts LM and NTLM password hashes .pwdump attack by injecting a DLL into the local security authority subsystem service (LSASS) process. password hash dump tool typically accessed for the lsass.exe process, because it has sufficient privileges many API functions. Once the DLL to run lsass.exe in, pwdump will call GetHash, this function, the purpose is to perform password hash extraction extraction function using undocumented wi ndows function to enumerate users on the system, and each user does not get a password to decrypt the hash.
processing program pwdump variant, DLL needs analysis, in order to determine how it performs password hash dump operation. First check the exported DLL function, the default function is exported GetHash.

Released seven original articles · won praise 0 · Views 95

Guess you like

Origin blog.csdn.net/qq_35927490/article/details/104505724
Recommended